Skip to content

feat(tray): add optional always-on-top setting - #527

Merged
Finesssee merged 1 commit into
mainfrom
codex/issue-509-always-on-top-20260917
Sep 18, 2026
Merged

Finesssee merged 1 commit into
mainfrom
codex/issue-509-always-on-top-20260917

Conversation

@Finesssee

@Finesssee Finesssee commented Sep 17, 2026 •

Copy link
Copy Markdown
Collaborator

Problem

The tray panel/flyout closes or falls behind other windows after it loses focus. There was no user-controlled setting for keeping it above other windows.

Fix

Add an opt-in, persisted Always on top setting in Display settings. It defaults to false, applies only to the tray flyout on creation, reopen, focus changes, and live settings updates, and leaves normal z-order behavior unchanged when disabled. Existing floatbar behavior is untouched.

Validation

  • Shared Rust tests: 1,844 passed
  • Tauri Rust tests: 434 passed
  • Frontend tests: 360 passed
  • Both clippy commands with -D warnings
  • cargo fmt --all -- --check
  • Locale key check: 860 keys matched
  • Frontend build and fresh Tauri debug build passed
  • Native CUA visual proof was unavailable because this runtime exposed no native apps; the fresh binary was launched by exact path and then stopped.

Fixes #509

Summary by CodeRabbit

  • New Features

    • Added a setting to keep the tray panel above other windows, even when it loses focus.
    • Added the setting to Display preferences with explanatory helper text.
    • The preference is saved and restored across app launches.
    • Added localized labels and descriptions for supported languages.
  • Tests

    • Added coverage for enabling, persisting, restoring, and applying the tray panel’s always-on-top preference.

@coderabbitai

coderabbitai Bot commented Sep 17, 2026 •

Copy link
Copy Markdown

Review Change StackReview Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Advanced

Run ID: 7d612e59-93cf-446b-ad4e-6bd6c100c434

📥 Commits

Reviewing files that changed from the base of the PR and between f259abe and 33517f8.

📒 Files selected for processing (29)
  • apps/desktop-tauri/src-tauri/src/commands/bridge.rs
  • apps/desktop-tauri/src-tauri/src/commands/settings.rs
  • apps/desktop-tauri/src-tauri/src/commands/tests.rs
  • apps/desktop-tauri/src-tauri/src/shell/flyout_window.rs
  • apps/desktop-tauri/src-tauri/src/surface.rs
  • apps/desktop-tauri/src/App.test.tsx
  • apps/desktop-tauri/src/floatbar/FloatBar.test.tsx
  • apps/desktop-tauri/src/i18n/keys.ts
  • apps/desktop-tauri/src/surfaces/PopOutPanel.test.tsx
  • apps/desktop-tauri/src/surfaces/TrayPanel.test.tsx
  • apps/desktop-tauri/src/surfaces/settings/tabs/AboutTab.test.tsx
  • apps/desktop-tauri/src/surfaces/settings/tabs/AdvancedTab.test.tsx
  • apps/desktop-tauri/src/surfaces/settings/tabs/DisplayTab.test.tsx
  • apps/desktop-tauri/src/surfaces/settings/tabs/DisplayTab.tsx
  • apps/desktop-tauri/src/surfaces/settings/tabs/GeneralTab.test.tsx
  • apps/desktop-tauri/src/types/bridge.test.ts
  • apps/desktop-tauri/src/types/bridge.ts
  • 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
  • rust/src/settings.rs
  • rust/src/settings/raw.rs
  • rust/src/settings/tests.rs

Included review availability: Your plan provides up to 4 included reviews per hour; 1 remains after this review.


📝 Walkthrough

Walkthrough

The change adds a persisted tray panel always-on-top setting. The display settings UI can update it, localized labels describe it, and the flyout applies it when opened, updated, or unfocused.

Changes

Tray panel always-on-top

Layer / File(s) Summary
Settings persistence and bridge contracts
rust/src/settings*, apps/desktop-tauri/src-tauri/src/commands/{bridge,settings,tests}.rs, apps/desktop-tauri/src/types/bridge.ts
The setting defaults to false, persists through serialization, and is exposed in settings snapshots and updates.
Display setting and localization
apps/desktop-tauri/src/surfaces/settings/tabs/DisplayTab.tsx, apps/desktop-tauri/src/i18n/keys.ts, rust/src/locale*, apps/desktop-tauri/src/**/*test.tsx
Display settings provide a localized toggle. Frontend fixtures and locale resources include the new setting and messages.
Flyout window behavior
apps/desktop-tauri/src-tauri/src/shell/flyout_window.rs, apps/desktop-tauri/src-tauri/src/surface.rs
The flyout applies the configured native always-on-top state. When enabled, it remains visible after losing focus and reasserts its z-order. Surface mode no longer supplies an unconditional always-on-top value.

Priority: ⬇️ Low

Estimated code review effort: 3 (Moderate) | ~25 minutes

Change: Feature

Sequence Diagram(s)

sequenceDiagram
  participant DisplayTab
  participant SettingsCommand
  participant FlyoutWindow
  participant TrayPanel
  DisplayTab->>SettingsCommand: Submit trayPanelAlwaysOnTop
  SettingsCommand->>FlyoutWindow: Apply updated setting
  FlyoutWindow->>TrayPanel: Set native always-on-top state
  TrayPanel-->>FlyoutWindow: Focus loss event
  FlyoutWindow->>TrayPanel: Keep visible when enabled
Loading

Suggested reviewers: darknight105, 0reki

Merge Risk: 🔵 Low · up to 33517

In a narrow timing window, enabling Always on top can leave the tray flyout hidden until it is reopened; the setting and later opens remain correct.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 56.67% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 30 functions across 21 files. (8 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: adding an optional always-on-top setting for the tray panel.
Linked Issues check ✅ Passed The pull request meets the coding requirements in [#509]. DisplayTab.tsx adds the Always on top control. Rust and TypeScript settings models persist and expose the value. flyout_window.rs applies …
Out of Scope Changes check ✅ Passed The changes stay within [#509]. The Rust and frontend model updates, locale entries, flyout integration, and tests directly support the tray panel setting and its persisted behavior. The summary shows…
Full details: Docstring Coverage

Explanation

Docstring coverage is 56.67% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 30 functions across 21 files. (8 skipped: 8 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

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

Thermo-nuclear code-quality review

Scope: PR #527, head 33517f88b45214d5e738207b849e094cf904403f, against current main f259abe8123665f85e74977ea0f285e8bafefa27.

Receipt: No high-confidence finding. The setting is represented once in the persisted Rust model and typed bridge, applied at the dedicated flyout window boundary, and covered by focused tests. The change does not introduce a giant-file regression, duplicate ownership, scattered special-case control flow, or an unnecessary abstraction layer.

@Finesssee
Finesssee merged commit 0ea5911 into main Sep 18, 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.

[Feature]: Always on top

1 participant