Live data from Hacker News

On Rendering Diffs

pierre.computer

61–70 of 73 posts

Re: On Rendering Diffs

#62
post #60

Earlier quoted context omitted.

I agree. I'm tired of these sites with glitchy scrolling and broken search due to trying to reimplement the browser in javascript. >fixing blink doesn’t help move the web forward. Historically making one browser engine faster encourages other engines to also be made faster. And realistically Blink has the majority of the browser market share, so it is the most important one to optimize for. Trying to move the web for…

Glad we solved glitchy scrolling for now (the title of this blog post was “on rendering diffs”, not “searching diffs”). Browser search on a 36 million line diff would not by great, but it’s something we hope to have a solution for. One step at a time.

If the solution for searching big pages was built into the browser then it would be fixed for every site instead of requiring each site to use a library or fix it themselves.

Re: On Rendering Diffs

#63

I don't understand the point of the inverse sticky technique. Scrolling too fast still breaks the experience (content refuses to scroll), and in a way that, at least to me, feels more disruptive than blanking for a fraction of a second. I might just be too used to blanking. Also ... shouldn't browsers just be able to render the diff without any of the trickery? Is the browser's job actually that hard for long pages,…

Also, I am deeply suspicious if they can properly support searching with Ctrl+F...

And yes, browsers should be just able to render the diffs, if the styling is somewhat minimal and there is no JS: I have a 6.3-MiB large HTML file with complete transcript of a certain TV series, formatted like

    Character #1: Well, that was interesting all right.
    Character #2: [sigh]
    Character #1: Lemme help you.
    Character #3: Yeehaw!
    [thump]
(the produces a small paragraph break, to indicate scene transitions), and it scrolls and searches just fine.

Re: On Rendering Diffs

#64
The problem with large diffs is usually with the human, not the computer. Large diffs are very hard to review, so more tools that help with the understanding of a large diff would be very welcome.

Re: On Rendering Diffs

#65
this approach is quite similar to what I use for rendering huge markdown files in https://mdview.io : 10MB files renders correctly and even Table of Content works. 15MB renders but scrolling is not as smooth as I wanted, will work on that. The approach described here https://igorstechnoclub.com/how-i-render-10mb-markdown-files...

Re: On Rendering Diffs

#66
nit: there is no Linux "v6" or "v7". The first and second version component cannot be separated, it's v6.0 and v7.0. Versions 6.0 and 6.1 have as much in common as 6.19 and 7.0. You could also call them 3.60 and 3.80, or 2.6.100 and 2.6.120.

Re: On Rendering Diffs

#67

For anyone else who's suffering, paste this in the console in devtools: document.getElementsByTagName('main')[0].style.margin = '0 auto';

I’m surprised to see such a reaction to a left-aligned content column. I’d have said it was pretty common, though probably not as common as it used to be. If I were to pick one problem with the presentation, it would rather be the font-size (12px is unequivocally too small), or the use of monospace (simply unsuitable for body text). And incidentally, HN suffers from two of these three problems.

> I’m surprised to see such a reaction to a left-aligned content column. I’d have said it was pretty common, though probably not as common as it used to be.

When it was common, columns weren't so thin I think

Re: On Rendering Diffs

#69

I don't understand the point of the inverse sticky technique. Scrolling too fast still breaks the experience (content refuses to scroll), and in a way that, at least to me, feels more disruptive than blanking for a fraction of a second. I might just be too used to blanking. Also ... shouldn't browsers just be able to render the diff without any of the trickery? Is the browser's job actually that hard for long pages,…

[deleted]

Re: On Rendering Diffs

#70

What an interesting article. I did not assume I would read it until the end when I opened it, but the writing was super clear and easy to follow. At the end, I admire the craft and patience to try to solve code diff rendering, and wish the folks at GitHub could put the same effort to improve their platform. On a side note, I feel that we’re going to see more and more of this type of agentic usage, in well defined sub…

Now GitHub can point an agent at this blog and say “implement this” :)
Post reply on HN