Unify battery and Mac mini stats dashboards - #21
Open
EClinick wants to merge 1 commit into
Open
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
There was a problem hiding this comment.
Pull request overview
This PR refactors the Stats UI so both battery Macs and Mac minis render through a single StatsView root while keeping their mode-specific data loading separate. It centralizes the shared window layout and app-table components to prevent future UI drift between device modes, and adds a dev-only --show-stats launch path for deterministic visual checks.
Changes:
- Introduces shared Stats dashboard building blocks (layout, header anatomy, table header, and reusable app row).
- Re-routes battery Stats and Mac mini Stats through a unified
StatsView, while preserving separate data lifecycles (BatteryStatsDashboardvsMacMiniStatsDashboard). - Adds dev-only
--show-statslaunch behavior to open the appropriate Stats window for the current device mode.
Reviewed changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| Tests/JuiceTests/StatsDashboardComponentsTests.swift | Adds coverage for shared column configuration, minimum sizes, and a basic render/bitmap sanity check for shared table components. |
| Tests/JuiceTests/MacMiniPowerRangeTests.swift | Updates minimum-size assertion to reference the unified StatsView server minimum height. |
| Sources/Juice/Stats/StatsWindow.swift | Updates window presenters to use the unified StatsView entry points and the new mode-specific minimum sizes. |
| Sources/Juice/Stats/StatsView.swift | Implements the unified StatsView root and refactors battery Stats to use shared dashboard components and a reusable app row. |
| Sources/Juice/Stats/StatsDashboardComponents.swift | Adds shared reusable dashboard layout/header/table components and a unified app row implementation. |
| Sources/Juice/Stats/MacMiniStatsView.swift | Renames/refactors Mac mini Stats content to MacMiniStatsDashboard and adopts shared dashboard/table components. |
| Sources/Juice/JuiceApp.swift | Adds --show-stats dev-only launch path and refactors model initialization to reuse the initial model instance when opening battery Stats. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What changed
Why
Battery and Mac mini Stats had evolved into separate page implementations. Sharing the structural components keeps their UI consistent and prevents future changes from drifting between device modes.
Verification
Dependency
This PR is intentionally stacked on #20 because it reuses the per-app energy and cost UI introduced there. It can be retargeted to master after #20 merges.