refactor(theme): build the font picker from the shared picker parts - #203
Merged
Conversation
The font picker landed with its own trigger, rows, dividers, footer actions and search box, so the one dropdown that sits next to the appearance settings looked unlike every other dropdown in the app: a smaller trigger with a chevron that swapped glyphs instead of rotating, rows tinted with accent-12% instead of carrying an accent label, and its own radius, paddings and shadow. It is now assembled from PickerTrigger, PickerSurface, PickerOption, PickerDivider and PickerFooterAction, the same parts as the encoding, key, identity and folder pickers. That also gives it the surface's behaviour: the list is a portalled float that flips above the trigger when the theme panel is scrolled near the bottom, and a bottom sheet on Android, neither of which the in-flow absolute menu could do. PickerTrigger and PickerOption gain an optional labelFont so a row can preview itself in the face it names, and PickerOption's icon becomes optional for rows whose label is the whole content. The in-surface filter box, until now copied between the distro icon picker and the host command field, is extracted as PickerSearch and used by all three.
This was referenced Sep 1, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The font picker added in #201 came with its own trigger, rows, dividers, footer
actions and search box. That left the one dropdown sitting next to the appearance
settings looking unlike every other dropdown in the app: a smaller trigger whose
chevron swapped glyphs instead of rotating, rows tinted with accent-12% instead of
carrying an accent label, and its own radius, paddings and shadow.
It is now assembled from
PickerTrigger,PickerSurface,PickerOption,PickerDividerandPickerFooterAction— the same parts as the encoding, key,identity and folder pickers.
That is not only cosmetic. Going through
PickerSurfacegives the list thesurface's behaviour, which the in-flow
absolutemenu could not have:scrolled near the bottom, instead of opening down into the scroll region;
desktop-sized float.
Two primitives are widened, both reusable:
PickerTriggerandPickerOptiontake an optionallabelFont, so a row canpreview itself in the face it names;
PickerOption'siconbecomes optional, for rows whose label is the wholecontent — the shape
DropdownMenuItemalready allowed.The in-surface filter box was copied byte-for-byte between the distro icon picker
and the host command field. It is extracted as
PickerSearchand used by allthree, so this removes a duplicate rather than adding a third.
One layout fix came out of looking at it: a nested fixed-height scroller inside
PickerSurfacefights the surface's own 320px cap — two scrollbars, and a rowclipped mid-glyph. The surface is the only scroller now, with the filter pinned
sticky top-0.Font previews, the monospace filter and its "show all fonts" escape hatch, the
free-text box and the "not installed" warning all behave as before.
Verification
tsc --noEmitclean; 207 tests acrossshared,connectionsandsettingspass.Driven in the headless build and read back from screenshots:
rendered in their own face, accent check on the selection;
*Monofamilies listed,Show all fontsandCustom font…footer actions;trigger plus the "isn't installed" line;
PickerSearchextraction.