Skip to content

Toolbar: least-used items overflow first; the tools, colour and Copy never do - #303

Merged
danjboyd merged 5 commits into
mainfrom
toolbar-overflow-priorities
Oct 20, 2026
Merged

danjboyd merged 5 commits into
mainfrom
toolbar-overflow-priorities

Conversation

@danjboyd

@danjboyd danjboyd commented Oct 20, 2026 •

Copy link
Copy Markdown
Owner

For 0.3.2, the app part of Dan's toolbar-overflow plan, with option (b) for GNUstep.

Ranking (every platform, NSToolbarItem visibilityPriority)

Minimum window width

  • macOS: the measured minimum keeps Copy too, as well as the tools and colour.
  • GNUstep, theme without priority support: the 640 pt canvas minimum, unchanged. libs-gui moves the row's last items into », so Copy can overflow. Keeping it would have meant keeping the whole row before it: about 1174 px under Adwaita, too wide for half a 1920 px screen.
  • GNUstep, theme with priority support: the minimum keeps the tools, colour and Copy, the flexible spaces (Adwaita's 100 pt title room) and the » button. The theme says it does this with -toolbarHonoursVisibilityPriority, a method on the GSTheme subclass, so it goes away with the theme on a live switch. WinUITheme and Adwaita are adding it on their toolbar-overflow-priority branches.

Tests (ToolbarFitsWindowProbe)

  • testItemsOverflowInOrderOfUse runs on every platform.
  • On GNUstep:
    • testWithoutPriorityTheMinimumIsTheCanvasMinimum fails on 824eac0 (854 pt in CI's layout).
    • testWithPriorityTheMinimumKeepsTheToolsColourAndCopy gives the theme the method at runtime.
  • On macOS: testTheNarrowestWindowStillShowsTheToolsColourAndCopy.
  • The full suite passes: 63 suites under both themes, 3 skipped under default and 2 under Adwaita.
  • Still to do:
    • Windows on alpha10, which has no marker: the minimum should be unchanged (656 px).
    • The theme branches with the marker: Adwaita captures, and Windows narrowest-window checks.
    • macOS: the narrowest window.

For the 0.3.2 release notes: "When the window is too narrow for the whole toolbar, Undo and Redo go into the » menu first and Save and Share last. On macOS the tools, colour and Copy always stay. On Linux and Windows this ordering, and keeping Copy on screen, need the bundled theme to support it: WinUITheme and Adwaita do. With older themes, items go into » from the end of the row as before."

🤖 Generated with Claude Code

https://claude.ai/code/session_01V8rjzo3Qk8M7WcT9RYfYRW

danjboyd and others added 2 commits October 20, 2026 13:20
…never do

Every platform now ranks the toolbar's items for the overflow menu, by
visibility priority:
- Undo and Redo go first (Low), and Zoom and Preferences when customised
  in, as they're in the menus with shortcuts;
- then custom actions (Standard);
- then Save and Share (High). On macOS Share used to go first, into
  #298's empty picker;
- the tools, colour and Copy never go (User).

AppKit honours the priorities. On GNUstep they take effect once the theme
does; libs-gui keeps the row's first items. So on GNUstep the window's
minimum width now reaches past Copy, plus the ">>" button. Under Adwaita's
header bar it counts the room the title keeps. macOS's minimum keeps Copy
as well as the tools and colour.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01V8rjzo3Qk8M7WcT9RYfYRW
…priority

libs-gui moves the row's last items into ">>", so keeping Copy there kept
everything before it: about 1174px under Adwaita, too wide for a window on
half a 1920px screen. GNUstep keeps the 640pt canvas minimum again, and
Copy may overflow.

A theme that sends the lowest priority into ">>" first says so with
-toolbarHonoursVisibilityPriority. WinUITheme and Adwaita are adding it,
on the theme object so that it goes away with the theme. Under such a
theme the minimum keeps the tools, colour and Copy, the flexible spaces
(Adwaita's title room) and the ">>" button.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01V8rjzo3Qk8M7WcT9RYfYRW
… half a screen

With WinUITheme's priority overflow, the window can't be narrowed past the
tools, colour and Copy. That was about 672pt, more than half of a 1920px
screen at 150% (640pt). WinUI's segmented icon items are 40pt: the tools
take 54pt less there, and each is still a 40px touch target. Linux and
macOS keep 46.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01V8rjzo3Qk8M7WcT9RYfYRW
@danjboyd

Copy link
Copy Markdown
Owner Author

macOS check (0d03e74 against main beaa38b): looks good. macOS 26, arm64 build, 1× display, light appearance. I dragged the window's corner by hand to its narrowest, then widened it in 8 pt steps and read the visible toolbar items through accessibility.

  1. Narrowest window: it stops at 828 pt. Tools, colour and Copy all show, nothing runs past the edge, and the rest is in ». On main it stops at 772 pt with Copy already in ».

  2. Order items come back as the window widens:

    Save Share Copy Undo Redo
    Toolbar: least-used items overflow first; the tools, colour and Copy never do #303 884 924 always 980 996
    main 836 996 (last) 892 940 996

    So Share now outlasts Undo and Redo (macOS: Share… in the toolbar's » overflow menu opens an empty picker #298's case), and Copy never overflows.

  3. Tests: ToolbarFitsWindowProbeTests pass, 4 of 4 on macOS (the other 3 are GNUstep-only). The full macOS suite: 231 tests, 1 skipped, 0 failures.

A correction to my #301 note: "below about 800 pt the tool group runs past the window edge" only happened because I resized through accessibility, which bypasses the window's minimum width. Dragged by hand, main stops at 772 pt with the tools showing. So on macOS #303's real gains are Copy staying visible and Share outlasting Undo and Redo.

macOS GO for #303. The merge is Dan's call.

🤖 Generated with Claude Code

… and 150%

Under WinUITheme's priority overflow at 125% and 150%, Copy went into ">>"
at exactly the window's minimum, 2px short of fitting. The theme rounds
the items to whole pixels, so their sum in points came out short. Measured
on Windows.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01V8rjzo3Qk8M7WcT9RYfYRW
@danjboyd

Copy link
Copy Markdown
Owner Author

Windows: GO on c4ef8f4 (preview 0.3.1-pr303b), run on Windows 11 with the installed app. The VM display is 2293×1302. Widths are visible (DWM) px.

Before (0d03e74):

  • With WinUITheme toolbar-40-overflow (5ab3495) the minimum was 674 / 840 / 1008 at 100 / 125 / 150%.
  • At 125% and 150%, Copy was in » exactly at the minimum (2 px short).

After (c4ef8f4):

Theme 100% 125% 150% Row at exactly the minimum
toolbar-40-overflow (-toolbarHonoursVisibilityPriority) 642 800 960 Tools, Colour, Copy. Undo, Redo, Save and Share in ».
alpha10 (no override) 642 800 960 Undo, Redo, Tools, Colour. Copy in » (unchanged from main).
  • The minimum is now the canvas minimum under both themes. Undo and Redo drop first.
  • Half-tile at 150% on 1920×1080: the half is 960 px, so it fits exactly, with 0 px to spare. This VM's driver didn't accept 1920×1080, so the snap itself wasn't exercised at that width.
  • A real Win+Left at 150% on this 2293-wide display snaps to 1147 px.
    • With the override theme the row keeps Tools, Colour, Save, Copy and Share; Undo and Redo go to ».
    • With alpha10, Copy and Share go to ».
  • The window still opens at full toolbar width at every scale (v0.2.0 redesign: WinUI-style look (tracking) #221/macOS toolbar: room to spare, and the test allows a narrow screen (fixes main's macos-app) #242).
  • ToolbarFitsWindowProbe: the VM's local test suite can't run here (a window-server environment issue). CI is the reference.

🤖 Generated with Claude Code

https://claude.ai/code/session_01Px6i2CANZszJmJLzAZHoBQ

danjboyd added a commit that referenced this pull request Oct 20, 2026
Pins the theme to the 0.1.0-alpha11 tag (d0416a3). On top of alpha10's
overwrite prompt and compact titles:
- the toolbar in the menu bar's row is 40pt: 36pt buttons, 20pt icons,
  32pt view items and 8pt gaps (#170);
- a narrow window's toolbar sends its lowest-priority items into » first,
  and says so with -toolbarHonoursVisibilityPriority (#171). With it the
  window's minimum keeps the tools, colour and Copy (#303).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01V8rjzo3Qk8M7WcT9RYfYRW
…een at 150%

At 150% the 640pt canvas minimum was exactly 960px, half of a 1920px
screen, with nothing to spare. At 600pt it's 900px. Under WinUITheme
alpha11 the window's minimum still keeps the tools, colour and Copy
(kept items plus 4pt), measured below the canvas minimum on Windows.
Linux keeps 640pt, and macOS its measured minimum.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01V8rjzo3Qk8M7WcT9RYfYRW
@danjboyd

Copy link
Copy Markdown
Owner Author

Windows: GO on 7fe8121 (preview 0.3.1-pr303c), with a 600 pt canvas minimum on Windows. Tested on Windows 11 with the installed app, on a 2293×1302 display. Widths are visible px.

Theme 100% 125% 150% vs 960 (1080p half) at 150% Row at exactly the minimum
WinUITheme alpha11 (release) 624 777 933 27 px to spare Tools, Colour, Copy; Undo, Redo, Save and Share in »
alpha10 (no override) 602 750 900 60 px to spare Undo, Redo, Tools, Colour; Copy in » (as on main)
  • With alpha11 the kept items set the minimum, just above the 600 pt canvas minimum. Copy is in the row exactly at the minimum at all three scales.
  • The canvas at the minimum is usable.
    • At 100%, sample.png fits at 66.7%. At 150%, a 2580×1560 image fits at 33.4%.
    • Zoom in and out work (25 → 50 → 100 → 150%).
    • The status bar shows in full: size, zoom slider, −, +, label and Fit.
  • Found while testing, and not caused by this PR: zoom out from Fit jumps to a fixed 50%, so with Fit at 33.4% the first − zooms in. Filed as Zoom out from Fit goes up to 50% when Fit is below 50% #307. The narrower minimum just makes it easier to hit.
  • FitToWindowProbe and ToolbarFitsWindowProbe can't run on this VM (the test suite's window-server environment issue); CI is the reference.

🤖 Generated with Claude Code

https://claude.ai/code/session_01Px6i2CANZszJmJLzAZHoBQ

@danjboyd
danjboyd marked this pull request as ready for review October 20, 2026 21:03
@danjboyd
danjboyd merged commit 453206a into main Oct 20, 2026
5 checks passed
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