Skip to content

fix(hig): draw the switcher's highlighted row with its accent fill - #3251

Merged
datlechin merged 3 commits into
mainfrom
fix/database-switcher-selected-state
Oct 3, 2026
Merged

datlechin merged 3 commits into
mainfrom
fix/database-switcher-selected-state

Conversation

@datlechin

@datlechin datlechin commented Oct 3, 2026 •

Copy link
Copy Markdown
Member

Why

The highlighted row in Switch Database showed white text on a light grey fill, close to unreadable. It happened on every open, and in Switch Connection after a search that matched nothing.

In a popover AppKit draws a row's selection with a material view and configures it only when the row's stored isEmphasized changes. The row answered emphasis from its getter, so the stored value never changed and the fill kept the look it got before the row had a window, while the cells turned white.

Change

  • The highlighted row in the database, schema and connection switchers draws the accent fill with white content while its window is key, and the grey fill with standard colors when it is not.
  • The row stores its emphasis through the setter and follows the window's key notifications, so fill and content change together.

Verified

Five tests in FieldDrivenListEmphasisTests fail on main. The two selection-material tests are skipped on the macOS 26 runner, which builds no selection material for a row outside a window; the stored-emphasis test covers that order there. Checked on a Debug build on macOS 27 in both switchers, the floating panel and on app deactivation. No UI test: the fill is not an accessibility attribute.

Screenshots

Light Dark
Before Before, light Before, dark
After After, light After, dark

Not in this PR

  • Switch Database pressed over Open Quickly, after a chooser closed by itself, closes Open Quickly and opens nothing: the presenter keeps a stale subject.
  • The fill was measured on macOS 27 only; whether UI: Incorrect selected state style #3249 shows on macOS 26 is unknown. A popover that opens with its rows already inside relies on the table's own emphasis write.

Fixes #3249

In a popover and in a source list AppKit draws a row's selection with a material view and configures it only when the row's stored emphasis changes. A chooser row answered emphasis from its getter, so the stored value never changed and the fill stayed grey under cells that had turned white.

The row now stores the chooser rule through the setter, re-derives when it joins a window and on the window key notifications, and copies the style into its cells in the same call.

Fixes #3249
… early

The macOS 26 CI runner gives a row selected outside a window no selection material, so the two material tests could not stage their order there. They now ask the host first and are skipped where it builds none.

Two tests cover what the gate leaves open: the emphasis AppKit stores is asserted on every host, and the stage is checked to build its row so the gate cannot hide a broken setup.
@datlechin
datlechin merged commit b34290b into main Oct 3, 2026
17 checks passed
@datlechin
datlechin deleted the fix/database-switcher-selected-state branch October 3, 2026 14:40
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.

UI: Incorrect selected state style

1 participant