Skip to content

CLI-1447: Add test coverage and improve architecture#19

Merged
danias merged 6 commits intomainfrom
cli-1447-coverage-and-architecture
Mar 25, 2026
Merged

CLI-1447: Add test coverage and improve architecture#19
danias merged 6 commits intomainfrom
cli-1447-coverage-and-architecture

Conversation

@the-krafty-koder
Copy link
Copy Markdown
Contributor

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.

Copy link
Copy Markdown

Copilot AI left a comment

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 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.ts and update Dashboard to 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:coverage script, and run it in CI; ignore coverage/ 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.

@the-krafty-koder the-krafty-koder requested a review from danias March 24, 2026 15:01
@danias danias merged commit ed40d4b into main Mar 25, 2026
5 checks passed
@danias danias deleted the cli-1447-coverage-and-architecture branch March 25, 2026 20:17
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.

3 participants