Remove milestones, progress bar and stats box #49

Closed
opened 2026-08-15 13:34:59 +02:00 by myrmidex · 1 comment
Owner

Milestones are a second feature living inside the counter. Cut entirely.

Scope

PHP:

  • app/Models/Milestone.php, app/Http/Controllers/Milestones/MilestoneController.php
  • Tracker::milestones(); User::hasMilestones() and User::hasCompletedOnboarding()
  • milestones.* route group

Frontend:

  • components/Display/ProgressBar.tsx (61), components/Display/StatsBox.tsx (143)
  • components/Milestones/AddMilestoneForm.tsx
  • Milestone interface in types/domain.ts
  • Milestone state in dashboard.tsx: milestones, selectedMilestoneIndex, showProgressBar, showStatsBox, handleMilestoneSuccess, handleMilestoneSelect, handleProgressClick

Migrations: new migration dropping milestones. Note 2026_05_02_000003_add_tracker_to_milestones_drop_from_users also touches this table — drop the table wholesale rather than reversing that migration.

⚠️ Test coverage

tests/Feature/MilestoneTest.php is currently the repo's only test file. Deleting it leaves the suite empty until #51 adds counter tests.

This is accepted, but it means #47/#48/#50 land with no automated safety net. Verify those manually via the UI before merging. #51 restores coverage.

Acceptance criteria

  • Dashboard shows the LED number with no progress bar or stats box
  • No dangling milestone references in PHP or TS
  • Migration runs clean forward on a fresh DB
  • Lint + PHPStan clean
Milestones are a second feature living inside the counter. Cut entirely. ## Scope **PHP:** - `app/Models/Milestone.php`, `app/Http/Controllers/Milestones/MilestoneController.php` - `Tracker::milestones()`; `User::hasMilestones()` and `User::hasCompletedOnboarding()` - `milestones.*` route group **Frontend:** - `components/Display/ProgressBar.tsx` (61), `components/Display/StatsBox.tsx` (143) - `components/Milestones/AddMilestoneForm.tsx` - `Milestone` interface in `types/domain.ts` - Milestone state in `dashboard.tsx`: `milestones`, `selectedMilestoneIndex`, `showProgressBar`, `showStatsBox`, `handleMilestoneSuccess`, `handleMilestoneSelect`, `handleProgressClick` **Migrations:** new migration dropping `milestones`. Note `2026_05_02_000003_add_tracker_to_milestones_drop_from_users` also touches this table — drop the table wholesale rather than reversing that migration. ## ⚠️ Test coverage `tests/Feature/MilestoneTest.php` is currently the repo's **only** test file. Deleting it leaves the suite empty until #51 adds counter tests. This is accepted, but it means #47/#48/#50 land with no automated safety net. Verify those manually via the UI before merging. #51 restores coverage. ## Acceptance criteria - [ ] Dashboard shows the LED number with no progress bar or stats box - [ ] No dangling milestone references in PHP or TS - [ ] Migration runs clean forward on a fresh DB - [ ] Lint + PHPStan clean
myrmidex added this to the (deleted) milestone 2026-08-15 13:34:59 +02:00
myrmidex added the
enhancement
label 2026-08-15 13:34:59 +02:00
myrmidex self-assigned this 2026-08-15 13:34:59 +02:00
myrmidex modified the milestone from (deleted) to v0.4.0 2026-08-15 13:42:21 +02:00
Author
Owner

Done

Two commits on release/0.4.0:

  • ae5312f — milestone removal, 14 files, −526 lines
  • 2fe1f22 — README corrections

Removed

PHP: Milestone model, MilestoneController, Tracker::milestones(), User::hasMilestones(), User::hasCompletedOnboarding(), the milestones.* route group and its import.

Migration: 2026_08_15_000001_drop_milestones_table.php.

Frontend: ProgressBar.tsx, StatsBox.tsx, AddMilestoneForm.tsx, the Milestone interface.

Knock-on changes

The progressive-disclosure chain collapsed. It was LED click → progress bar → click → stats box → buttons set activeForm. With the middle layers gone, clicking the LED now toggles the entry form directly. dashboard.tsx went 174 → 107 lines.

InlineForm API changed from type: 'purchase' | 'milestone' to open: boolean — it was a two-way switch that became a pass-through.

tests/Feature/.gitkeep added. MilestoneTest.php was the only file in tests/Feature, so git removed the directory, and phpunit.xml:11-13 declares a Feature suite pointing at it — PHPUnit errored with "Test directory not found". CI would have gone red without this.

Caught in review

The drop migration's down() originally recreated target as unsignedBigInteger, but the original (2025_07_12_221324:16) is integer. Fixed before commit — down() now restores the table faithfully.

Gates

Gate Result
npx eslint . PASS — exit 0
npm run build PASS
Pint PASS — 47 files
PHPUnit PASS — 1 test (forward migration verified via RefreshDatabase)

"PHPStan clean" could not be checked — PHPStan is not installed in this project yet. That is #55.

The down() path was verified by reading against the original definitions, not executed: container_tinker returns empty output for every expression in this project, and container_db_read invokes a mariadb client against a MySQL 8.0 container. Both MCP tools appear misconfigured for incr — worth a separate look.

Test coverage

The suite is now a single placeholder test (tests/Unit/ExampleTest.php). Known and accepted; #54 restores real coverage.

## Done Two commits on `release/0.4.0`: - `ae5312f` — milestone removal, 14 files, −526 lines - `2fe1f22` — README corrections ### Removed **PHP:** `Milestone` model, `MilestoneController`, `Tracker::milestones()`, `User::hasMilestones()`, `User::hasCompletedOnboarding()`, the `milestones.*` route group and its import. **Migration:** `2026_08_15_000001_drop_milestones_table.php`. **Frontend:** `ProgressBar.tsx`, `StatsBox.tsx`, `AddMilestoneForm.tsx`, the `Milestone` interface. ### Knock-on changes **The progressive-disclosure chain collapsed.** It was LED click → progress bar → click → stats box → buttons set `activeForm`. With the middle layers gone, clicking the LED now toggles the entry form directly. `dashboard.tsx` went 174 → 107 lines. **`InlineForm` API changed** from `type: 'purchase' | 'milestone'` to `open: boolean` — it was a two-way switch that became a pass-through. **`tests/Feature/.gitkeep` added.** `MilestoneTest.php` was the only file in `tests/Feature`, so git removed the directory, and `phpunit.xml:11-13` declares a Feature suite pointing at it — PHPUnit errored with "Test directory not found". CI would have gone red without this. ### Caught in review The drop migration's `down()` originally recreated `target` as `unsignedBigInteger`, but the original (`2025_07_12_221324:16`) is `integer`. Fixed before commit — `down()` now restores the table faithfully. ### Gates | Gate | Result | |---|---| | `npx eslint .` | PASS — exit 0 | | `npm run build` | PASS | | Pint | PASS — 47 files | | PHPUnit | PASS — 1 test (forward migration verified via `RefreshDatabase`) | "PHPStan clean" could not be checked — PHPStan is not installed in this project yet. That is #55. The `down()` path was verified by reading against the original definitions, not executed: `container_tinker` returns empty output for every expression in this project, and `container_db_read` invokes a `mariadb` client against a MySQL 8.0 container. Both MCP tools appear misconfigured for incr — worth a separate look. ### Test coverage The suite is now a single placeholder test (`tests/Unit/ExampleTest.php`). Known and accepted; #54 restores real coverage.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: lvl0/incr#49
No description provided.