feat(dashboard): customise widget visibility order and size
This commit is contained in:
@@ -45,10 +45,10 @@ SQLite and MariaDB use provider-neutral EF mapping and conditional updates. Expl
|
||||
|
||||
## Checkpoints and TODO
|
||||
|
||||
- [ ] P8-00: baseline suites, catalogue, persistence and prerequisite review; commit/push plan.
|
||||
- [ ] P8-01: editing, visibility, draft/cancel, empty recovery, localisation; focused component tests and checkpoint commit/push.
|
||||
- [ ] P8-02: existing drag helper, named move buttons, DOM ordering and discrete grid sizing; normalisation/focus tests and checkpoint commit/push.
|
||||
- [ ] P8-03: additive account storage, validated endpoint, revision conflict, retry/reset/session isolation; backend/frontend integration proof and checkpoint commit/push.
|
||||
- [x] P8-00: baseline suites, catalogue, persistence and prerequisite review; commit/push plan.
|
||||
- [x] P8-01: editing, visibility, draft/cancel, empty recovery, localisation; focused component tests and shared P8-01/02 checkpoint commit/push.
|
||||
- [x] P8-02: existing drag helper, named move buttons, DOM ordering and discrete grid sizing; normalisation/focus tests and shared P8-01/02 checkpoint commit/push.
|
||||
- [x] P8-03: additive account storage, validated endpoint, revision conflict, retry/reset/session isolation; backend/frontend integration proof and checkpoint commit/push.
|
||||
- [ ] P8-04: actual browser desktop/tablet/mobile, EN/NB, themes, keyboard, failures and axe; inspect captures, retain human qualifications; commit/push.
|
||||
- [ ] P8-05: full backend/frontend/browser, separate standard contracts/sidecar, types/lint/build/security; 57-group reconciliation, final decisions and handoff; commit/push and direct remote verification.
|
||||
|
||||
|
||||
@@ -0,0 +1,18 @@
|
||||
# P8-01 — Editing and visibility
|
||||
|
||||
Implemented an explicit inline editing mode using existing MUI/PageSection/confirmation/toast patterns. All nine existing report sections are configurable. Visibility updates only the draft preview; Save waits for the owner-only API acknowledgement; Cancel confirms a dirty discard and never writes. Every widget may be hidden, with an intentional empty message and the persistent Customise action. Existing onboarding/new-account guidance stays reachable. All new copy is English/Bokmål.
|
||||
|
||||
The typed catalogue and persistence hook are one shared prerequisite; visibility/order/size controls are one coherent editor. P8-01 and P8-02 share that frontend source commit rather than manufacture an intermediate editor that cannot represent its saved server contract. Backend storage was implemented first to make the first real Save safe. This is a checkpoint ordering/grouping deviation, not additional scope.
|
||||
|
||||
## Fresh evidence
|
||||
|
||||
- Original five new editor cases failed against the immediate-menu implementation (`editor-red.log`). Integrated focused run now passes **36 tests / 6 suites** (`dashboard-final.json`): Dashboard presentation, Analytics presentation, daily control loop, catalogue, layout hook and six editor cases. Zero failed/skipped in that run; the full frontend remains a separate final lane.
|
||||
- Existing exact monthly values, denominators, custom status/company destinations, independent summary/trends errors and period loading remain asserted. Original five-flag immediate local-write test now asserts all nine choices through explicit Save and remount with persisted server readback fixture.
|
||||
- Catalogue/hook tests exercise corrupted/unknown/duplicate IDs, unsupported sizes, missing new widgets appended hidden, legacy owner-only flags, failed save/retry, unsupported future version, 409/reload and late responses after identity change/unmount. Mocked component API responses are not cross-device HTTP evidence.
|
||||
- Corrected real browser run passed **10/10**, zero skipped/retried/flaky (`browser-corrected.json`): two retained Dashboard journeys plus eight new Phase 8 cases. Actual SQLite/API/cookies/CSRF verify saved readback, fresh browser login, logout/login, two-session conflict, isolation, reset/cancel, failure/retry and all-hidden recovery. The initial prebuilt bundle targeted port5202 instead of the isolated5302 API; its 10 failures are retained in `browser-focused.json`. Rebuild with `NEXT_PUBLIC_API_BASE_URL=http://localhost:5302/api` corrected the harness without relaxing assertions.
|
||||
|
||||
## Review repairs and conditions
|
||||
|
||||
Review reproduced pending-save navigation offering an untrue discard promise. A deferred-PUT test failed first, then passed after the guard began holding SPA navigation with a truthful wait status during saving. Aborting a browser request is never represented as a server rollback. A browser unload warning cannot guarantee save cancellation.
|
||||
|
||||
Screenshots exposed edit-entry focus scrolling the heading beneath the fixed header. An actual browser geometry regression failed against that bundle; local scroll-margin plus deliberate focus/scroll is now implemented, with the succeeding full browser run pending. New controls preserve the app's focus ring, native selects and 44px pointer controls. Final responsive, axe and human qualification is recorded in P8-04 rather than inferred from unit tests.
|
||||
@@ -0,0 +1,11 @@
|
||||
# P8-02 — Ordering and supported sizes
|
||||
|
||||
The existing `useDragReorder` provides desktop handle drag and an explicit drop-target border. The dedicated handle prevents ordinary widget actions from starting a drag. Named Earlier/Later buttons are the keyboard and touch alternative. Stable React keys, DOM order, a live position announcement and focus retention cover moving the focused control to the first/last position. No new drag library or dependency was added.
|
||||
|
||||
All nine IDs use one canonical order, including hidden widgets. Hiding preserves size and position. Summary cards support full width only; the other eight report sections support standard/full. The existing report nodes and accessible values tables render inside a two-column CSS grid at `md` and larger. Full width spans both columns. Below `md`, every widget uses one readable full-width column; saved widths remain unchanged. No dense packing, CSS visual-only order, fixed heights or arbitrary pixels.
|
||||
|
||||
Catalogue normalisation preserves known order, ignores unknown/duplicate IDs, falls back from unsupported sizes and appends absent entries hidden for saved revisions. The server separately rejects invalid writes, rather than trusting the frontend. The [catalogue](../README.md) names all defaults/data owners.
|
||||
|
||||
Integrated **36/36** focused frontend tests and corrected **10/10** real browser cases include order/size/visibility readback, native handle drag, keyboard focus/status, emulated touch button movement and zero page overflow at320/390/768/1440px in both themes/languages. Source evidence: `.artifacts/phase8/dashboard-final.json`, `browser-corrected.json`. The shared editor source is committed with P8-01 as documented there. Later fixed-header focus repair and full-regression results belong to final acceptance.
|
||||
|
||||
Physical touchscreen, software keyboard, human screen reader, complete true browser zoom, other-browser and production render qualification remain unperformed. Emulation does not close these requirements.
|
||||
Reference in New Issue
Block a user