Skip to content

Connected push for dashboard/Customize switches; exact caret-expansion heights - #67

Merged
mstallone merged 6 commits into
mainfrom
enhance-popup-animation
Aug 2, 2026
Merged

mstallone merged 6 commits into
mainfrom
enhance-popup-animation

Conversation

@mstallone

@mstallone mstallone commented Aug 2, 2026 •

Copy link
Copy Markdown
Owner

TL;DR — The dashboard↔Customize switch now plays as one connected full-width push instead of a hard cut, and the panel's height animations (screen switches and caret expansions) land on target the first time instead of overshooting and springing back.

What was happening

  • A screen switch unmounted the outgoing screen instantly and slid the destination in by only 36pt, so the two scenes read as a disconnected swap.
  • Profiling (script/profile_ui.sh) showed every switch also stalled the main thread ~90ms rebuilding the destination tree on the interaction frame (10 stalls / 917ms across the 10-switch phase on main).
  • The push ran on the bouncy shared spring; at full-width travel its overshoot exposed a strip of bare tray at the panel edge and bounced the bottom edge during the resize.
  • Copilot's caret expansion wobbled on every toggle: the height estimate counted saved On Demand widgets that the seat's plan filters out of the render, and the learn step's sanity check kept discarding the "implausible" real height.
  • Text-heavy expansions (the default Usage Trend + Today/Yesterday/30 Days set) overshot by 40–60pt on a provider's first toggle each session — visibly ballooning into the screen clamp on tall dashboards before settling back — because the estimate priced every row at a flat 36pt.
  • The quick-links buttons (Status/Dashboard) flew in from the top of the window when a card above them expanded: the row was the dashboard's only lazy container, and LazyVGrid re-resolves cells against the scroll viewport mid-animation.

What this changes

  • Screen switches are a transition-scoped pager: the outgoing page stays mounted, frozen at its pre-switch size (a constant proposal, so the per-frame height morph never re-lays it out), and slides out edge-to-edge with the entering page on a new critically damped Motion.push.
  • After the push the outgoing page stays parked offscreen, so switching back reuses the mounted tree with zero mount cost. Pages live in a ForEach keyed by screen with an atomically written page list, so role flips preserve structural identity and a mid-flight reversal can't hand out duplicate IDs.
  • Each page carries its own chrome (PopoverTopBar/PopoverFooter now key on the page's screen, not the destination), so bars travel with their screen during the push.
  • The caret-expansion estimate mirrors the card's real render path: applicability-filtered rows, On Demand promotion, per-row-type heights (meter/text/chart) with the neighbor-aware text-row condensing rule, and a real links-row estimate. The learned-delta cache key follows the same composition, so plan changes invalidate stale heights.
  • ProviderLinksView swaps LazyVGrid for eager stacks with the same visual contract (three-across flexible columns, wrapping, partial rows keep column width).

Heads-up

  • A cacheDisplay raster of the outgoing screen was tried first and reverted: rasterizing the hosting view cost 85–330ms of main-thread stall on the switch frame (the profiler numbers are in the DashboardView header comment for posterity).
  • The parked page keeps receiving observation updates while offscreen (e.g. the dashboard's countdown while Customize is open). Sessions are short and the profiler shows no regression, but it's a deliberate trade for mount-free switches.
  • Codex review follow-up: parked pages now leave the keyboard focus loop and shortcut table once the exit slide settles (and the accessibility tree immediately), so offscreen controls — including the parked footer's ⌘R — can't be reached by keyboard or VoiceOver.

Tests

  • Full swift test suite passes.
  • script/profile_ui.sh before/after: screen-switch phase went from 10 stalls / 917ms (main) to 3 stalls / 215ms; the remaining ~98ms stall is the session's first Customize mount, which lands before motion starts. Expand-phase numbers are run-to-run noise on all builds (332ms–4.6s including on main).
  • Verified interactively: push in both directions, height morphs between screens of different heights, rapid mid-flight reversals, Copilot and text-heavy caret toggles, links-row behavior when an above card expands.

…n heights

The screen switch previously hard-cut the outgoing screen and nudged the
destination in by 36pt, which read as disconnected. It now plays as one
critically damped full-width push: the outgoing page stays mounted (frozen
at its pre-switch size so the per-frame height morph never re-lays it out),
slides out beside the entering page, and stays parked offscreen so the next
switch back needs no mount — profiled at 3 stalls/215ms across 10 switches
vs 10/917ms on the previous hard-cut design.

Caret expansions also co-animate to the right height on the first toggle:
the estimate now mirrors the card's real render path (applicability filter,
On Demand promotion, per-row-type heights with the text-row condensing
rule), fixing Copilot's every-toggle wobble and the grow-past-then-shrink
overshoot on text-heavy expansions. The quick-links row swaps its LazyVGrid
for eager stacks so the buttons stop flying in from the viewport origin
when a card above expands.

@chatgpt-codex-connector chatgpt-codex-connector 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.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 7b4a0f6209

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

…ne row estimate

The parked page's .allowsHitTesting(false) only blocked pointer input —
keyboard focus, shortcuts (the parked dashboard footer's Cmd-R), and
VoiceOver could still reach its offscreen controls. It now disables once
the exit slide settles (not mid-flight, so visible controls don't grey
out) and is hidden from accessibility for its whole parked life.

The Usage Trend row estimate summed label + chart heights, but
UsageSparkline lays them side by side in an HStack — the row height is
their max, so the first-toggle estimate overshot chart-bearing
expansions by ~18pt.

@chatgpt-codex-connector chatgpt-codex-connector 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.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: df1fddab84

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

… disable, hover cleanup

Three fixes from the codex-personal review of the pager:

- A switch during a still-running push snapped both pages to the new
  push's edges before animating back. A SlideProgressEffect (the
  PanelHeightModifier idiom) records the rendered slide progress each
  frame, and a reversal now seeds the new push at 1 - rendered so the
  pages continue from exactly where they visibly are.

- The parked page's .disabled keyed off isSliding, which reads false the
  instant the push COMMITS (state hits its target immediately), so the
  outgoing page's controls dimmed mid-flight. It now keys off the push
  completion (settledSlideID).

- Hover popovers/tooltips used to dismiss via the switched-away screen's
  onDisappear; a parked page never disappears, so the screen-change
  handler dismisses them explicitly (a Usage Trend hover detail could
  otherwise float over Customize).
…arget

Follow-up to the reversal fix, from the cloud review's re-pass: parking
mid-reversal froze the new parked page at state-level animatedHeight,
which already holds the interrupted push's destination — a height the
page never visibly reached, snapping its footer. The freeze now reads
the height controller's live visualHeight (fed per frame by the
PanelHeightBridge), identical to animatedHeight whenever the previous
push had settled.

@chatgpt-codex-connector chatgpt-codex-connector 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.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: b7eb213b15

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Addresses the review's two P1s: the caret-expansion height math
(revealed-row selection with applicability filtering and On Demand
promotion, per-anatomy row pricing, the delta cache key) moves out of
the oversized DashboardView into a pure ExpansionHeightEstimator, and
ExpansionHeightEstimatorTests locks the regressions it fixed — counting
saved-but-never-rendered widgets, flat per-row pricing of condensing
text clusters, and summing the sparkline's side-by-side label + bars.
@mstallone
mstallone merged commit 1551671 into main Aug 2, 2026
2 checks passed
@mstallone
mstallone deleted the enhance-popup-animation branch August 2, 2026 19:22
mstallone added a commit that referenced this pull request Oct 6, 2026
**TL;DR**

Second batch from the production cleanup audit: rewrites comments and
one doc page that describe code that no longer exists or no longer works
that way. No code changes.

**What was happening**

- Claude and Codex comments still described the era before read-only
credentials (#84, #90) and guarded renewal (#99): "Runway never
refreshes a Claude token", "so Runway rotates on the same schedule", "a
successful usage fetch (which rotates tokens back to disk)". Two
functions in `CodexAuthStore` carried two doc comments fused together,
the first describing removed behavior.
- `DashboardView` comments said steady state keeps one live screen tree
and that the outgoing page unmounts when the push completes. Since #67
the page stays parked until the popover closes. Others referred to a
"scroll spacer" and an `outgoing` identifier that do not exist.
- `WidgetRowView` described a per-row timeline gate that #60 replaced
with the shared clock, 22 lines below a doc comment saying it is
deliberately not that.
- `MemoryEditorState.saveDirtyDocument` was documented as overwriting a
moved file; it keeps the conflict check.
- Comments named things that are gone or renamed: `EscapeToCloseReader`,
`discover`, `compactValue`, `formatTokens`, `enterpriseUnverified`, a
`Logger` in `LocalUsageServer`, the `MenuBarExtra` label, "Phase 1" of
account discovery, a pinned count on `ProviderRow`.
- `ProviderAuthRetry` was described as shared by every OAuth-style
provider; only Grok calls `fetch`.
- `docs/providers/openrouter.md` said `/credits` is required for a
usable snapshot. The provider renders whatever either endpoint returned
and reports an invalid key only when both return 401 or 403.

**What this changes**

- Rewrites each comment to match the code, after checking the claim
against the current source.
- Moves the keychain-before-file ordering doc in `ClaudeAuthStore` from
the `StoredCandidateLoad` struct to `orderedStoredCandidates`, the
function it describes. This is the only non-comment line movement in the
diff.
- Updates the OpenRouter page.

**Tests**

`swift build --build-tests` passes. The diff changes only comment lines,
apart from the struct move above.
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