<feed xmlns='http://www.w3.org/2005/Atom'>
<title>dotemacs/tests/test-dirvish-config--quantize-thumb-size.el, branch main</title>
<subtitle>My Emacs configuration
</subtitle>
<id>https://git.cjennings.net/dotemacs/atom?h=main</id>
<link rel='self' href='https://git.cjennings.net/dotemacs/atom?h=main'/>
<link rel='alternate' type='text/html' href='https://git.cjennings.net/dotemacs/'/>
<updated>2026-07-06T14:14:30+00:00</updated>
<entry>
<title>fix(dirvish): stop webm preview thumbnails flashing blank</title>
<updated>2026-07-06T14:14:30+00:00</updated>
<author>
<name>Craig Jennings</name>
<email>c@cjennings.net</email>
</author>
<published>2026-07-06T14:14:30+00:00</published>
<link rel='alternate' type='text/html' href='https://git.cjennings.net/dotemacs/commit/?id=dca4e105e20d9218277ad61bb9c7f3e199ef699f'/>
<id>urn:sha1:dca4e105e20d9218277ad61bb9c7f3e199ef699f</id>
<content type='text'>
dirvish keys its media thumbnail cache on the exact preview-window pixel width (thumbnails/&lt;width&gt;/&lt;md5&gt;.jpg). Fast image thumbnails finish before the window settles, so their width is stable. Slow webm generation loses that race: the jpg is written at one width, then redisplay recomputes the width, and jitter across a floor boundary looks it up in a different bucket, so it misses, regenerates, and flashes blank.

I quantize the computed size to a 100px bucket (cj/dirvish-thumb-width-bucket) so jitter maps to one stable cache key. It's a filter-return advice on dirvish-media--img-size, added once dirvish-widgets loads. It's a local workaround for the upstream cache design. If the settle swing turns out larger than one bucket, widen the bucket or fall back to a width-independent hash.

The quantize math is unit-tested. The live preview render needs a manual check.
</content>
</entry>
</feed>
