docs(07-01): complete dashboard and navigation polish plan

- SUMMARY.md documents /packages route, dashboard live queries, 99 tests green
- STATE.md advanced to 7/7 phases complete (100%)
- ROADMAP.md marks Phase 7 and plan 07-01 complete
This commit is contained in:
2026-04-13 09:00:01 +02:00
parent 91910ad97d
commit 14293a8443
3 changed files with 98 additions and 16 deletions
+3 -3
View File
@@ -18,7 +18,7 @@ Decimal phases appear between their surrounding integers in numeric order.
- [x] **Phase 4: Script Generation** - PowerShell install/uninstall/detection scripts with all correctness guards (completed 2026-04-10)
- [x] **Phase 5: Package Export** - .intunewin and NinjaRMM ZIP export, icon upload, command preview (completed 2026-04-10)
- [x] **Phase 6: Wire Icon into .intunewin Export** - Embed uploaded icon in .intunewin package, closing PKG-04 gap (completed 2026-04-10)
- [ ] **Phase 7: Dashboard & Navigation Polish** - Fix /packages 404 nav link, wire dashboard recent queries
- [x] **Phase 7: Dashboard & Navigation Polish** - Fix /packages 404 nav link, wire dashboard recent queries (completed 2026-04-13)
## Phase Details
@@ -123,7 +123,7 @@ Plans:
3. Dashboard shows recently exported packages from the database
Plans:
- [ ] 07-01-PLAN.md — Add /packages route, wire dashboard queries, verify nav links
- [x] 07-01-PLAN.md — Add /packages route, wire dashboard queries, verify nav links (completed 2026-04-13)
## Progress
@@ -138,4 +138,4 @@ Phases execute in numeric order: 1 -> 2 -> 3 -> 4 -> 5
| 4. Script Generation | 2/2 | Complete | 2026-04-10 |
| 5. Package Export | 2/2 | Complete | 2026-04-10 |
| 6. Wire Icon into .intunewin Export | 1/1 | Complete | 2026-04-10 |
| 7. Dashboard & Navigation Polish | 0/1 | Pending | |
| 7. Dashboard & Navigation Polish | 1/1 | Complete | 2026-04-13 |
+15 -13
View File
@@ -3,14 +3,14 @@ gsd_state_version: 1.0
milestone: v1.0
milestone_name: milestone
status: executing
stopped_at: Completed 06-01-PLAN.md
last_updated: "2026-04-10T14:24:06.549Z"
last_activity: "2026-04-10 — Plan 04-02 complete: uninstall/detect templates, render_uninstall/render_detect, 3 script API endpoints, 75 tests green"
stopped_at: Completed 07-01-PLAN.md
last_updated: "2026-04-13T06:58:00Z"
last_activity: "2026-04-13 — Plan 07-01 complete: /packages route, dashboard live queries, 99 tests green"
progress:
total_phases: 7
completed_phases: 6
total_plans: 12
completed_plans: 12
completed_phases: 7
total_plans: 13
completed_plans: 13
---
---
@@ -40,12 +40,12 @@ See: .planning/PROJECT.md (updated 2026-04-10)
## Current Position
Phase: 4 of 5 (Script Generation)
Plan: 2 of 2 in current phase (04-02 complete)
Status: Executing
Last activity: 2026-04-10 — Plan 04-02 complete: uninstall/detect templates, render_uninstall/render_detect, 3 script API endpoints, 75 tests green
Phase: 7 of 7 (Dashboard & Navigation Polish)
Plan: 1 of 1 in current phase (07-01 complete)
Status: Complete
Last activity: 2026-04-13 — Plan 07-01 complete: /packages route, dashboard live queries, 99 tests green
Progress: [█████████] 89%
Progress: [█████████] 100%
## Performance Metrics
@@ -75,6 +75,7 @@ Progress: [█████████░] 89%
| Phase 05-package-export P01 | 2 | 1 tasks | 3 files |
| Phase 05-package-export P02 | 15 | 2 tasks | 9 files |
| Phase 06-wire-icon-intunewin P01 | 5 | 1 tasks | 2 files |
| Phase 07-dashboard-nav-polish P01 | 1 | 2 tasks | 4 files |
## Accumulated Context
@@ -115,6 +116,7 @@ Recent decisions affecting current work:
- [Phase 05-package-export]: Icon replace via delete-then-create — unique FK makes upsert awkward, delete first is simpler
- [Phase 05-package-export]: Export/command sections conditionally shown when has_driver is true — avoids confusing broken links before driver assigned
- [Phase 06-wire-icon-intunewin]: Icon copy is silent-skip on missing DB record or missing disk file — export always succeeds regardless of icon presence
- [Phase 07-dashboard-nav-polish]: packages_page mirrors printers_page LEFT_OUTER join pattern (Client + Driver, switch(Printer), list() wrapper); dashboard filters recent_packages via Printer.driver.is_null(False)
### Pending Todos
@@ -127,6 +129,6 @@ None yet.
## Session Continuity
Last session: 2026-04-10T14:22:10.947Z
Stopped at: Completed 06-01-PLAN.md
Last session: 2026-04-13T06:58:00Z
Stopped at: Completed 07-01-PLAN.md
Resume file: None
@@ -0,0 +1,80 @@
---
phase: 07-dashboard-nav-polish
plan: 01
subsystem: web-ui
tags: [dashboard, navigation, packages, integration]
one_liner: "Wired dashboard to live DB queries and added /packages listing page closing two visible integration gaps"
dependency_graph:
requires:
- "imptune/db/models.py (Printer, Client, Driver)"
- "imptune/templates/base.html (nav link /packages)"
- "Existing /printers/{id}/packages/intunewin and /ninja endpoints"
provides:
- "GET /packages route rendering printers with drivers"
- "Dashboard recent_printers and recent_packages live queries"
- "packages.html template"
affects:
- "imptune/api/pages.py (dashboard + new packages_page)"
- "imptune/templates/dashboard.html (clickable links, quick actions)"
tech_stack:
added: []
patterns:
- "Deferred imports inside route bodies"
- "list(Model.select()...) wrapper over Peewee queries"
- "LEFT_OUTER joins on Client + Driver with switch(Printer)"
key_files:
created:
- "imptune/templates/packages.html"
- ".planning/phases/07-dashboard-nav-polish/07-01-SUMMARY.md"
modified:
- "imptune/api/pages.py"
- "imptune/templates/dashboard.html"
- "tests/test_static.py"
decisions:
- "packages_page follows printers_page join pattern (LEFT_OUTER Client + Driver, switch, list wrapper)"
- "Empty-state message shown when no driver-assigned printers exist; filter via Printer.driver.is_null(False)"
- "Dashboard list items are anchor tags linking to /printers/{id} detail"
metrics:
duration_min: 1
tasks_completed: 2
files_touched: 4
tests_added: 3
tests_total: 99
completed_at: "2026-04-13"
---
# Phase 7 Plan 1: Dashboard and Packages Wire-Up Summary
Closed two visible integration gaps: the /packages nav link previously returned 404 and the dashboard was rendering hard-coded empty lists despite real records in the database.
## What Was Built
- **New `/packages` route** in `imptune/api/pages.py` mirroring the `printers_page` join pattern; filters to printers where `driver IS NOT NULL` and renders the new `packages.html` template.
- **`packages.html` template** extending `base.html`, showing a Pico grid table with printer name (linked to detail page), client, driver filename, and direct download links for `.intunewin` and NinjaRMM ZIP packages.
- **Dashboard live queries**: `recent_printers = Printer.select().order_by(created_at desc).limit(5)` and `recent_packages` filtered to driver-assigned printers only.
- **Dashboard UX polish**: list items are now anchors to `/printers/{id}`; quick-action buttons (New Printer / Upload Driver / Export Package) are wired to real routes with `aria-disabled` removed.
- **Three integration tests** in `tests/test_static.py` proving /packages returns 200, dashboard shows real printer names, and the recent packages section includes only driver-assigned printers.
## Verification
- Full test suite: `python -m pytest tests/`**99 passed, 0 failed**
- TDD flow: RED commit (8cf47f5) → GREEN commit (91910ad)
- All three new tests failed as expected before the implementation landed and pass after.
## Deviations from Plan
None — plan executed exactly as written.
## Commits
- `8cf47f5` test(07-01): add failing tests for /packages route and dashboard data
- `91910ad` feat(07-01): wire dashboard data and add /packages listing page
## Self-Check: PASSED
- FOUND: imptune/templates/packages.html
- FOUND: imptune/api/pages.py (packages_page route present)
- FOUND: imptune/templates/dashboard.html (clickable links + wired quick actions)
- FOUND: tests/test_static.py (3 new tests)
- FOUND commit: 8cf47f5
- FOUND commit: 91910ad