Repository navigation
ALI-2665: Dialog buttons, menu rows and path suggestions are 44 px by default - #69
Conversation
…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.
|
Review round 1. The code-review skill ran, and its findings were checked by hand. No P1. Confirmed fine:
Being fixed:
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.
|
Round 1 fixes are in 4784791.
Unit tests: 544 + 493 + 5 + 1. Clippy: 0 warnings. |
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.
|
Review round 2 (by hand, narrow check of 4784791): no P1 or P2. Confirmed:
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. |
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)
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:
mutedonsurface(4.5:1) and aborderhairline, so the cue doesn't rely on colour. It takes no clicks.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.Hit::Popup), so they neither close the menu nor end a path edit.Tokens
button-height(44) andmenu-scroll-cue(20).menu-rowgoes from 28 to 44.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:
Typing a path paints about 0.02 ms slower, because the suggestion box is taller.
Checks
Unit tests pass. New ones check:
Clippy: 0 warnings.
design/build --checkpasses.e2e: the new
dialog_buttons_menus_and_suggestions_are_44_by_defaulttakes 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.Not changed (outside this ticket):
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.