Skip to content

fix(tui): stabilize repeated open menu - #42086

Merged
kitlangton merged 3 commits into
v2from
stable-open-dialog
Aug 12, 2026
Merged

fix(tui): stabilize repeated open menu#42086
kitlangton merged 3 commits into
v2from
stable-open-dialog

Conversation

@kitlangton

@kitlangton kitlangton commented Aug 12, 2026

Copy link
Copy Markdown
Contributor

What

Keep the populated Control-O session/project picker stable when it opens, reopens, or receives the shortcut repeatedly.

Before / After

Before: Opening reset the shared dialog to medium width, mounted a partial picker from local state, then resized it and inserted projects and cross-project recents as two asynchronous requests completed. This produced a visible flash while loading. Pressing Control-O while open also remounted the picker and restarted those requests.

After: Project and recent-session data load before the picker is mounted. Its first visible frame is already populated and large. Repeated Control-O presses leave the active picker mounted, preserving its content, filter, and selection.

How

  • packages/tui/src/app.tsx loads projects and recent sessions before installing the picker, coalesces concurrent opens, and ignores open.menu while the picker is active.
  • packages/tui/src/ui/dialog.tsx lets replacements declare their initial size and identity in one batched update.
  • packages/tui/src/component/dialog-open.tsx receives loaded sessions and no longer fetches or resizes after mounting.
  • packages/tui/test/cli/tui/dialog-open.test.tsx verifies no picker frame appears while recents are pending, then verifies the first picker frame contains both sessions and projects.

Scope

This only changes loading, repeated invocation, and initial sizing for the Control-O picker. Other dialogs keep their existing replacement behavior.

Testing

  • bun typecheck in packages/tui
  • bun run test test/cli/tui/dialog-open.test.tsx (6 passing, 13 assertions)
  • Push hook workspace typecheck (32 packages successful)
  • Live V2 TUI against the elected service: captured populated first open, Escape, populated reopen, and repeated Control-O presses while open

Demo

Real live-service data, not an isolated fixture. The picker appears fully populated on both opens, and repeated Control-O presses do not remount it.

stable-open-live-2.mp4

@kitlangton
kitlangton merged commit 17cae23 into v2 Aug 12, 2026
8 checks passed
@kitlangton
kitlangton deleted the stable-open-dialog branch August 12, 2026 17:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant