Skip to content

Make the new tray panel the default layout - #712

Merged
Finesssee merged 1 commit into
mainfrom
fix/default-tray-panel-ui
Sep 30, 2026
Merged

Finesssee merged 1 commit into
mainfrom
fix/default-tray-panel-ui

Conversation

@Finesssee

@Finesssee Finesssee commented Sep 30, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

The new tray panel (the flyout window that renders TrayPanel) is now the only dashboard layout. The old full-window "PopOut" layout (PopOutPanel with its own "CodexBar" title bar, labelled provider tabs and a Settings/About/Quit footer) could no longer be reached from normal use except through four leftover entry points. This PR reroutes those entry points to the tray panel and retires the old components.

Screenshot 3 from the report is not the old layout. It shows the new tray panel: Zoom/Refresh/Settings.../About/Quit footer and icon-only provider switcher. It was a proof build with one seeded Codex card. Its "Included API" label comes from the Mistral detail-line work (rust/src/providers/mistral/mod.rs:397), not from the product.

Why the old layout was still reachable

When the flyout was added (c39232a, 2026-07-04), the PopOut mode from #108 (cd42ece) was kept. Comments described the two layouts as coexisting, and these callers still targeted PopOut (line numbers are from main at b585d48):

  • apps/desktop-tauri/src-tauri/src/main.rs:49-55: primary_window_request() returned SurfaceMode::PopOut / Dashboard. It was used for a normal visible launch (main.rs:308, via shell::reopen_to_target) and for a second launch through single-instance (main.rs:153).
  • apps/desktop-tauri/src-tauri/src/tray_bridge.rs:153-172: the tray menu item "Show Window" (show_panel, added in tray_menu.rs:126-129) mapped to PopOut Dashboard. The provider: route also mapped to PopOut, but nothing sent it.
  • apps/desktop-tauri/src/App.tsx:107-108: the frontend global-shortcut-triggered listener called setSurfaceMode("popOut"). The native global-shortcut handler already toggles the flyout for every shortcut, so a keyboard shortcut could open both the tray panel and the old window.
  • apps/desktop-tauri/src/hooks/useTrayPanelController.ts:286: an openPopOut header action. It was never rendered, so it was dead code.

No setting selects the layout, so there are no settings to migrate. The only setting that belonged to the old window is windowScalePercent (the Display-tab "window scale" slider). Its UI is removed. The field stays in settings.json and the bridge so existing files still load.

Changes

  • Launch, relaunch, "Show Window" and the global shortcut all open the tray panel (shell::flyout_window::open_or_focus). The "Show Window" tray item is removed; "Pop Out Dashboard" already opened the tray panel.
  • set_surface_mode("popOut", ...) is rejected with "the popOut surface is retired; use open_flyout_window". CODEXBAR_PROOF_MODE=popOut now opens the flyout, and popOut:<provider> payloads are rejected.
  • The flyout gets keep_open_on_blur() so CODEXBAR_START_VISIBLE / proof launches do not close on blur.
  • Removed PopOutPanel, PopOutTitleBar (and their tests), the MenuSurface popout variant/title-bar props, about 300 lines of popout CSS, the Display-tab window-scale slider, and the now-unused resolve_menu_target, reopen_to_target and is_supported_provider_id.
  • Removed 8 unused locale keys from rust/src/locale.rs, apps/desktop-tauri/src/i18n/keys.ts and all 8 .ftl files: TooltipBackToTray, TooltipSettings, WindowMaximize, TooltipPopOut, WindowScaleLabel, WindowScaleHelper, WindowScaleAriaLabel, TrayShowWindow.
  • Kept the SurfaceMode::PopOut enum value and bridge "popOut" type as data keys (geometry and serialized state), so nothing downstream breaks.
  • Tests that pin the default:
    • App.test.tsx: a stale popOut mode still renders the tray panel; the shortcut event opens nothing extra.
    • TrayPanel.test.tsx: the default layout has .menu-surface--tray, no popout chrome, and a Zoom/Refresh/Settings.../About/Quit footer.
    • DisplayTab.test.tsx: no window-scale slider.
    • tray_menu.rs: only the tray-panel window entry.
    • tray_bridge.rs: legacy show_panel and provider: ids route nowhere.
    • commands/tests.rs: popOut is rejected.
    • proof_harness.rs: popOut:<provider> proof targets are rejected.
  • AGENTS.md: the Surfaces line now says TrayPanel is the only dashboard layout.

Validation

  • cargo +1.98.0 fmt --all --check: pass
  • cargo +1.98.0 clippy --manifest-path rust/Cargo.toml --all-targets -- -D warnings: pass
  • cargo +1.98.0 clippy --manifest-path apps/desktop-tauri/src-tauri/Cargo.toml --all-targets -- -D warnings: pass
  • cargo +1.98.0 test --manifest-path apps/desktop-tauri/src-tauri/Cargo.toml: 459 of 460 pass on the workstation.
    • The one failure is bootstrap_payload_exposes_every_provider_variant, which reads the machine's real settings.json (79 vs 78 because a deprecated provider is enabled there).
    • With an isolated empty profile (CODEXBAR_PROOF_HOME), that test passes. This PR does not touch it.
  • cargo +1.98.0 test --manifest-path rust/Cargo.toml --lib locale: 16 pass
  • node apps/desktop-tauri/scripts/check-locale-drift.mjs: OK, 871 keys
  • pnpm --dir apps/desktop-tauri test: 65 files, 393 tests pass
  • pnpm --dir apps/desktop-tauri lint: exit 0 (11 warnings, all pre-existing and in untouched files; main has 15)
  • pnpm --dir apps/desktop-tauri build: pass

UI proof

At the maintainer's direction, the proof used browser-use over the WebView2 CDP port (not CUA).

  • Build: a fresh pnpm run tauri:build:debug of this commit, running with an isolated profile and synthetic data only. The Codex seed was 0% session and 7% weekly, and no real accounts were used.
  • Screenshots were taken with Page.captureScreenshot and saved in C:\Users\FSOS\AppData\Local\Win-CodexBar\port-audit\proof\ui-default\shots\:
    • 01-traypanel-all.png: trayPanel proof mode, All tab (Codex and Claude show "not signed in" errors because the profile is empty).
    • 02-traypanel-codex.png: trayPanel mode, Codex tab.
    • 03-popout-mode-opens-flyout-codex.png: CODEXBAR_PROOF_MODE=popOut now opens the index.html?window=flyout tray panel. The hidden main webview renders no surface, and the DOM has 0 [class*=popout] nodes.
    • 04-flyout-codex-tab.png: the flyout's single-provider Codex tab with seeded usage bars, usage dashboard and status links.
  • All four match the target layout (screenshot 2): icon switcher, provider card, Zoom slider and Refresh / Settings... / About CodexBar / Quit footer. None shows the old "CodexBar" title bar or labelled tabs.
  • Not covered by CDP, because they are native: the tray right-click menu (the "Show Window" item is gone; covered by the tray_menu.rs unit test), a second launch through single-instance, and the native global-shortcut path. All three go through shell::flyout_window::open_or_focus.

Affected areas

  • Tauri shell: main.rs, tray_menu.rs, tray_bridge.rs, commands/surface.rs, proof_harness.rs, surface_target.rs, shell/flyout_window.rs, shell/transition.rs, shell/mod.rs
  • Frontend: App.tsx, MenuSurface.tsx, TrayPanel.tsx, useTrayPanelController.ts, useSettings.ts, DisplayTab.tsx, styles.css, menu-surface-layout.css; PopOutPanel and PopOutTitleBar are removed
  • Locales: rust/src/locale.rs, 8 .ftl files, i18n/keys.ts
  • Docs: AGENTS.md

Summary by CodeRabbit

  • What’s Changed
    • The tray-panel flyout is now the only dashboard window. Opening the app, using the tray’s dashboard option, or activating the global shortcut opens or focuses the flyout.
    • Removed the separate pop-out dashboard, its window controls, and the “Show Window” tray menu item.
    • Removed the window-scale slider from display settings; other display settings remain.

@coderabbitai

coderabbitai Bot commented Sep 30, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

Navigate logical layers of code changes, visualize relationships, and explore their blast radius.

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Advanced

Run ID: ba6caabf-7d81-4848-8aa6-057f3586ca46

📥 Commits

Reviewing files that changed from the base of the PR and between b585d48 and 5b73340.

📒 Files selected for processing (36)
  • AGENTS.md
  • apps/desktop-tauri/src-tauri/src/commands/surface.rs
  • apps/desktop-tauri/src-tauri/src/commands/tests.rs
  • apps/desktop-tauri/src-tauri/src/main.rs
  • apps/desktop-tauri/src-tauri/src/proof_harness.rs
  • apps/desktop-tauri/src-tauri/src/shell/flyout_window.rs
  • apps/desktop-tauri/src-tauri/src/shell/mod.rs
  • apps/desktop-tauri/src-tauri/src/shell/transition.rs
  • apps/desktop-tauri/src-tauri/src/surface_target.rs
  • apps/desktop-tauri/src-tauri/src/tray_bridge.rs
  • apps/desktop-tauri/src-tauri/src/tray_menu.rs
  • apps/desktop-tauri/src/App.test.tsx
  • apps/desktop-tauri/src/App.tsx
  • apps/desktop-tauri/src/components/MenuSurface.tsx
  • apps/desktop-tauri/src/components/PopOutTitleBar.test.tsx
  • apps/desktop-tauri/src/components/PopOutTitleBar.tsx
  • apps/desktop-tauri/src/hooks/useSettings.ts
  • apps/desktop-tauri/src/hooks/useTrayPanelController.ts
  • apps/desktop-tauri/src/i18n/keys.ts
  • apps/desktop-tauri/src/styles.css
  • apps/desktop-tauri/src/surfaces/PopOutPanel.test.tsx
  • apps/desktop-tauri/src/surfaces/PopOutPanel.tsx
  • apps/desktop-tauri/src/surfaces/TrayPanel.test.tsx
  • apps/desktop-tauri/src/surfaces/TrayPanel.tsx
  • apps/desktop-tauri/src/surfaces/menu-surface-layout.css
  • apps/desktop-tauri/src/surfaces/settings/tabs/DisplayTab.test.tsx
  • apps/desktop-tauri/src/surfaces/settings/tabs/DisplayTab.tsx
  • rust/src/locale.rs
  • rust/src/locale/en-US.ftl
  • rust/src/locale/es-MX.ftl
  • rust/src/locale/ja-JP.ftl
  • rust/src/locale/ko-KR.ftl
  • rust/src/locale/ru-RU.ftl
  • rust/src/locale/tr-TR.ftl
  • rust/src/locale/zh-CN.ftl
  • rust/src/locale/zh-TW.ftl
💤 Files with no reviewable changes (16)
  • apps/desktop-tauri/src/components/PopOutTitleBar.test.tsx
  • rust/src/locale/tr-TR.ftl
  • apps/desktop-tauri/src/surfaces/PopOutPanel.test.tsx
  • apps/desktop-tauri/src/surfaces/PopOutPanel.tsx
  • rust/src/locale/zh-CN.ftl
  • rust/src/locale.rs
  • apps/desktop-tauri/src/surfaces/TrayPanel.tsx
  • apps/desktop-tauri/src/components/PopOutTitleBar.tsx
  • rust/src/locale/en-US.ftl
  • rust/src/locale/ja-JP.ftl
  • rust/src/locale/ko-KR.ftl
  • rust/src/locale/zh-TW.ftl
  • rust/src/locale/es-MX.ftl
  • apps/desktop-tauri/src/i18n/keys.ts
  • apps/desktop-tauri/src-tauri/src/shell/transition.rs
  • rust/src/locale/ru-RU.ftl

Included review availability: This review used your included allowance. Your plan provides up to 4 included reviews per hour; 2 remain after this review.


📝 Walkthrough

Walkthrough

The tray-panel flyout is now the only dashboard layout. Native startup, relaunch, proof-mode, and tray paths open or focus the flyout. The frontend removes the separate PopOut dashboard, its controls and styling, and the window-scale setting.

Changes

Dashboard routing and surface cleanup

Layer / File(s) Summary
Retired PopOut mode and proof handling
AGENTS.md, apps/desktop-tauri/src-tauri/src/commands/*, apps/desktop-tauri/src-tauri/src/proof_harness.rs, apps/desktop-tauri/src-tauri/src/shell/*, apps/desktop-tauri/src-tauri/src/surface_target.rs
Surface validation rejects PopOut mode. Proof-mode PopOut requests open the tray-panel flyout, and PopOut target payloads are rejected. The forced-reapply transition API and provider-ID support helper are removed.
Native launch and tray routing
apps/desktop-tauri/src-tauri/src/main.rs, apps/desktop-tauri/src-tauri/src/shell/flyout_window.rs, apps/desktop-tauri/src-tauri/src/tray_bridge.rs, apps/desktop-tauri/src-tauri/src/tray_menu.rs
Startup and single-instance relaunch open or focus the flyout. Tray routing retains the dashboard-opening action and removes the “Show Window” and provider transition actions. A process-wide flag can prevent blur dismissal.
Frontend dashboard and display cleanup
apps/desktop-tauri/src/App*, apps/desktop-tauri/src/components/*, apps/desktop-tauri/src/hooks/*, apps/desktop-tauri/src/i18n/keys.ts, apps/desktop-tauri/src/styles.css, apps/desktop-tauri/src/surfaces/*, rust/src/locale*
The frontend removes PopOut rendering, title-bar controls, related menu actions, and PopOut-specific styling. TrayPanel remains the dashboard surface. The display settings menu no longer includes window scaling, and related locale keys and strings are removed.

Priority: ➖ Normal

Estimated code review effort: 4 (Complex) | ~45 minutes

Change: Bug fix

Sequence Diagram(s)

sequenceDiagram
  participant Startup as open_primary_window
  participant Flyout as open_flyout_window
  participant Window as TrayPanel flyout
  Startup->>Flyout: open or focus after startup delay
  Flyout->>Window: show or focus
Loading

Suggested reviewers: darknight105

Merge Risk: ⚪ Minimal · up to 5b733

The dashboard consolidates on the existing tray-panel flyout. No actionable merge-blocking issue is established; native ad-hoc shortcut behavior has not been independently confirmed.

Security Architecture Review

Security architecture risk: 🔵 Low · up to 5b733

Dashboard access consolidates on an existing local window, while retired requests are explicitly rejected. No new privileged access was identified in the inspected paths, but concurrent startup and legacy shortcut behavior remain incompletely verified.

Retained concerns
No architecture-level concerns identified.

Security review details

Security Blast Radius

  • inferred — The inspected routing change affects dashboard visibility within the local desktop process. Startup arguments and process environment select activation behavior; the changed activation functions delegate to window management without adding credential operations. This does not establish complete coverage of downstream flyout command authority.

Trust Boundaries and Controls

  • observed — Caller-supplied surface requests pass mode parsing and target validation before transition handling. Proof configuration is parsed from the process environment and rejects unsupported payloads before activation. The inspected changes narrow retired target reachability rather than bypassing these controls.

Resilience and Maintainability Implications

  • observed — Native close requests hide rather than destroy the flyout, and hiding clears pending reveal state. These existing cleanup mechanisms are inherited by the new default dashboard path; show, focus, and hide remain separate operations rather than a demonstrated atomic transition.
🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 60.87% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 46 functions across 17 files. (3 skipped:… Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely describes the main change: making the tray panel the default layout while retiring the PopOut dashboard layout.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Full details: Docstring Coverage

Explanation

Docstring coverage is 60.87% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 46 functions across 17 files. (3 skipped: 3 unsupported.)

  • Fix all pre-merge checks with AI
✨ Finishing Touches 💡 1
📝 Generate docstrings 💡
  • Commit to this branch
  • Create a new PR
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR
  • Autopilot · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Autopilot is currently an internal CodeRabbit preview.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@Finesssee

Copy link
Copy Markdown
Collaborator Author

Adversarial validation (Claude Opus 5.5) passed at 5b73340

The worker's explanation holds. The old layout in image 1 is the legacy PopOut dashboard (PopOutPanel + PopOutTitleBar) on the hidden main window. On origin/main it was reachable from the second-launch (single-instance) callback, the visible-start path, the "Show panel" tray item and provider menu transitions, the popOut proof mode, and the global-shortcut-triggered listener in App.tsx. At this head, each of those paths opens the TrayPanel flyout, is removed, or is rejected. Image 3 is already the new TrayPanel (same footer); its "Included API" label came from a synthetic proof seed, not from the old layout.

Checks (fresh worktree at the PR head, isolated profile, no real settings read):

  • cargo fmt --all --check: OK
  • cargo clippy --all-targets -- -D warnings on apps/desktop-tauri/src-tauri and rust: OK
  • cargo test on the Tauri manifest: 460 passed, 0 failed
  • cargo test --manifest-path rust/Cargo.toml --lib locale: 16 passed
  • check-locale (via pnpm build): 871 keys match. The removed keys have 0 remaining uses.
  • pnpm test: 65 files, 393 tests passed
  • pnpm lint: exit 0 (warnings only in untouched files)
  • pnpm run tauri:build:debug: OK

Runtime proof (fresh debug build of this head, browser-use over WebView2 CDP, dummy data only):

  • Plain launch (no proof mode): the flyout shows .menu-surface--tray with 0 popout elements. The main root renders nothing.
  • CODEXBAR_PROOF_MODE=popOut: opens the flyout TrayPanel only. main stays hidden and empty.
  • set_surface_mode('popOut', dashboard | provider:codex) from the webview: both rejected with "the popOut surface is retired; use open_flyout_window". No window appeared.
  • Codex tab in the flyout: renders the TrayPanel provider detail.

Screenshots (local):

  • C:\Users\FSOS\AppData\Local\Win-CodexBar\port-audit\proof\ui-default-val\shots\01-plain-launch-flyout-all.png
  • C:\Users\FSOS\AppData\Local\Win-CodexBar\port-audit\proof\ui-default-val\shots\02-popout-mode-opens-flyout.png
  • C:\Users\FSOS\AppData\Local\Win-CodexBar\port-audit\proof\ui-default-val\shots\03-flyout-codex-tab.png

Notes (not blocking):

  • The seeded Codex snapshot is replaced by the startup refresh. This is existing seed behavior.
  • docs/ARCHITECTURE.md and docs/WINDOWS_PROOF.md still say "pop-out" in a few places.
  • Not covered: native tray icon pixels, and pressing Ctrl+Shift+U (no keyboard input was sent to the user's desktop).

@Finesssee
Finesssee merged commit 7695471 into main Sep 30, 2026
4 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