Skip to content

ALI-2665: Dialog buttons, menu rows and path suggestions are 44 px by default - #69

Merged
michaelaguiar merged 3 commits into
mainfrom
aliasbot/ali-2665-44px-targets
Dec 4, 2026
Merged

michaelaguiar merged 3 commits into
mainfrom
aliasbot/ali-2665-44px-targets

Conversation

@michaelaguiar

@michaelaguiar michaelaguiar commented Dec 4, 2026 •

Copy link
Copy Markdown
Member

Fixes ALI-2665.

Mike's rule is that touch targets are at least 44 px. Back, Forward, Up, panel close buttons and the Format rows already were. Dialog buttons, menu rows and path suggestions only reached 44 px with larger targets turned on. Mike decided on 2026-12-04 that they're 44 px by default.

What grew (logical px, default setting)

Element Before After
Dialog buttons (question, conflict, unlock, Format, Connect to Server, Rename many) 30 tall 44 tall, at least 44 wide
Question dialog 170 184
Chooser bar: Open, Cancel, file type, name field 32 (bar 54) 44 (bar 66)
Open With: Open, Cancel 32 (bar 60, or 96 with "Always use") 44 (bar 72, or 108)
Menu items (context, pin, drive, share, chooser file type) 28 44
Context menu, 17 items 484 756
Path suggestions (8 rows plus "more") 28 each, 260 total 44 each, 404 total

With larger targets on, these were already 44 and stay 44.

Menus and path suggestions scroll instead of shrinking

Before, a menu taller than its window shrank its rows to fit, down to 28 px (ALI-2174). At 44 px the context menu would often be taller than the window, so menus now scroll:

  • A menu is at most the window's height.
  • Wheel: it scrolls the menu.
  • Keyboard: Up, Down, Home, End, Page Up and Page Down keep the picked item in view. Home, End and the Page keys are new to menus.
  • Cue: each edge the menu continues past shows a 20 px strip with a chevron in muted on surface (4.5:1) and a border hairline, so the cue doesn't rely on colour. It takes no clicks.
  • Positions: hit testing, painting and AT-SPI extents follow the scroll. Items scrolled away keep their real extents with showing=false, as sidebar rows do.
  • Cost: no timers. A wheel step repaints only the menu.
  • Suggestions: path suggestions use the same Scroller. Up, Down and Tab keep the picked one in view, the wheel scrolls them, and hover follows the rows. Their box no longer runs 6 px past the window.
  • Clicks: a menu's or the suggestions' padding, cues and "more" line take no clicks (Hit::Popup), so they neither close the menu nor end a path edit.

Tokens

  • New: button-height (44) and menu-scroll-cue (20).
  • Changed: menu-row goes from 28 to 44.
  • Usage notes updated on the related sizes.

The generator can't make one token refer to another, so the 44s are literal, and their notes name target.

Cost

Headless, 40 runs × 2 rounds, alternating builds:

main this branch
Open context menu, paint (median) 0.51 ms 0.52 ms
Open context menu, end to end (median) 2.50 / 2.55 ms 2.56 / 2.47 ms
Type a path character, paint (median) 0.49 ms 0.51 ms
Type a path character, end to end (median) 2.50 / 2.47 ms 2.58 / 2.59 ms

Typing a path paints about 0.02 ms slower, because the suggestion box is taller.

Checks

  • Unit tests pass. New ones check:

    • that buttons, menu items and suggestions are 44 at 1x and 2x, with larger targets off and on;
    • that a long menu in a short window keeps 44 px items and scrolls (this replaces the shrink-to-fit test);
    • that the keyboard keeps the picked item in view.
  • Clippy: 0 warnings. design/build --check passes.

  • e2e: the new dialog_buttons_menus_and_suggestions_are_44_by_default takes 24 screenshots (context menu at the top and scrolled to the end, question, conflict, suggestions and Open With, in light and dark at 1x and 2x). Nothing is clipped or overlapping.

    • Two checks were updated for the new sizes: the sidebar pin drag's item offset, and larger targets from the settings file, which now expects scrolling.
    • 129 of 130 passed on the full run. The one failure was the hard-coded 28 px offset, which passed after it was fixed.
  • Not changed (outside this ticket):

    • dialog text fields (30);
    • the "Do the same for the rest" and "Always use" check rows (24 and 28);
    • Open With's app rows (30);
    • the Trash bar's Empty Trash and Quick View's Open button.
  • Review: two rounds. The P2s (suggestions cut off in short windows, and screen-reader focus not scrolling a menu) and the P3s are fixed. The second round found only a hover P3, fixed in 91673aa.

  • Not yet: Mike's try of the dev build at ~/.cache/gannet-dev/gannet-targets.

…y default

Mike's rule is that targets are at least 44 px. Until now only larger targets
(targets = "large") grew these three, so with the default setting a dialog's
buttons were 30 px tall, the chooser's and Open With's buttons 32, and menu
items and path suggestions 28.

- design/tokens.json: a new button-height token (44 px) for dialog buttons and
  the chooser's and Open With's bottom bar buttons, menu-row goes from 28 to
  44, and a new menu-scroll-cue token (20 px). Usage notes on the sizes that
  build on them now say how the buttons add to them. Regenerated with
  design/build.
- Dialog buttons are at least 44 px wide as well as tall. Dialogs and bars grow
  by what the buttons add, as they already did for larger targets, which now
  leave these sizes alone.
- Menus keep 44 px items in any window. A menu taller than the window used to
  shrink its items to fit. Now it's as tall as the window and scrolls: the
  wheel scrolls it, and Up, Down, Home, End, Page Up and Page Down keep the
  item picked in view. An arrow with a hairline at each edge the menu goes on
  past says there's more, and takes no clicks. Hit testing, painting, the
  e2e state and AT-SPI extents all use the scrolled place. Items scrolled out
  of view keep their real extents and aren't showing, as the sidebar's rows
  do. Only the menu is repainted when it scrolls, and there are no timers.
- Tests: unit tests check that each layout's buttons, items and suggestion
  rows are 44 at 1x and 2x with larger targets off and on, that a long menu
  in a short window keeps 44 px items and scrolls, and that the keyboard keeps
  the picked item in view. A new e2e check takes screenshots of the context
  menu (top and scrolled to the end), a question, a conflict, the path
  suggestions and Open With, in light and dark at 1x and 2x. The larger
  targets and pin menu e2e checks now expect 44 px menu items.
@michaelaguiar

Copy link
Copy Markdown
Member Author

Review round 1. The code-review skill ran, and its findings were checked by hand. No P1.

Confirmed fine:

  • the scroll offset is used in hit testing, paint, AT-SPI and e2e rects;
  • nothing panics or divides by zero;
  • nothing grows twice with larger targets on;
  • dialogs grow and clamp to the window;
  • the cue is an arrow plus a hairline, with muted on surface at 4.9 to 6.6:1;
  • nothing runs at idle;
  • the generated files are current.

Being fixed:

  • P2: path suggestions get cut off in short windows now that their rows are 44 px, yet unseen rows can still be picked. Suggestions will scroll like menus.
  • P2: a screen reader focusing a menu item doesn't scroll it into view.
  • P3:
    • a right click on a cue opens a context menu, and a left click ends a path edit;
    • clicks in the menu's padding close it;
    • resizing doesn't keep the pick in view;
    • the README's wording on which targets grew.

Declined (P3): in a window under about 100 px the cues cover the whole menu view. The keyboard still works and nothing panics.

At 44 px a row, the path suggestions (eight and a count) can be taller than a
short window. Rows that didn't fit were cut off, and Up, Down and Tab could
pick one that wasn't drawn.

- The menu's scrolling moves into a Scroller shared by menus and the
  suggestions: rows, cues, hit testing, the scroll that keeps a row in view,
  and the wheel. The suggestions now scroll the same way: Up, Down and Tab
  keep the one picked in view, the wheel scrolls them when they're taller
  than the room, and a scroll repaints only their box. What's offered
  changing scrolls them back to the top. Their box also ended up to 6 px
  below the window, as its height was held to the room under the path box
  rather than under where it starts.
- A row under a cue is no longer "showing" to a screen reader, in menus or
  suggestions.
- A screen reader focusing a menu item scrolls it into view, as the keyboard
  does.
- A click with any button on a menu's or the suggestions' padding or cues, or
  on the "12 more folders" line, does nothing (Hit::Popup). It no longer
  closes the menu, opens another one, or takes the keyboard from the field or
  the sidebar.
- A resize or scale change scales a menu's and the suggestions' scroll, holds
  it to what it can be, and keeps the item picked in view.
- README: says which targets are 44 px by default, and which wait for larger
  targets.
- Tests: nine suggestions in a 400 px window keep 44 px rows, scroll and keep
  the pick in view; a screen reader's focus scrolls a menu; padding and cue
  clicks close nothing and keep the sidebar's keyboard; a resize keeps the
  pick in view. The e2e check adds a shot of the scrolled suggestions.
@michaelaguiar

Copy link
Copy Markdown
Member Author

Round 1 fixes are in 4784791.

  • P2, suggestions: menus and path suggestions now share one Scroller (rows, cues, hit testing, keeping the pick in view, the wheel). Suggestions taller than the window scroll, Up, Down and Tab keep the pick in view, and only their box repaints. Scrolled-away or covered rows are marked not showing for screen readers. The scroll resets when the list changes. Also fixed: the box could extend 6 px below the window. Test.

  • P2: a screen reader focusing a menu item scrolls it into view. Test.

  • P3:

    • a new Hit::Popup makes padding, cues and the "more" line take no clicks, left or right, and stops a click there from ending a path edit;
    • a resize or scale change keeps the pick in view;
    • the README lists exactly which targets are 44 px by default.

    Tests for each.

Unit tests: 544 + 493 + 5 + 1. Clippy: 0 warnings. design/build --check passes. e2e: 130 pass, with new screenshots of scrolled suggestions.

The wheel moved the rows under a resting pointer but left the hover on the old index, so the highlight sat on a row the pointer wasn't over until the pointer moved. The hover now follows the rows, repainting only the box.
@michaelaguiar

Copy link
Copy Markdown
Member Author

Review round 2 (by hand, narrow check of 4784791): no P1 or P2. Confirmed:

  • unseen suggestions can't be picked or clicked;
  • the shared Scroller keeps the menus' arithmetic;
  • Hit::Popup never takes a click meant for a visible row;
  • the scroll resets when the list changes;
  • resize scaling can't panic;
  • nothing runs at idle.

Fixed without another round (P3), in 91673aa: the wheel moved the suggestions under a resting pointer but left the hover highlight on the old row. The hover now follows, and only the box repaints. The existing scroll test asserts it. Unit tests and Clippy pass.

The review loop stops here.

@michaelaguiar
michaelaguiar marked this pull request as ready for review December 4, 2026 17:26
@michaelaguiar
michaelaguiar merged commit 63e4688 into main Dec 4, 2026
3 checks passed
@michaelaguiar
michaelaguiar deleted the aliasbot/ali-2665-44px-targets branch December 4, 2026 17:33
@michaelaguiar michaelaguiar mentioned this pull request Dec 4, 2026
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