|
| 1 | +# Implementation Plan: Quick Ride Entry from Past Rides |
| 2 | + |
| 3 | +**Branch**: `008-quick-ride-entry` | **Date**: 2026-03-30 | **Spec**: `/specs/008-quick-ride-entry/spec.md` |
| 4 | +**Input**: Feature specification from `/specs/008-quick-ride-entry/spec.md` |
| 5 | + |
| 6 | +**Note**: This template is filled in by the `/speckit.plan` command. See `.specify/templates/plan-template.md` for the execution workflow. |
| 7 | + |
| 8 | +## Summary |
| 9 | + |
| 10 | +Add a quick-entry assist to the existing record-ride flow so authenticated riders can select from up to five distinct prior miles-duration combinations and prefill form fields without auto-saving. The feature introduces a rider-scoped query contract for quick options, keeps manual editing and validation unchanged, and updates options after successful new ride submission. |
| 11 | + |
| 12 | +## Technical Context |
| 13 | + |
| 14 | +**Language/Version**: C# (.NET 10), TypeScript (React 19 + Vite), F# domain project available |
| 15 | +**Primary Dependencies**: ASP.NET Core Minimal API, EF Core (SQLite provider), existing rides endpoints and auth/session flow, React form state patterns |
| 16 | +**Storage**: SQLite local-file profile via EF Core; quick options derived from existing rider ride data (no new storage engine) |
| 17 | +**Testing**: `dotnet test BikeTracking.slnx`, frontend `npm run lint`, `npm run build`, `npm run test:unit`, and `npm run test:e2e` for cross-layer flow |
| 18 | +**Target Platform**: Local-first Aspire web app in DevContainer (browser frontend + .NET API) |
| 19 | +**Project Type**: Web application (React frontend + Minimal API backend) |
| 20 | +**Performance Goals**: Quick-options query should stay under constitutional API target (<500ms p95); quick option selection should prefill form immediately on client interaction |
| 21 | +**Constraints**: Rider-scoped data isolation, no auto-save on option select, max 5 distinct options, preserve existing validation semantics, offline/error fallback to manual entry |
| 22 | +**Scale/Scope**: One query endpoint for quick options, ride-entry UI enhancement, and tests covering duplicate suppression, limit behavior, and edit-after-prefill |
| 23 | + |
| 24 | +## Constitution Check |
| 25 | + |
| 26 | +*GATE: Must pass before Phase 0 research. Re-check after Phase 1 design.* |
| 27 | + |
| 28 | +### Pre-Research Gate Review |
| 29 | + |
| 30 | +| Gate | Status | Notes | |
| 31 | +|------|--------|-------| |
| 32 | +| DevContainer-only development | PASS | Planning commands and artifact generation executed inside the workspace container. | |
| 33 | +| Clean architecture boundaries | PASS | Feature boundaries remain in ride-entry UI + API query service over existing ride data. | |
| 34 | +| React + TypeScript consistency | PASS | Quick options rendered and applied through typed React state/form patterns. | |
| 35 | +| Data validation depth | PASS | Existing client/API/DB validation retained; quick options only prefill values, not bypass rules. | |
| 36 | +| Contract-first collaboration | PASS | Dedicated quick-options API contract defined before implementation. | |
| 37 | +| TDD gated workflow | PASS WITH ACTION | Tasks must enforce red-first tests and explicit user confirmation of failing tests prior to coding. | |
| 38 | +| Performance and observability expectations | PASS | Query limited to 5 distinct values and rider-scoped filter; metrics/logging remain on current pipeline. | |
| 39 | + |
| 40 | +No constitutional violations identified. |
| 41 | + |
| 42 | +### Post-Design Gate Re-Check |
| 43 | + |
| 44 | +| Gate | Status | Notes | |
| 45 | +|------|--------|-------| |
| 46 | +| Architecture and modularity | PASS | Design isolates quick-option derivation in query path and keeps create-ride command flow unchanged. | |
| 47 | +| Contract compatibility | PASS | New endpoint is additive and does not alter existing ride history or record-ride contract behavior. | |
| 48 | +| Validation and safety | PASS | Prefill can be edited and still must pass existing required-field/constraint validation. | |
| 49 | +| UX consistency and accessibility | PASS | Feature remains optional, non-blocking, and compatible with existing entry form behavior. | |
| 50 | +| Verification matrix coverage | PASS WITH ACTION | Quickstart includes required backend/frontend/e2e validation commands for cross-layer changes. | |
| 51 | + |
| 52 | +## Project Structure |
| 53 | + |
| 54 | +### Documentation (this feature) |
| 55 | + |
| 56 | +```text |
| 57 | +specs/008-quick-ride-entry/ |
| 58 | +├── plan.md |
| 59 | +├── research.md |
| 60 | +├── data-model.md |
| 61 | +├── quickstart.md |
| 62 | +├── contracts/ |
| 63 | +│ └── quick-ride-options-api.yaml |
| 64 | +└── tasks.md # generated by /speckit.tasks |
| 65 | +``` |
| 66 | + |
| 67 | +### Source Code (repository root) |
| 68 | +```text |
| 69 | +src/ |
| 70 | +├── BikeTracking.Api/ |
| 71 | +│ ├── Endpoints/ |
| 72 | +│ ├── Application/ |
| 73 | +│ ├── Contracts/ |
| 74 | +│ └── Infrastructure/ |
| 75 | +├── BikeTracking.Api.Tests/ |
| 76 | +│ ├── Endpoints/ |
| 77 | +│ ├── Application/ |
| 78 | +│ └── Infrastructure/ |
| 79 | +└── BikeTracking.Frontend/ |
| 80 | + ├── src/ |
| 81 | + │ ├── pages/ |
| 82 | + │ ├── components/ |
| 83 | + │ └── services/ |
| 84 | + └── tests/ |
| 85 | +``` |
| 86 | + |
| 87 | +**Structure Decision**: Reuse the existing web-app split and implement a query-side quick-option slice: backend exposes rider-scoped quick options from existing rides data, frontend consumes options on record-ride load and applies selection to current form state. |
| 88 | + |
| 89 | +## Complexity Tracking |
| 90 | +No constitutional violations requiring justification. |
0 commit comments