Skip to content

refactor(theme): build the font picker from the shared picker parts - #203

Merged
kipavy merged 1 commit into
devfrom
fix/fontpicker-picker-parts
Sep 1, 2026
Merged

refactor(theme): build the font picker from the shared picker parts#203
kipavy merged 1 commit into
devfrom
fix/fontpicker-picker-parts

Conversation

@kipavy

@kipavy kipavy commented Sep 1, 2026

Copy link
Copy Markdown
Contributor

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,
PickerDivider and PickerFooterAction — the same parts as the encoding, key,
identity and folder pickers.

That is not only cosmetic. Going through PickerSurface gives the list the
surface's behaviour, which the in-flow absolute menu could not have:

  • it is a portalled float that flips above the trigger when the theme panel is
    scrolled near the bottom, instead of opening down into the scroll region;
  • it is a bottom sheet on Android, where the theme creator previously showed a
    desktop-sized float.

Two primitives are widened, both reusable:

  • PickerTrigger and PickerOption take an optional labelFont, so a row can
    preview itself in the face it names;
  • PickerOption's icon becomes optional, for rows whose label is the whole
    content — the shape DropdownMenuItem already 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 PickerSearch and used by all
three, 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
PickerSurface fights the surface's own 320px cap — two scrollbars, and a row
clipped 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 --noEmit clean; 207 tests across shared, connections and settings pass.

Driven in the headless build and read back from screenshots:

  • app font dropdown — presets, divider, pinned filter, installed families each
    rendered in their own face, accent check on the selection;
  • terminal font dropdown — only *Mono families listed, Show all fonts and
    Custom font… footer actions;
  • typing an unavailable family into the custom box — warning triangle in the
    trigger plus the "isn't installed" line;
  • distro icon picker — search intact after the PickerSearch extraction.

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.
@kipavy
kipavy merged commit cf7eef7 into dev Sep 1, 2026
4 checks passed
@kipavy
kipavy deleted the fix/fontpicker-picker-parts branch September 1, 2026 18:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant