CLI-1447: Add test coverage and improve architecture#19
Merged
Conversation
There was a problem hiding this comment.
Pull request overview
This PR refactors the Dashboard feature by extracting data-loading/state-management into a dedicated useDashboardData hook, consolidates shared types, and wires code coverage reporting (with thresholds) into CI.
Changes:
- Extract Dashboard data fetching + state management into
src/features/dashboard/use-dashboard-data.tsand updateDashboardto delegate via the hook. - Add unit tests for the new hook and move shared Dashboard types into
src/features/dashboard/types.ts. - Enable Vitest coverage reporting + thresholds, add a
test:coveragescript, and run it in CI; ignorecoverage/in git and ESLint.
Reviewed changes
Copilot reviewed 15 out of 17 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
vitest.config.ts |
Adds coverage provider/reporters and threshold gating for CI runs. |
vite.config.ts |
Loads env per-mode and uses it to configure the /api proxy target. |
src/features/dashboard/utils.ts |
Updates UserOption import to use the consolidated types.ts. |
src/features/dashboard/use-dashboard-data.ts |
New hook containing extracted Dashboard data/options/detail loading logic. |
src/features/dashboard/use-dashboard-data.test.ts |
New unit tests covering hook behavior and state transitions. |
src/features/dashboard/types.ts |
Adds shared UI/data types (LoadState, CheckpointDetailLoadState, UserOption). |
src/features/dashboard/index.tsx |
Simplifies Dashboard component to useDashboardData() + DashboardView props spread. |
src/features/dashboard/dashboard-view.tsx |
Removes inline type definitions and onCheckpointClose prop; imports types from types.ts. |
src/features/dashboard/components/checkpoint-sheet.tsx |
Updates type import location for CheckpointDetailLoadState. |
package.json |
Adds Apache-2.0 license field, test:coverage script, and coverage dependency; bumps Vitest. |
pnpm-lock.yaml |
Locks updated Vitest version and adds @vitest/coverage-v8 dependency tree. |
eslint.config.js |
Ignores coverage/ output directory. |
.gitignore |
Ignores coverage/ output directory. |
.github/workflows/ci.yml |
Runs pnpm test:coverage instead of pnpm test. |
README.md |
Updates setup/docs, environment table, and adds license section. |
LICENSE |
Adds Apache 2.0 license text. |
docs/plan-vite-8-migration.md |
Removes completed Vite 8 migration planning doc. |
Files not reviewed (1)
- pnpm-lock.yaml: Language not supported
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
danias
approved these changes
Mar 25, 2026
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.
Dashboard logic extracted into useDashboardData hook, with unit tests added and shared types moved to types.ts. Coverage reporting wired into CI with thresholds, and coverage output excluded from git/eslint.