Skip to content

feat(desktop): Liquid Glass tab bar in the main window top bar - #12867

Merged
Git-on-my-level merged 7 commits into
BasedHardware:mainfrom
nathanchengx:feat/native-top-tab-bar
Sep 11, 2026
Merged

Git-on-my-level merged 7 commits into
BasedHardware:mainfrom
nathanchengx:feat/native-top-tab-bar

Conversation

@nathanchengx

@nathanchengx nathanchengx commented Sep 6, 2026 •

Copy link
Copy Markdown
Contributor
lg.mov

Summary

The main window's top bar used a hand-built row of pills for Chat · Memories · Tasks · Apps. This replaces it with the platform's tab control.

  • macOS 26: a Liquid Glass segmented control with the iOS interaction — equal-width segments sitting on the bar's own glass, and a clear glass lens under the selected tab that lifts and follows the pointer while pressed, then snaps to the segment under the release. Each segment keeps its SF Symbol beside the word.
  • macOS 14–15: the system segmented Picker with a neutral tint (titles only; the native control cannot show icon + title).
  • The press is owned by an AppKit overlay that refuses mouseDownCanMoveWindow, so dragging the selection never drags the shell (the bar is a simultaneous WindowDragGesture handle).
  • No accent fill on the selection: neutral glass, the selected word goes to full ink.
  • New-item counts join the segment title (Tasks +7) since native segments cannot carry badges.
  • top-navigation-<index> accessibility identifiers are preserved, so the e2e flows are unchanged.

Product invariants affected

  • INV-NAV-1 — every destination the bar reached before is still reached by the same bar (ShellDestination.unreachable() and TopNavigationBarLayoutTests still hold); only the control that renders the row changed, not what it routes to. This preserves the existing shell-parity authority; it is not a migration exception.

Failure-Class: none

Verification

  • xcrun swift build -c release --package-path Desktop --triple arm64-apple-macosx (the Release Compile lane's command) — builds clean locally on Xcode 26 / Swift 6.3; with -warn-long-expression-type-checking=120 no expression in the file is flagged. Xcode 16.4 is not installed here, so the #if compiler(>=6.2) fallback path is proven by CI's Release Compile lane, not locally.
  • xcrun swift test --package-path Desktop --filter 'TopNavigationBarLayoutTests|MemoryGraphRevisitTests|ChatFirstDestinationParityTests' — 39 tests, 0 failures (after all review fixes; includes the hosted drag test on this macOS 26 machine).
  • Full xcrun swift test --package-path Desktop after rebasing onto origin/main — scripts/swift-test-suites.sh (the isolated per-suite harness CI runs, 4 workers): 819 suites, exit 0, no failing or timed-out suite.
  • Named bundle omi-native-tab-bar via ./run.sh --yolo --fast-only: pressing each segment through the accessibility API (AXPress on top-navigation-0/1/4/8) routed to chat, memories, tasks, more.apps per omi-ctl state; window captures show the lens moving between segments with icon + word in full ink and no track pill.
  • Hosted drag test: real row inside the real shellWindowDragHandle() in an NSWindow; the hit view under a tab refuses window movement, and a press → six drag steps → release across two segments selects the released tab with the window origin unchanged.
  • swift-format lint, SwiftLint, check_brand_ui.py, and check_desktop_test_quality.py clean.
  • Changelog fragment: desktop/macos/changelog/unreleased/20260906-native-top-tab-bar.json.

Review follow-ups

  • Release type-check timeout / glassEffect missing (all three required desktop checks): two commits. First TopNavigationGlassSegments.body was split into named sub-views and helpers as suggested (fad7b14). That turned the timeout into the real error on CI's pinned Xcode 16.4: its macOS 15.5 SDK has no glassEffect, so the solver had been searching for a member that does not exist — @available(macOS 26.0, *) gates the call at run time but cannot supply the symbol. The glass renderer, the branch in TopNavigationDestinationRow.body, and the hosted drag test are now behind #if compiler(>=6.2) (the Xcode 26 toolchain) (a3b2ddc). Built with an older Xcode the row is the system segmented control on every macOS; built with Xcode 26 nothing changes. No other macOS 26 API is used in the package, so this is the first such guard.
  • Cubic re-review, second pass (1 finding): the layout test's width floor (count × 44) could not detect a dropped segment, since three real segments are wider than four minimum ones. It now counts what was rendered: on the glass path the row must be exactly count × widest segment (the segment content is its own view, TopNavigationGlassSegmentLabel, so the test can measure one) plus the track inset; on the fallback the hosted NSSegmentedControl must report count segments. Mutation-checked: dropping a segment from the renderer fails the test.
  • Cubic re-review, first pass (2 findings): (1) VoiceOver heard only the tooltip, never the +7 a sighted user reads — both renderers now label segments with TopNavigationSegmentSelection.accessibilityLabel(for:badges:) (tooltip sentence, then , N new), covered in the badge-title test. (2) The hosted drag test's window-origin assertion could never fail (events go straight to the hit view), so it is gone; the test is renamed around the guard that proves the mechanism, the hit view's refusal of mouseDownCanMoveWindow.
  • Contradicting doc comments (cubic P3 and the human review): the TopNavigationDestinationRow header now says the lens is a plain .background glass layer under the segment words, not inside a GlassEffectContainer, matching the implementation comment on track.

Notes

  • The Liquid Glass renderer exists only in builds made with Xcode 26 (#if compiler(>=6.2)); a macOS 26 user running a build made with Xcode 16.4 gets the system segmented control instead. CI compiles with 16.4 for its lanes, so this is worth knowing for whichever Xcode produces the shipped app.
  • A real pointer drag was exercised only through the hosted-window test and synthetic NSEvents; the interaction feel (lift scale, snap timing) is tunable in TopNavigationGlassSegmentMetrics.
  • GlassPillBackground in GlassShellChrome.swift no longer has a caller after this change; left in place to keep the diff surgical for in-flight work.

🤖 Generated with Claude Code

https://claude.ai/code/session_01AMfvVp6aSE5JJ1iQxxShbg

https://claude.ai/code/session_01EY6zo5rYU8EzVge6nertYW

@nathanchengx
nathanchengx marked this pull request as ready for review September 6, 2026 14:31

@cubic-dev-ai cubic-dev-ai Bot left a comment •

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All reported issues were addressed across 4 files

Reply with feedback, questions, or to request a fix.

Re-trigger cubic

@Git-on-my-level Git-on-my-level left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @nathanjcx — this is careful, well-tested work. The pure TopNavigationSegmentSelection seam (Brain pages light Memories, Settings/Permissions select nothing, re-press never restarts the page), the guarded TopNavigationGlassSegmentGeometry math, and the hosted-window drag test that proves a tab drag never moves the shell are exactly the coverage a change to primary navigation deserves. File by file:

  • TopNavigationDestinations.swift — blocking issue: all three required desktop checks fail with the same error, the compiler is unable to type-check this expression in reasonable time, at TopNavigationDestinations.swift:377:23 — the body of the new TopNavigationGlassSegments. It reproduces in the Release Compile lane, the feature-sentinel build, and the hosted swift-test lane (that hosted full-suite result is also the one the description says would be recorded in this thread, which hasn't landed yet). A green local debug run on a fast machine is consistent with how these timeouts behave, but the hosted lanes are the gate. The fix is mechanical: split the body into smaller sub-expressions — e.g. extract the lens (Capsule().fill(.clear).glassEffect(...) plus its frame/scaleEffect/position) into its own @ViewBuilder computed view, and pull the trailing .padding/.background/.overlay chain into helpers, the way the fallback already splits out segmentedFallback.
  • DesktopTopBar.swift — doc-only updates (pills → segments, row-height note); accurate against what the code now renders.
  • TopNavigationBarLayoutTests.swift — good adaptation: the HIG-minimum per-segment floor keeps the ViewThatFits trap covered, and the four new pure-logic tests (selection ownership, press semantics, badge-count titles, lens clamping/release) plus the hosted drag test are the right shape.
  • changelog/unreleased/20260906-native-top-tab-bar.json — accurate for both renderers; matches the diff.

One small fix to fold in: the header doc on TopNavigationDestinationRow still says the lens is drawn "with glassEffect inside one GlassEffectContainer", while the implementation comment in TopNavigationGlassSegments.body explains why no container is used. Aligning the header with the plain background-layer approach keeps the two comments from contradicting each other.

Also appreciated: keeping TopNavigationPillMetrics for the referral pill (still used by ReferralProgramView.swift) rather than dragging it into this diff, and calling out GlassPillBackground as now-unreferenced in the notes.

Blocking: only the release-lane type-check timeout. Once the body is broken up and the three desktop checks are green, this still deserves a maintainer's eye on the visual/product direction of the main window's primary navigation (native Liquid Glass replacing the custom pills) — that's a design call, not a correctness one.


by AI on behalf of David — if you need David’s attention urgently, please @Git-on-my-level and escalate with need human response.

@Git-on-my-level Git-on-my-level added macOS needs-maintainer-review Needs a human maintainer to sign off before merge labels Sep 6, 2026
Nathan and others added 2 commits September 6, 2026 16:40
Replace the hand-built pill row in `DesktopTopBar` with the platform's
tab control. On macOS 26 it is a Liquid Glass segmented control with the
iOS interaction: equal-width segments on the bar's own glass and a clear
glass lens under the selected tab that lifts and follows the pointer
while pressed, then snaps to the segment under the release. Below 26 it
is the system segmented `Picker` with a neutral tint.

- The press is owned by an AppKit overlay that refuses
  `mouseDownCanMoveWindow`, so dragging the selection never moves the
  shell (the bar is a simultaneous `WindowDragGesture` handle).
- No accent fill on the selection (INV-UI-1 neutral accents); the
  selected word simply goes to full ink. Icons stay beside each word on
  the glass renderer; the fallback control can only show titles.
- New-item counts join the segment title ("Tasks +7") since native
  segments cannot carry badges.
- Selection and press rules live in `TopNavigationSegmentSelection`;
  drag geometry in `TopNavigationGlassSegmentGeometry`. Both are pure
  and unit-tested. `top-navigation-<index>` identifiers are preserved
  for the e2e flows.

Verification:
- `xcrun swift test --filter 'TopNavigationBarLayoutTests|MemoryGraphRevisitTests|ChatFirstDestinationParityTests'`: 39 tests, 0 failures
- Named bundle `omi-native-tab-bar` (`./run.sh --yolo --fast-only`):
  pressing each segment through the accessibility API routed to chat,
  memories, tasks, and apps (`omi-ctl state` visibleChatFirstRoute);
  window captures show the glass lens moving between segments with the
  icon + word in full ink and no track pill.
- Hosted drag test: real row inside the real `shellWindowDragHandle` in
  an `NSWindow`; the hit view under a tab refuses window movement and a
  press-drag-release selects the released tab with the window origin
  unchanged.
- swift-format lint, SwiftLint, brand ratchet, and
  `check_desktop_test_quality.py` clean.

Co-Authored-By: Claude Fable 5.1 <[email protected]>
Claude-Session: https://claude.ai/code/session_01AMfvVp6aSE5JJ1iQxxShbg
…n type-check it

CI's Release Compile lane (Xcode 16.4) failed on `TopNavigationGlassSegments.body`
with "the compiler is unable to type-check this expression in reasonable
time". The body was one expression: the equal-width segments, the lens in a
`.background` closure, the AppKit pointer overlay with three inline closures,
and the two animation modifiers.

Break it into named pieces — `track`, `segments`, `lens` (with its width, scale
and y as properties), `pointerCaptured(_:)`, `animated(_:)`, and the
`trackWidthChanged` / `pointerReleased` handlers — the way the fallback already
splits out `segmentedFallback`. Behaviour is unchanged.

Also align the `TopNavigationDestinationRow` header with the implementation:
the lens is a plain background glass layer under the segment words, not inside
a `GlassEffectContainer` (which composited its glass above the labels and
washed the selected word out).

Verification:
- `xcrun swift build -c release --package-path Desktop --triple arm64-apple-macosx`: clean
- `-warn-long-expression-type-checking=120`: no expression in
  TopNavigationDestinations.swift is flagged
- `xcrun swift test --filter 'TopNavigationBarLayoutTests|MemoryGraphRevisitTests|ChatFirstDestinationParityTests'`: 39 tests, 0 failures
- swift-format lint, SwiftLint, check_brand_ui.py, check_desktop_test_quality.py clean

Failure-Class: none

Co-Authored-By: Claude Fable 5.1 <[email protected]>
Claude-Session: https://claude.ai/code/session_01EY6zo5rYU8EzVge6nertYW
@nathanchengx
nathanchengx force-pushed the feat/native-top-tab-bar branch from 848b147 to fad7b14 Compare September 6, 2026 21:01
@nathanchengx

Copy link
Copy Markdown
Contributor Author

@Git-on-my-level thanks — addressed in fad7b14 (branch also rebased onto current main):

  • Release type-check timeout — TopNavigationGlassSegments.body is now a chain of named pieces: track / segments / lens (with lensWidth, lensScale, lensCenterY as properties), pointerCaptured(_:), animated(_:), and the trackWidthChanged / pointerReleased handlers, the way segmentedFallback was already split out. Behaviour is unchanged. Locally the Release Compile lane's exact command (xcrun swift build -c release --package-path Desktop --triple arm64-apple-macosx) builds clean, and with -warn-long-expression-type-checking=120 no expression in TopNavigationDestinations.swift is flagged (Swift 6.3 here; CI's Xcode 16.4 is the authority).
  • Contradicting doc comments — the TopNavigationDestinationRow header now describes the lens as a plain .background glass layer under the segment words, matching the implementation comment.
  • Targeted suites (TopNavigationBarLayoutTests|MemoryGraphRevisitTests|ChatFirstDestinationParityTests): 39 tests, 0 failures. The full swift test run on the rebased branch is in progress; I'll post the result here when it finishes.

CI's Release Compile lane, on the pinned Xcode 16.4 (macOS 15.5 SDK), fails
with "value of type '_ShapeView<Capsule, Color>' has no member 'glassEffect'".
The `@available(macOS 26.0, *)` guard only gates the call at run time; the
symbol still has to exist in the SDK the package is compiled against, and the
earlier "unable to type-check in reasonable time" was the solver searching for
that missing member. No other macOS 26 API is used in the package, so nothing
had established the pattern.

Gate the glass renderer (`TopNavigationGlassSegments`,
`TopNavigationPointerCapture`) and the branch in
`TopNavigationDestinationRow.body` on `#if compiler(>=6.2)`, the Xcode 26
toolchain whose SDK declares `glassEffect`. Built with an older Xcode the row
is the system segmented control on every macOS; built with Xcode 26 it is
unchanged. The pure geometry, selection and metrics types stay unconditional
so their tests run everywhere; the hosted drag test is gated the same way.

Failure-Class: none

Co-Authored-By: Claude Fable 5.1 <[email protected]>
Claude-Session: https://claude.ai/code/session_01EY6zo5rYU8EzVge6nertYW
@nathanchengx

Copy link
Copy Markdown
Contributor Author

Follow-up on the Release Compile lane: after the body split (fad7b14) CI surfaced the actual error underneath the timeout —

TopNavigationDestinations.swift:416:10: error: value of type '_ShapeView<Capsule, Color>' has no member 'glassEffect'

CI's pinned Xcode 16.4 ships the macOS 15.5 SDK, which has no glassEffect; @available(macOS 26.0, *) gates the call at run time but cannot supply a symbol the SDK lacks, so the solver had been hunting for a member that does not exist. No other macOS 26 API is used in the package, so nothing had established the pattern yet.

a3b2ddc puts the glass renderer (TopNavigationGlassSegments, TopNavigationPointerCapture), the branch in TopNavigationDestinationRow.body, and the hosted drag test behind #if compiler(>=6.2) (the Xcode 26 toolchain). Built with an older Xcode the row is the system segmented control on every macOS; built with Xcode 26 nothing changes. The pure geometry / selection / metrics types stay unconditional so their tests run on both. Most of the line delta is swift-format's required reindent of the conditional block.

Xcode 16.4 is not installed here, so the fallback compile path is proven by the CI lanes rather than locally. Targeted suites still 39/39; the isolated full-suite run is going now and I'll post its result here.

@nathanchengx

Copy link
Copy Markdown
Contributor Author

Full suite on the rebased branch (a3b2ddc), via the isolated per-suite harness CI uses (scripts/swift-test-suites.sh, 4 workers, 300s per-suite budget): 819 suites, exit 0, no failing or timed-out suite (local Xcode 26 / Swift 6.3; the three batches that went red were re-run per suite and all passed). For the record, a plain single-process swift test on this machine crashes with SIGTRAP in SubscriptionEntitlementServiceTests when its auth-change notification reaches a ChatProvider sink left over from an earlier suite in the same process — the process-global state the harness isolates against, and unrelated to this PR.

@nathanchengx

Copy link
Copy Markdown
Contributor Author

@cubic-dev-ai review

@cubic-dev-ai

cubic-dev-ai Bot commented Sep 6, 2026

Copy link
Copy Markdown

@cubic-dev-ai review

@nathanjcx I have started the AI code review. It will take a few minutes to complete.

@cubic-dev-ai cubic-dev-ai Bot left a comment •

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All reported issues were addressed across 4 files

Reply with feedback, questions, or to request a fix.

Re-trigger cubic

…tological drag assertion

Two review findings on the glass tab bar:

- The segments' accessibility label was the tooltip alone, so VoiceOver never
  heard the `+7` a sighted user reads in `Tasks +7`. Both renderers now use
  `TopNavigationSegmentSelection.accessibilityLabel(for:badges:)`: the tooltip
  sentence, then `, N new` when the count is non-zero. Covered by the existing
  badge-title test.
- The hosted drag test asserted the window origin was unchanged, but it sends
  the mouse sequence straight to the hit view (an off-screen window drops
  `sendEvent`), so nothing in that harness could ever move the window and the
  assertion could not fail. The guard that proves the mechanism is the hit
  view's refusal of `mouseDownCanMoveWindow`, which is what AppKit's background
  move consults; the test is renamed and documented around that, and the
  dead assertion is gone.

Verification:
- `xcrun swift test --filter 'TopNavigationBarLayoutTests|MemoryGraphRevisitTests|ChatFirstDestinationParityTests'`: 39 tests, 0 failures
- swift-format lint, SwiftLint, check_desktop_test_quality.py clean

Failure-Class: none

Co-Authored-By: Claude Fable 5.1 <[email protected]>
Claude-Session: https://claude.ai/code/session_01EY6zo5rYU8EzVge6nertYW
@nathanchengx

Copy link
Copy Markdown
Contributor Author

@cubic-dev-ai review

@cubic-dev-ai

cubic-dev-ai Bot commented Sep 7, 2026

Copy link
Copy Markdown

@cubic-dev-ai review

@nathanjcx I have started the AI code review. It will take a few minutes to complete.

@cubic-dev-ai cubic-dev-ai Bot left a comment •

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All reported issues were addressed across 4 files

Reply with feedback, questions, or to request a fix.

Re-trigger cubic

The narrowest-window layout test guarded "every destination is still drawn"
with a floor of `count × minimum segment width`. Three real segments are wider
than four minimum ones, so a renderer that dropped a segment still cleared it;
the floor could not do the one job it was there for.

Count what was rendered instead. Against the macOS 26 SDK on macOS 26 the row
is `EqualWidthSegments`, whose width is exactly `count × widest segment` plus
the track inset; the segment content is now its own view
(`TopNavigationGlassSegmentLabel`) so the test can measure one on its own and
assert the row is that many of them wide. Everywhere else the row is the
system segmented control, which reports its segment count.

Mutation check: with one segment dropped from the renderer the test fails
(row one segment short); restored, it passes.

Verification:
- `xcrun swift test --filter 'TopNavigationBarLayoutTests|MemoryGraphRevisitTests|ChatFirstDestinationParityTests'`: 39 tests, 0 failures
- swift-format lint, SwiftLint, check_desktop_test_quality.py clean

Co-Authored-By: Claude Fable 5.1 <[email protected]>
Claude-Session: https://claude.ai/code/session_01EY6zo5rYU8EzVge6nertYW
@nathanchengx

Copy link
Copy Markdown
Contributor Author

@cubic-dev-ai review

@cubic-dev-ai

cubic-dev-ai Bot commented Sep 7, 2026

Copy link
Copy Markdown

@cubic-dev-ai review

@nathanjcx I have started the AI code review. It will take a few minutes to complete.

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No issues found across 4 files

Confidence score: 5/5

  • Automated review surfaced no issues in the provided summaries.
  • No files require special attention.

Re-trigger cubic

@Git-on-my-level

Copy link
Copy Markdown
Member

Thanks @nathanjcx — the blocking concern from my earlier review is resolved on this head, and verified rather than taken on faith:

  • TopNavigationDestinations.swift — the release type-check timeout is gone for the right reason: TopNavigationGlassSegments.body is now a chain of named pieces (track / segments / lens with lensWidth/lensScale/lensCenterY, pointerCaptured, animated, and the trackWidthChanged/pointerReleased handlers), and the deeper cause underneath it — CI's pinned Xcode 16.4 SDK having no glassEffect symbol — is handled by the #if compiler(>=6.2) gate, so an older SDK builds the system segmented control everywhere instead of failing to solve for a missing member. The header-doc contradiction about GlassEffectContainer is also fixed; the header now matches the implementation comment.
  • TopNavigationBarLayoutTests.swift — the rework from a width floor to counting what was rendered is a real improvement, not churn: three real segments are wider than four minimum ones, so the floor could not fail when a segment went missing. assertEveryDestinationIsRendered now proves the row is exactly count × widest segment wide on the glass renderer (measuring the extracted TopNavigationGlassSegmentLabel) and checks segmentCount on the system control, so ViewThatFits can't pass for the wrong reason on either renderer.
  • DesktopTopBar.swift — doc-only, and accurate against what the bar now renders.
  • changelog/unreleased/20260906-native-top-tab-bar.json — accurate for both renderers.

All three desktop lanes are green on this head. One coverage note, not a blocker: the glass-only tests (including the hosted drag test) compile and run only under an Xcode 26 toolchain, which the pinned CI lanes don't provide — CI exercises the fallback renderer and the unconditional geometry/selection logic, and your posted local full-suite run (819 suites, exit 0) covers the 26 side, so both renderers have a green suite behind them.

What's left is the same item the earlier review flagged, and it's why the maintainer label stays: whether the main window's primary navigation should present as native Liquid Glass rather than the custom pills is a product/visual direction call, not a correctness one. Leaving that decision for human maintainer sign-off before merge.


by AI on behalf of David — if you need David’s attention urgently, please @Git-on-my-level and escalate with need human response.

@Git-on-my-level
Git-on-my-level dismissed their stale review September 7, 2026 18:29

The blocking concern from this review — the release-lane type-check timeout in TopNavigationGlassSegments.body — is resolved on the current head (d7fe148): the body is split into named sub-views, and the underlying cause (the pinned Xcode 16.4 SDK lacking the glassEffect symbol) is handled by the #if compiler(>=6.2) gate with the system segmented control as the fallback renderer. All desktop lanes are green. The remaining question — native Liquid Glass vs custom pills for primary navigation — is a product direction decision left for human maintainer review.

@Git-on-my-level

Copy link
Copy Markdown
Member

QA feedback on the bundle build (all 9 stacked PRs): everything passed except this tab bar — page transitions feel more laggy than main, and Tasks multi-select feels really laggy. Diagnosis from reading the diff; merge is held until this lands and re-passes QA.

Root cause (two coupled issues):

  1. Counts are embedded in segment titles, and titles size the row. TopNavigationSegmentSelection.title(for:badges:) appends +N, and EqualWidthSegments.sizeThatFits re-measures every segment with an unbounded proposal — the row's intrinsic width is count × widest. Any badge-count change (task completed during multi-select, new conversation during a transition) re-measures and re-lays-out the entire bar with a width animation. This upgrades the earlier review note ("bar re-widens/jitters whenever a badge count changes") from cosmetic to user-perceived lag.
  2. The glass row re-diffs on every store tick. DesktopTopBar observes appState, memoriesViewModel, and tasksStore, and computes badges with three full-array filters on every body eval. During a page transition the destination's onAppear data loads fire several objectWillChanges mid-transition; each re-diffs the glass segments. Multi-select stacks both: every tap re-renders the list and completing tasks fires a TasksStore tick plus a count change → full glass-bar re-layout per tap.

Requested fix:

  1. Decouple segment width from badge counts: measure segments from static titles (or a fixed width budget); render counts in a fixed-width monospacedDigit trailing slot that does not contribute to EqualWidthSegments measurement; keep counts in the accessibility label and tooltip. No badge-count change may trigger a bar re-layout.
  2. Isolate the glass row from store churn: extract badge computation into a small child view that owns the three observations and passes the Equatable TopNavigationDestinationBadges value down, so the glass row body only re-runs when badges/selection actually change. (Optionally precompute the counts in the stores instead of filtering arrays per body eval.)
  3. Re-verify in your tests/verification pass: tab-switch lens animation must not contend with destination onAppear loads; rapid multi-select taps and complete-from-multi-select (the "Tasks +N" count-change case) must stay smooth.

Note: the EqualWidthSegments narrowest-window layout tests will need updating once measurement ignores counts — please keep an equivalent guarantee that all destinations fit at the narrowest window with counts at their widest.

…reserved slot

The reserved hidden `99+` slot shifted every title left of its cell center
while the lens stayed cell-centered, so the pills read unbalanced against
the selection. The count now overlays the segment's trailing corner in the
row's own badge style and takes no part in layout: titles center, the lens
stays under the words, and no count can re-measure the row.
@Git-on-my-level

Copy link
Copy Markdown
Member

Verified both fixes from the bundle-QA feedback on this head, and traced the two red desktop lanes to a cause outside this PR.

Perf fixes — both present, both tested

  • TopNavigationDestinations.swift — segment measurement is now independent of badge counts: TopNavigationGlassSegmentLabel measures from glyph + word alone, and the count renders as a .topTrailing overlay (countBadge, allowsHitTesting(false), 99+ cap) that layout never sees, so EqualWidthSegments.sizeThatFits can no longer change the row's intrinsic width when a count ticks. testSegmentMeasurementIsIndependentOfBadgeCounts pins both the per-segment width and the whole row width at zero vs widest counts (±0.5 pt).
  • DesktopTopBar.swift — the three store observations moved off the bar (now plain lets) into the new TopNavigationBadgedRow, which computes the badge value and hands TopNavigationDestinationRow(...) to .equatable(); the row's == compares only selectedIndex and badges, so a store tick that moves neither count stops before the glass body re-runs. Exactly the isolation requested.
  • TopNavigationBarLayoutTests.swift — the narrowest-window guarantee survives with counts at their widest: the glass path measures the row against count × widest segment at 99/99 badges, and the fallback path asserts rowWidth(none) ≤ rowWidth(widest), so counts can only shrink the control back into a lane it already fit.

One deliberate deviation from the letter of the request, worth a maintainer eye: on the fallback renderer (macOS < 26, and every build made with the pinned Xcode 16.4 — which is what CI currently produces) the count still joins the system control's title (Tasks +7), so that control's width does move with counts there. It is documented at TopNavigationSegmentSelection.title and bounded by the tests above, and a native control re-measure is far cheaper than the glass track re-layout was — but shipped 16.4 builds take that path, so it belongs in the sign-off.

The two red lanes are one failure, and it is not this PR's

Desktop Swift Build & Tests failed only at its Require static contracts and Swift tests gate step — its 4-second runtime shows it never built — and Desktop Swift Static & Test Contracts failed in TasksSortOrderSyncFailureTests.testLegacyOrderingIsAdoptedOnlyByLaunchOwnerBeforeGlobalKeysArePurged (nil vs ["task-1"] and nil vs 2, lines 238–239). This PR touches none of that suite's files and nothing in TasksViewModel's sort-order persistence; the failure is the async migration-owner lifetime race in that harness, which was diagnosed and fixed on main this morning in b1eae99 ("test: retain task migration owner across async persistence", validated 7/7 in isolation) — about two hours after this PR's CI run started. A rebase onto current main should turn both lanes green; no changes requested for it.

Also verified along the way: changelog/unreleased/20260906-native-top-tab-bar.json is accurate for both renderers; top-navigation-<index> accessibility identifiers are preserved on both paths with VoiceOver hearing the exact count; and TopNavigationSegmentSelection.selectedTag/press keep the hub-page and no-tab-on-Settings semantics with direct unit coverage (testTheNativeTabBarSelectsTheTabThatOwnsTheCurrentPage, testPressingANativeTabNavigatesOnlyWhenItChangesThePage).

Still holding for human maintainer review: whether the main window's primary navigation should present as native Liquid Glass rather than the custom pills is a product/visual direction call, and the bundle build needs a QA re-pass on this head since both perf-fix commits postdate the last bundle. needs-maintainer-review stays on for those two decisions.

by AI on behalf of David.

@Git-on-my-level
Git-on-my-level merged commit 90bffb2 into BasedHardware:main Sep 11, 2026
30 of 34 checks passed
kodjima33 added a commit that referenced this pull request Sep 12, 2026
kodjima33 added a commit that referenced this pull request Sep 12, 2026
#12867)" (#13548)

Reverts #12867 (`90bffb2e81`).

## Why

The PR replaced the glyph-and-word pills in the top bar with a native
segmented control. Its Liquid Glass renderer is gated behind `#if
compiler(>=6.2)`, and CI compiles with Xcode 16.4, so every shipped
build gets the icon-less fallback `Picker`: a plain gray `Chat |
Memories | Tasks | Apps` segmented control. The PR was merged with
`REVIEW_REQUIRED` and no approving human review. Nik asked for the
revert.

Restores `TopNavigationDestinationRow` / `TopNavigationPill` /
`GlassPillBackground` and the previous `TopNavigationBarLayoutTests`.
Adds a changelog fragment.

## Product invariants affected

- INV-NAV-1 — same bar, same destinations, same `top-navigation-<index>`
identifiers; only the control rendering the row goes back to what
shipped before #12867.

Failure-Class: none

## Verification

- `git revert` applied cleanly on `origin/main` (the changelog fragment
from #12867 was already consolidated into v0.12.339 so it needed no
removal).
- Named bundle `omi-revert-12867` built and launched via `./run.sh
--yolo`; top bar shows the glyph+word pills again (screenshot in PR
comment).

🤖 Generated with [Claude Code](https://claude.com/claude-code)

https://claude.ai/code/session_01GwzT9jwAJzNP275KAfQjpP


<!-- This is an auto-generated description by cubic. -->
<a
href="https://cubic.dev/pr/BasedHardware/omi/pull/13548?utm_source=github"
target="_blank" rel="noopener noreferrer"
data-no-image-dialog="true"><picture><source
media="(prefers-color-scheme: dark)"
srcset="https://www.cubic.dev/buttons/review-in-cubic-dark.svg"><source
media="(prefers-color-scheme: light)"
srcset="https://www.cubic.dev/buttons/review-in-cubic-light.svg"><img
alt="Review in cubic"
src="https://www.cubic.dev/buttons/review-in-cubic-dark.svg"></picture></a>
<!-- End of auto-generated description by cubic. -->
Git-on-my-level added a commit that referenced this pull request Sep 12, 2026
PR #12867 looked right on a local Xcode 26 named bundle and shipped the
icon-less system Picker fallback: Liquid Glass sat behind
#if compiler(>=6.2) while desktop CI (GHA desktop-swift-ci.yml and Codemagic
omi-desktop-swift-release/-preview) compiled with Xcode 16.4, so the ship
toolchain never typechecked the glass APIs (#13548 reverted the tab bar).
Bump the desktop ship/CI toolchain off 16.4 and make drift impossible:

- desktop/macos/ci/xcode-pin.json is now the only place the version (26.6),
  build (17F113), and expected app path (/Applications/Xcode_26.6.app) live.
  26.6/17F113 exists on both vendors: GHA macos-26 image 20260907.0351.1
  (default Xcode, /Applications/Xcode_26.6.app) and Codemagic mac_mini_m4
  image 'Xcode 26.6.x (default)' (/Applications/Xcode-26.6.app).
- run-swift-ci.sh reads the pin file (fails closed when it is missing) and
  keeps asserting the exact version+build after selection.
- desktop-swift-ci.yml macOS jobs move macos-15 -> macos-26, cache key
  prefixes move xcode164 -> xcode266 so 16.4 caches cannot poison 26.x
  builds, and the select steps name the pinned version.
- codemagic.yaml omi-desktop-swift-release/-preview move xcode: 16.4 ->
  26.6 (Android 16.4 and iOS 26.0.1 untouched); the reviewed
  codemagic_workflow_contract digests are refreshed for that edit.
- test_desktop_swift_ci_contract.py loads the pin file instead of literals
  and adds codemagic pin-agreement + macos-26 runner assertions.

Verified locally: bash desktop/macos/tests/test-run-swift-ci.sh (pin
26.6/17F113 sandbox incl. wrong-version/wrong-build/missing-pin sabotage);
python3 .github/scripts/test_desktop_swift_ci_contract.py (38 tests OK);
python3 .github/scripts/check-release-process-guards.py (exit 0);
xcrun swift build -c debug --package-path Desktop on Xcode 26.6 (17F113)
completes (1855s).
Git-on-my-level added a commit that referenced this pull request Sep 12, 2026
New desktop-compiler-gates manifest check: desktop/macos/scripts/
check-desktop-compiler-gates.py fails when Desktop/Sources or Desktop/Tests
contain #if compiler(...) / #elseif compiler(...) — the shape that let
#12867 compile Liquid Glass out of the Xcode 16.4 ship toolchain while CI
stayed green (#13548 reverted the tab bar). Runtime availability gating
(if #available(macOS 26, *) with a working fallback) is the sanctioned
pattern and passes. The allowlist ships empty and is asserted by exact
contents in test_check_desktop_compiler_gates.py, so it cannot silently
grow; entries require a documented reason and a matching path+line.

checks-manifest.yaml also extends desktop-swift-ci-contract triggers with
the pin file, runner script, launcher test, and codemagic.yaml so every
pin consumer re-runs the contract test on drift.

Verified locally: python3 .github/scripts/test_check_desktop_compiler_gates.py
(9 tests OK — planted #if compiler(>=6.2) glassEffect sabotage fails the
checker and removing it passes); python3 desktop/macos/scripts/
check-desktop-compiler-gates.py on the real tree reports none found;
make preflight manifest lane: all selected checks pass except the
pre-existing loaded-host flake in test_pr_preflight.py
SingleFlightTests.test_identical_processes_join_and_execute_once, which
fails 3/3 on pristine origin/main at the same host load (passes in
isolation) and is unrelated to this diff.
Git-on-my-level added a commit that referenced this pull request Sep 13, 2026
…13564)

* ci(desktop): pin ship/CI Xcode to 26.6 (17F113) from one source of truth

PR #12867 looked right on a local Xcode 26 named bundle and shipped the
icon-less system Picker fallback: Liquid Glass sat behind
#if compiler(>=6.2) while desktop CI (GHA desktop-swift-ci.yml and Codemagic
omi-desktop-swift-release/-preview) compiled with Xcode 16.4, so the ship
toolchain never typechecked the glass APIs (#13548 reverted the tab bar).
Bump the desktop ship/CI toolchain off 16.4 and make drift impossible:

- desktop/macos/ci/xcode-pin.json is now the only place the version (26.6),
  build (17F113), and expected app path (/Applications/Xcode_26.6.app) live.
  26.6/17F113 exists on both vendors: GHA macos-26 image 20260907.0351.1
  (default Xcode, /Applications/Xcode_26.6.app) and Codemagic mac_mini_m4
  image 'Xcode 26.6.x (default)' (/Applications/Xcode-26.6.app).
- run-swift-ci.sh reads the pin file (fails closed when it is missing) and
  keeps asserting the exact version+build after selection.
- desktop-swift-ci.yml macOS jobs move macos-15 -> macos-26, cache key
  prefixes move xcode164 -> xcode266 so 16.4 caches cannot poison 26.x
  builds, and the select steps name the pinned version.
- codemagic.yaml omi-desktop-swift-release/-preview move xcode: 16.4 ->
  26.6 (Android 16.4 and iOS 26.0.1 untouched); the reviewed
  codemagic_workflow_contract digests are refreshed for that edit.
- test_desktop_swift_ci_contract.py loads the pin file instead of literals
  and adds codemagic pin-agreement + macos-26 runner assertions.

Verified locally: bash desktop/macos/tests/test-run-swift-ci.sh (pin
26.6/17F113 sandbox incl. wrong-version/wrong-build/missing-pin sabotage);
python3 .github/scripts/test_desktop_swift_ci_contract.py (38 tests OK);
python3 .github/scripts/check-release-process-guards.py (exit 0);
xcrun swift build -c debug --package-path Desktop on Xcode 26.6 (17F113)
completes (1855s).

* ci(desktop): fail closed on compiler-gated Apple SDK APIs

New desktop-compiler-gates manifest check: desktop/macos/scripts/
check-desktop-compiler-gates.py fails when Desktop/Sources or Desktop/Tests
contain #if compiler(...) / #elseif compiler(...) — the shape that let
#12867 compile Liquid Glass out of the Xcode 16.4 ship toolchain while CI
stayed green (#13548 reverted the tab bar). Runtime availability gating
(if #available(macOS 26, *) with a working fallback) is the sanctioned
pattern and passes. The allowlist ships empty and is asserted by exact
contents in test_check_desktop_compiler_gates.py, so it cannot silently
grow; entries require a documented reason and a matching path+line.

checks-manifest.yaml also extends desktop-swift-ci-contract triggers with
the pin file, runner script, launcher test, and codemagic.yaml so every
pin consumer re-runs the contract test on drift.

Verified locally: python3 .github/scripts/test_check_desktop_compiler_gates.py
(9 tests OK — planted #if compiler(>=6.2) glassEffect sabotage fails the
checker and removing it passes); python3 desktop/macos/scripts/
check-desktop-compiler-gates.py on the real tree reports none found;
make preflight manifest lane: all selected checks pass except the
pre-existing loaded-host flake in test_pr_preflight.py
SingleFlightTests.test_identical_processes_join_and_execute_once, which
fails 3/3 on pristine origin/main at the same host load (passes in
isolation) and is unrelated to this diff.

* changelog(desktop): mark ci xcode pin as internal-only (kind: none)

The desktop changelog check requires an in-repo fragment for production
desktop paths even with the no-changelog-needed label: the label is
invisible after merge and would redden main's Release Eligibility run.
This PR is CI/infra only (toolchain pin + fail-closed gate), so the
marker is kind: none.

* ci(desktop): raise verify ceiling to 90m for the first cold macos-26 full lane

Measured on run 34687313733 (PR #13564): with the pin moved to Xcode 26.6,
every cache cold under the new xcode266 keys, the full Swift suite ran
past 55 minutes and the 60-minute job ceiling cancelled the job mid
serial-cluster. Every completed suite was green (one wedged batch cost
1650s before its 1500s watchdog bisected it cleanly; zero test failures)
— purely a timing ceiling, so:

- desktop-swift-verify timeout-minutes 60 -> 90
- full-lane OMI_SWIFT_TEST_STEP_BUDGET_SECONDS 2700 -> 4200

Both changes cite the run; contract test constants updated to match.

* test(ci): close compiler-gate checker holes from review

Match compiler() anywhere in #if/#elseif, ignore block-commented
directives, and fail closed when the scan root has no Swift files.

* test(app): accept ActionItemsFetcher due-window params

#13570 added dueStartDate/dueEndDate to ActionItemsFetcher on main.
GitHub analyzes the merge of this PR, so the existing test stubs must
accept those named args or Dart Analyze fails.

* style(app): dart format test stubs at line-length 120

CI Check Dart formatting uses --line-length 120 after pub get.

* chore: restore dart test stubs from origin/main after merge format noise

* test(app): match ActionItemsFetcher due-window params
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

macOS needs-maintainer-review Needs a human maintainer to sign off before merge

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants