[Feat] Hybrid tray panel with site actions and service controls - #178
[Feat] Hybrid tray panel with site actions and service controls#178jmsobe wants to merge 3 commits into
Conversation
Left-click opens a frameless Vue tray panel with site filter, favorites/recent, per-site actions, collapsible services and activity, and daemon Stop/Restart. Right-click keeps the native menu. Adds preferred IDE setting, menu-bar health dot, icon-aware panel positioning, and build-time tray icon rasterisation.
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (9)
🚧 Files skipped from review as they are similar to previous changes (8)
📝 WalkthroughWalkthroughThe GUI adds a hybrid tray experience with a dedicated Vue panel, health-aware native tray menus and icons, persisted site and IDE preferences, OS-specific terminal/IDE launching, service controls, autocomplete, alerts, and updated window lifecycle handling. ChangesHybrid tray GUI
Estimated code review effort: 5 (Critical) | ~120 minutes Sequence Diagram(s)sequenceDiagram
participant User
participant NativeTray
participant TrayPanel
participant TauriBridge
participant Daemon
User->>NativeTray: Left-click tray icon
NativeTray->>TrayPanel: Toggle and focus tray-panel window
TrayPanel->>TauriBridge: Request status, sites, preferences, and mail
TauriBridge->>Daemon: Fetch GUI data
Daemon-->>TauriBridge: Return status and content
TauriBridge-->>TrayPanel: Update panel state
User->>TrayPanel: Open site or control service
TrayPanel->>TauriBridge: Invoke terminal, IDE, or service command
Possibly related PRs
Suggested reviewers: 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
There was a problem hiding this comment.
Actionable comments posted: 5
🧹 Nitpick comments (2)
apps/yerd-gui/src-tauri/src/tray_panel.rs (1)
206-207: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low valueAdd a short doc line to public API items.
These Tauri commands are exported as public API items but lack documentation. As per coding guidelines, public API items must have a short doc line.
apps/yerd-gui/src-tauri/src/tray_panel.rs#L206-L207: documenttoggle_tray_panel_cmd.apps/yerd-gui/src-tauri/src/tray_panel.rs#L211-L212: documenthide_tray_panel_cmd.apps/yerd-gui/src-tauri/src/tray_panel.rs#L216-L217: documenttray_fallback_active.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@apps/yerd-gui/src-tauri/src/tray_panel.rs` around lines 206 - 207, Add concise Rust doc comments for the public Tauri APIs toggle_tray_panel_cmd, hide_tray_panel_cmd, and tray_fallback_active in apps/yerd-gui/src-tauri/src/tray_panel.rs at lines 206-207, 211-212, and 216-217 respectively, with each comment briefly describing the item's behavior.Source: Coding guidelines
apps/yerd-gui/src-tauri/src/tray.rs (1)
322-322: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winComment-style guideline violations (em dashes and inline function-body comments). As per coding guidelines: "Do not add inline comments inside function bodies... except for
// SAFETY:justifications and short protocol byte labels" and "Do not use em dashes in comments; use a hyphen, comma, or colon instead."
apps/yerd-gui/src-tauri/src/tray.rs#L322: inline comment insideapplybody and uses an em dash — remove/hoist the comment and replace—.apps/yerd-gui/src-tauri/src/tray.rs#L354-L355: inline comment insidetray_iconbody and uses an em dash — remove/hoist and replace—.apps/yerd-gui/src-tauri/src/tray.rs#L208: inline comment insidebuild_traybody — remove or hoist to the item doc.apps/yerd-gui/src-tauri/src/tray.rs#L178-L179: em dash in the doc comment — replace with a comma/hyphen.apps/yerd-gui/src-tauri/src/tray.rs#L430: em dash in the doc comment — replace with a hyphen.apps/yerd-gui/src-tauri/src/ide.rs#L190-L191: inline comment insideopen_path_in_idebody and uses an em dash — remove and replace—.apps/yerd-gui/src-tauri/src/ide.rs#L206: inline comment insideopen_with_idbody — remove or hoist.apps/yerd-gui/src-tauri/src/ide.rs#L232: inline comment insideopen_with_idbody — remove or hoist.apps/yerd-gui/src-tauri/src/tray_health.rs#L143: em dash in the doc comment — replace with a hyphen.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@apps/yerd-gui/src-tauri/src/tray.rs` at line 322, Remove or hoist inline body comments from build_tray, apply, tray_icon, open_path_in_ide, and open_with_id, preserving only permitted SAFETY or protocol-label comments. Replace all em dashes in apps/yerd-gui/src-tauri/src/tray.rs lines 178-179, 322, 354-355, and 430, apps/yerd-gui/src-tauri/src/ide.rs lines 190-191, and apps/yerd-gui/src-tauri/src/tray_health.rs line 143 with approved punctuation; the comments at tray.rs:208 and ide.rs:206,232 require removal or hoisting only.Source: Coding guidelines
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@apps/yerd-gui/src-tauri/build.rs`:
- Around line 1-6: Remove the crate-level allow attribute and update main plus
render_tray_mac_icon to return Result<(), Box<dyn std::error::Error>>. Refactor
render_tray_mac_icon to propagate environment, file, SVG parsing, pixmap
allocation, and PNG-writing failures with ?, replacing unwrap_or_else/expect
usage while preserving tray icon generation. Have main propagate both
render_tray_mac_icon and tauri_build::build errors without panicking.
In `@apps/yerd-gui/src-tauri/src/commands.rs`:
- Around line 1207-1218: Update the xterm branch in the candidate command-launch
loop to invoke an explicit shell with `-c`, rather than passing the `cd ... &&
exec $SHELL` string directly to xterm. Quote or otherwise safely encode `dir_s`
so paths containing spaces or shell metacharacters work correctly, while
preserving the existing non-xterm argument handling and fallback behavior.
- Around line 1167-1193: Update open_terminal_impl’s macOS AppleScript
construction to escape directory content before interpolating it into the
AppleScript string literal, handling backslashes and double quotes safely.
Preserve the existing quoted form of shell fragment and terminal-opening
behavior while preventing paths from breaking out of the AppleScript string.
In `@apps/yerd-gui/src/lib/traySiteAutocomplete.ts`:
- Line 70: Remove the inline explanatory comments inside
buildTraySiteSuggestions and siteMatches. Move their guidance into the
respective function doc comments if useful, or remove it when the code is
sufficiently clear; make no other behavioral changes.
In `@apps/yerd-gui/src/views/TrayPanelView.vue`:
- Line 5: Replace the em dash in the comment near
apps/yerd-gui/src/views/TrayPanelView.vue line 5 with a hyphen, comma, or colon.
Apply the same comment-only punctuation change near
apps/yerd-gui/src/lib/serviceActions.ts line 12, preserving the existing
meaning.
---
Nitpick comments:
In `@apps/yerd-gui/src-tauri/src/tray_panel.rs`:
- Around line 206-207: Add concise Rust doc comments for the public Tauri APIs
toggle_tray_panel_cmd, hide_tray_panel_cmd, and tray_fallback_active in
apps/yerd-gui/src-tauri/src/tray_panel.rs at lines 206-207, 211-212, and 216-217
respectively, with each comment briefly describing the item's behavior.
In `@apps/yerd-gui/src-tauri/src/tray.rs`:
- Line 322: Remove or hoist inline body comments from build_tray, apply,
tray_icon, open_path_in_ide, and open_with_id, preserving only permitted SAFETY
or protocol-label comments. Replace all em dashes in
apps/yerd-gui/src-tauri/src/tray.rs lines 178-179, 322, 354-355, and 430,
apps/yerd-gui/src-tauri/src/ide.rs lines 190-191, and
apps/yerd-gui/src-tauri/src/tray_health.rs line 143 with approved punctuation;
the comments at tray.rs:208 and ide.rs:206,232 require removal or hoisting only.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: cc953249-84e9-4d88-8287-1a6786168285
⛔ Files ignored due to path filters (4)
Cargo.lockis excluded by!**/*.lockapps/yerd-gui/src-tauri/icons/menu/stethoscope.pngis excluded by!**/*.pngapps/yerd-gui/src-tauri/icons/tray-mac.pngis excluded by!**/*.pngapps/yerd-gui/src-tauri/icons/tray-mac.svgis excluded by!**/*.svg
📒 Files selected for processing (26)
apps/yerd-gui/src-tauri/Cargo.tomlapps/yerd-gui/src-tauri/build.rsapps/yerd-gui/src-tauri/capabilities/default.jsonapps/yerd-gui/src-tauri/src/autostart.rsapps/yerd-gui/src-tauri/src/commands.rsapps/yerd-gui/src-tauri/src/ide.rsapps/yerd-gui/src-tauri/src/main.rsapps/yerd-gui/src-tauri/src/tray.rsapps/yerd-gui/src-tauri/src/tray_health.rsapps/yerd-gui/src-tauri/src/tray_panel.rsapps/yerd-gui/src-tauri/tauri.conf.jsonapps/yerd-gui/src/App.vueapps/yerd-gui/src/ipc/client.tsapps/yerd-gui/src/ipc/types.tsapps/yerd-gui/src/lib/serviceActions.test.tsapps/yerd-gui/src/lib/serviceActions.tsapps/yerd-gui/src/lib/trayHealth.test.tsapps/yerd-gui/src/lib/trayHealth.tsapps/yerd-gui/src/lib/traySiteAutocomplete.test.tsapps/yerd-gui/src/lib/traySiteAutocomplete.tsapps/yerd-gui/src/router.tsapps/yerd-gui/src/views/AboutView.vueapps/yerd-gui/src/views/GeneralView.vueapps/yerd-gui/src/views/ServicesView.vueapps/yerd-gui/src/views/TrayPanelView.vuedocs/developer/gui.md
| /** | ||
| * Frameless tray popup: site autocomplete + per-site actions + service controls. | ||
| * Standalone window (label `tray-panel`); owns its own lightweight poll (4s, | ||
| * paused while hidden — same discipline as `usePoll`). |
There was a problem hiding this comment.
📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win
Em dashes in comments (repeated). Shared root cause: comments use — where the guideline requires a hyphen, comma, or colon.
apps/yerd-gui/src/views/TrayPanelView.vue#L5-L5: replace the em dash in "paused while hidden — same discipline" with a hyphen/comma/colon.apps/yerd-gui/src/lib/serviceActions.ts#L12-L12: replace the em dash in "per-site instance — matches ServicesView" with a hyphen/comma/colon.
As per coding guidelines: "Do not use em dashes in comments; use a hyphen, comma, or colon instead."
📍 Affects 2 files
apps/yerd-gui/src/views/TrayPanelView.vue#L5-L5(this comment)apps/yerd-gui/src/lib/serviceActions.ts#L12-L12
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@apps/yerd-gui/src/views/TrayPanelView.vue` at line 5, Replace the em dash in
the comment near apps/yerd-gui/src/views/TrayPanelView.vue line 5 with a hyphen,
comma, or colon. Apply the same comment-only punctuation change near
apps/yerd-gui/src/lib/serviceActions.ts line 12, preserving the existing
meaning.
Source: Coding guidelines
Tray panel and native Services block now list Postgres, Redis, and other installed managed services alongside running PHP pools.
Fix Linux clippy errors in open_terminal_impl, escape paths for macOS AppleScript and xterm shell launch, refactor build.rs to propagate errors, and apply comment/style cleanups from review.
|
Great feature! I'm going to leave this active for awhile, while I get Windows support plumbed up, and we can reevaluate this on Linux, Mac and Windows then - the key aim is to ensure feature parity between the versions, my concern is that when I tried this approach before, getting it "right" on Linux was a royal pain the backside - so this will need extensive testing across a lot of different distros. I also found this approach on Wayland based setups rendered the "dropdown" as a full tile, instead of a location-ed dropdown, so we'd need to consider this downside as well unless we can solve it (I was not able to before, but did not spend long on it before reverting to the more standard dropdown). |
|
Understood, using it right now on my local build. It's saving me a boatload of time, esp. the favorites item. When I am working on a few applications at once I can easily jump around between projects. Really appreciative of this application BTW. Great work on getting this launched. |
#
What does this PR do?
Adds a hybrid menu-bar experience inspired by local-dev tools, with a quick-access Vue tray panel on left-click, while right-click keeps the full native dropdown menu. The goal is everyday site and service control without opening the main dashboard.
Screenshots
Attach these when opening the PR (files are in
tray-panel-screenshots/):tray-panel-sites.pngtray-panel-activity.pngTray panel (
#/tray-panel, window labeltray-panel)Frameless popup shown under the menu-bar icon (left-aligned with the icon when it fits; shifts left at screen edges).
Header
Sites
traySiteAutocomplete.ts)gui-settings.json(tray_favorites,tray_recent)SiteCard.vue)Services
Activity
Lifecycle
statuspoll (4 s), paused while the panel is hidden (same discipline asusePoll)tray-panel-openedevent refocuses the filter input on each showMenu-bar icon
icons/tray-mac.svg), rasterised at build time (build.rs, 22 pt @4x = 88 px) for Retina menu barstray_health::derive_health, mirrored intrayHealth.ts)Preferred IDE (Settings → General)
ide.rs: cross-platform catalog + install detection; macOSopen -a, Linux CLI onPATHopen_site_in_ideTauri command opens the site folder in the chosen appNative tray menu (right-click)
Unchanged role: full dropdown when the panel is not enough.
tray_health::service_rows)Rust-side tray poll (6 s) diffs a snapshot and rebuilds menu/icon only on meaningful change.
TRANSITION/MENU_LOCKstill guard daemon start/stop/restart.Linux tray fallback
If AppIndicator registration fails, the GUI sets
tray_unavailablein settings and keeps the tray panel as an always-available surface (documented indocs/developer/gui.md).New / touched modules
tray_panel.rs— show/hide/toggle, monitor-aware positioning from clickrecttray_health.rs+lib/trayHealth.tslib/traySiteAutocomplete.tside.rs,commands.rs,GeneralView.vueTrayPanelView.vue,router.ts,App.vuetray.rs,build.rs,icons/tray-mac.svgautostart.rs— tray favorites/recent, preferred IDEdocs/developer/gui.mdIPC to the daemon is unchanged except additive GUI settings fields (no wire break).
Related issues
N/A — UX improvement / feature proposal.
Type of change
Platforms tested
Checklist
cargo fmt --all --checkpassescargo clippy -p yerd-gui --all-targets -- -D warningsis cleancargo testfor touched tray modules passes (tray,tray_panel,tray_health— 22 tests)trayHealth,traySiteAutocomplete,serviceActions, Rust layout/health helpers)docs/developer/gui.md)npm run test(28 tray-related) +npm run typecheck+npm run buildinapps/yerd-guiTest plan
Out of scope / follow-ups
docs/guide/desktop-app.md) — could add a tray section in a follow-upSummary by CodeRabbit