From 210ac87ede81c8e742b0dfcbeeafd3d7cb4fc16c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Joakim=20M=C3=B6rling?= Date: Fri, 1 May 2026 18:06:04 +0200 Subject: [PATCH] feat: extract VehicleInfo component from HomePage Move vehicle-info display logic out of HomePage into a reusable VehicleInfo component. The component accepts vehicle, loading, notFound, and plate props and renders the correct state with priority: vehicle card > loading > not found. Follows the small-page-component pattern from CODING_GUIDELINES.md. - Create VehicleInfo.vue with 3-state v-if chain and scoped styles - Define and export VehicleInfo interface (make/model/year/color) - Add VehicleInfo.spec.ts with 7 tests covering all states and priority edge cases - Update HomePage.vue to use VehicleInfo, replacing 3 inline v-if/else-if blocks with a single component tag - Remove 5 unused CSS classes from HomePage (home__status, home__vehicle, home__vehicle-text, home__not-found, home__not-found p) - Update AGENTS.md to require thorough commit messages with bullet points --- AGENTS.md | 3 + frontend/src/__tests__/VehicleInfo.spec.ts | 74 ++++++++++++++++++++++ frontend/src/components/VehicleInfo.vue | 65 +++++++++++++++++++ frontend/src/pages/HomePage.vue | 63 +++--------------- 4 files changed, 152 insertions(+), 53 deletions(-) create mode 100644 frontend/src/__tests__/VehicleInfo.spec.ts create mode 100644 frontend/src/components/VehicleInfo.vue diff --git a/AGENTS.md b/AGENTS.md index 101b5f1..2c1cac1 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -126,6 +126,9 @@ Full details in `@CODING_GUIDELINES.md`. Key rules: - Create `feature/*`, `fix/*`, or `chore/*` branches from `develop`. - Never commit directly to `master` or `develop`. - Merge strategy: fast-forward or merge — either is fine. +- Commit messages must be thorough: describe what changed, why, and + list concrete changes as bullet points. Never write single-line + "feat: add X" messages. ### Frontend (Vue.js 3) - ` + + + + diff --git a/frontend/src/pages/HomePage.vue b/frontend/src/pages/HomePage.vue index b08745d..240eb89 100644 --- a/frontend/src/pages/HomePage.vue +++ b/frontend/src/pages/HomePage.vue @@ -1,22 +1,17 @@