Skip to content

v0.15.0 β€” option previews that show the option

Choose a tag to compare

@adamXbot adamXbot released this 16 Aug 13:12
· 10 commits to main since this release

Option previews that show the option.

The problem

Reported from a theme using these previews: the screenshot for an install option didn't show the option. "Tab close button on the left" rendered a whole browser window in which a 16px button had moved. "Re-enable the tab view button" showed a window that happened to contain one more button.

fxcss tweaks already cropped each option to the region it changes, derived from a pixel diff so it needs no per-option configuration. Two things stopped that working.

The crop was the union of every change

Right for an option that moves one widget; wrong for the ones people actually ask about. Swapping the tab close button changes every tab, so the union spans the whole strip and the "crop" is the window again.

Measured on a real capture:

case crop before crop after
one button appears 227Γ—200 340Γ—132, magnified
close button moves on every tab 881Γ—255 β€” 92% of the window width 340Γ—132 β€” 35%

The crop now centres on the busiest cluster of changes β€” one tab β€” grown for context, pulling in any other cluster that lands inside it, and capped so it can never become the whole window again.

Clustering is connected components on an 8px grid, in pure Python: the grid is a sixty-fourth of the work, and a clustering dependency for this would be absurd. ~0.03s on a real mask.

Panels only ever shrank

So a correctly cropped 16px button arrived in a README as a 16px button. They now scale up as well as down, capped at 3Γ—, past which a chrome screenshot is only blur.

Also

fxcss init --previews now renders those crops and publishes them beside the full windows, so a README's option accordions can embed <slug>-diff.png instead of a full browser window.

pipx upgrade fxcss