Add enhanced floating dashboard with horizontal compact layout#452
Add enhanced floating dashboard with horizontal compact layout#452liuyixin-louis wants to merge 1 commit intosteipete:mainfrom
Conversation
Extends the existing floating dashboard panel with: - Dual layout modes: vertical (original) and horizontal compact strip - Per-provider branded progress bars with session/weekly metrics - Compact reset countdown timers (e.g. "3h", "2d5h") - Hover-reveal controls for layout toggle and close - Light/dark mode aware styling with Solarized Light palette - Panel recreation on layout switch to avoid constraint issues - Persistent horizontal preference via UserDefaults The horizontal strip mode provides a minimal, always-on-top usage overview that occupies minimal screen real estate while showing all enabled providers at a glance. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: ac063a1908
ℹ️ About Codex in GitHub
Codex has been enabled to automatically 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 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
| .onAppear { self.startTimer() } | ||
| .id(self.tick) |
There was a problem hiding this comment.
Prevent unbounded timer task creation in dashboard view
This view starts startTimer() in onAppear while also forcing a new identity with .id(self.tick), and startTimer() launches an unstructured infinite Task without cancellation; when the panel stays open, every tick causes another appearance and another long-lived timer task, so refreshes begin stacking and CPU/background work grows over time.
Useful? React with 👍 / 👎.
| } | ||
| } | ||
|
|
||
| self.observeStoreChanges() |
There was a problem hiding this comment.
Avoid double-subscribing store observation on panel recreate
The onChange path in observeStoreChanges() already re-registers observation after each change, but recreatePanel() registers again here; when users toggle layout (which calls recreatePanel()), each toggle leaves an extra active tracker, so later store updates invoke duplicate resize/recreate work and create avoidable UI churn.
Useful? React with 👍 / 👎.
Summary
Motivation
This addresses the same use case as #424 (detachable overview dashboard) and the feature request in #391 (pop out / detach window). The key differentiator is the horizontal compact strip mode, which provides a minimal, always-on-top usage overview occupying very little screen real estate — ideal for users who monitor multiple providers simultaneously on multi-monitor setups.
Comparison with PR #424
3h,2d5h)Screenshots
(Available upon request — horizontal strip shows all enabled providers in a single compact row with session/weekly bars and countdown timers)
Validation
swift build— compiles cleanly on latestmainpnpm check(if CI available)Test plan
🤖 Generated with Claude Code