Skip to content

Unify battery and Mac mini stats dashboards - #21

Open
EClinick wants to merge 1 commit into
task/ec/app-energy-costfrom
task/ec/unify-stats-dashboard
Open

Unify battery and Mac mini stats dashboards#21
EClinick wants to merge 1 commit into
task/ec/app-energy-costfrom
task/ec/unify-stats-dashboard

Conversation

@EClinick

@EClinick EClinick commented Aug 2, 2026

Copy link
Copy Markdown
Owner

What changed

  • Route battery and Mac mini presentations through one StatsView root while keeping their data lifecycles mode-specific.
  • Share the dashboard layout, title/header anatomy, app table, titled columns, and app row rendering.
  • Add the Mac mini column treatment to battery Stats, including LIVE W, ENERGY / COST, and CPU TIME.
  • Add a development-only --show-stats launch path for deterministic visual verification.

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

  • make test: 309 tests passed across 40 suites
  • DEVELOPER_DIR=/Applications/Xcode.app/Contents/Developer make app: signed universal Dev app built and verified for arm64 and x86_64
  • git diff --check

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.

Copilot AI review requested due to automatic review settings August 2, 2026 22:39
@vercel

vercel Bot commented Aug 2, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Actions Updated (UTC)
website Ignored Ignored Aug 2, 2026 10:39pm

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 (BatteryStatsDashboard vs MacMiniStatsDashboard).
  • Adds dev-only --show-stats launch 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.

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.

2 participants