From 5eb75127bdf329ffbefc10bbe575c850fb11b69f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Burak=20Boduro=C4=9Flu?= <80620802+burakboduroglu@users.noreply.github.com> Date: Wed, 15 Jul 2026 21:04:20 +0300 Subject: [PATCH] =?UTF-8?q?feat:=20=E2=9C=A8=20enhance=20dashboard=20docum?= =?UTF-8?q?entation=20-=20clarify=20dashboard=20structure,=20role=20scopin?= =?UTF-8?q?g,=20and=20design=20principles;=20update=20navigation=20pattern?= =?UTF-8?q?s=20and=20role=20scope=20matrix=20for=20consistency?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- AGENTS.md | 21 ++++++++++++++-- docs/frontend-next-steps.md | 5 ++-- docs/navigation-patterns.md | 22 ++++++++++++++++- docs/role-scope-matrix.md | 2 +- docs/ui-redesign-tokens.md | 48 +++++++++++++++++++++++++++++++++++-- 5 files changed, 90 insertions(+), 8 deletions(-) diff --git a/AGENTS.md b/AGENTS.md index 8bee235..4e53809 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -69,8 +69,9 @@ Solid components run **once**, there is no re-render: - Treat these docs as active project context before changing related areas: - `docs/frontend-next-steps.md` — active backlog, role/pagination/request audit notes. - - `docs/navigation-patterns.md` — interaction rules, role scope, side-panel/full-page decisions. - - `docs/ui-redesign-tokens.md` — visual density, radius, table, side-panel, and status UI conventions. + - `docs/navigation-patterns.md` — interaction rules, role scope, side-panel/full-page decisions, dashboard structure. + - `docs/ui-redesign-tokens.md` — visual density, radius, table, side-panel, status UI, and dashboard card conventions. + - `docs/role-scope-matrix.md` — role access matrix for pages/nav/dashboard cards. - `docs/backend-ui-alignment-plan.md` — completed backend-alignment archive; do not treat it as active work unless backend scope changes. - Durable resources use full detail pages. Short create/edit/filter work uses `SidePanel`. Destructive actions use confirm dialogs. - Header create actions use compact icon+label buttons with consistent size and current radius. @@ -79,6 +80,22 @@ Solid components run **once**, there is no re-render: - Lesson session roll call is teacher/manager workflow only. Students never self-mark lesson sessions; the session teacher or course manager marks enrolled students, and the session teacher's own presence row is manager-only per backend rules. - Attendance status UI uses shared localized metadata: label, short detail text, and semantic colors. +## Dashboard / homepage design + +Reference: `src/pages/dashboard-page.tsx`. Homepage is a **read-only status board**, not a marketing landing or action hub. + +- **No mutations** on the dashboard: no create/edit/delete buttons, no primary CTAs that open forms. Links only navigate to existing list/detail routes. +- **Palette:** monochrome / grayscale surfaces (border, card, muted). Decorative color accents, gradients, activity charts, and multi-tone portal cards are out. **Semantic color only** for status (active / today / soon / danger). +- **Layout order (top → bottom):** + 1. Compact header — greeting, role chip (neutral), date. + 2. Role-scoped **workspace portal cards** (section links with optional counts). + 3. **Needs attention** + **Upcoming** side by side on `lg+`, stacked on mobile. +- **Portal cards:** horizontal dense rows — icon | title + short desc | optional count. On desktop, title and count share one line as `Title | 12` (pipe separator, mono tabular count). No separate KPI strip that repeats the same numbers under the cards. +- **Grid:** `1` col mobile → `2` sm → `3` lg → `4` xl. Equal-ish min height; avoid uneven multi-line stat stacks. +- **Role scoping:** card set matches nav/role matrix (student personal tools; teacher teaching tools; manager+ management; admin gets staff-work + users, not personal `/work`). Optional min-role badge on a card is muted/neutral, not rainbow. +- **Attention list:** active / today / soon exams and events only; rows navigate to detail. Empty state is plain text, not a create CTA. +- Do not reintroduce guide marketing blocks, vanity charts, or redundant bottom KPI tiles. + ## Containers - We use **Podman**, not Docker. Never suggest, generate, or run `docker` / diff --git a/docs/frontend-next-steps.md b/docs/frontend-next-steps.md index d6a39fd..6de9c5d 100644 --- a/docs/frontend-next-steps.md +++ b/docs/frontend-next-steps.md @@ -8,7 +8,7 @@ validation, and list filtering cleanup. - Backend alignment is complete for settings, terms, course sessions, attendance reports, work logs, exam attempts, and grade bands. - Shared UI primitives cover dense tables, data toolbars, row action menus, side panels, confirm dialogs, date picking, and animated disclosures. -- Dashboard is role-aware and read-only. Admin sees global course/exam scope; other roles use own/enrolled/related scope where the backend supports it. +- Dashboard is a monochrome, role-aware, read-only status board: workspace portal cards (`Title | count` on desktop) + needs-attention / upcoming lists. No create CTAs, no vanity charts, no duplicate KPI strip. Admin sees global course/exam scope; other roles use own/enrolled/related scope where the backend supports it. - Table and card actions use narrow centered three-dot menus through `TableRowActions`. - Dense tables have subtle column separators, fixed action columns, and stable date/number alignment. - Course creator display uses a username/display label when available; raw ids are fallback only. @@ -77,7 +77,8 @@ validation, and list filtering cleanup. - Session delete uses ConfirmDialog; exam room guards stale id on route change. - Mobile bottom tab bar (home/courses/exams/notes/menu); exam-room hides tab chrome. - Shared ErrorAlert with try-again; lookup pages show person labels; profile shows localized role. -- Manager/admin dashboard portal includes daily tools + management cards; compact guide CTA on dashboard (guide stays in account menu). +- Dashboard portal cards are role-ordered workspace links (manager/admin include management tools); guide stays in the account menu, not on the homepage. +- Dashboard layout: portal grid on top; attention + upcoming below (two columns from `lg`); grayscale cards with semantic status only. - Terms page: SidePanel create/edit + dense table row actions; header create buttons use shared min-width/radius. - Settings: dirty-state save gate and auto-clearing success message. - Nested breadcrumbs on exam room and live monitor. diff --git a/docs/navigation-patterns.md b/docs/navigation-patterns.md index 11c6609..f8e677f 100644 --- a/docs/navigation-patterns.md +++ b/docs/navigation-patterns.md @@ -5,7 +5,27 @@ Use one of two patterns for every new interaction: - Full page: resources with a durable detail view, such as a course, exam, event, user, exam room, or live monitor. Full pages must include breadcrumbs when nested. - Side panel: short contained work that should return the user to the same list context, such as create, quick edit, and filters. -Dashboard pages are observation-only. They must not contain create, edit, delete, or other mutation actions. A richer dashboard is allowed, but every section must remain informational and role-scoped. +## Dashboard (homepage) + +Dashboard pages are **observation-only**. They must not contain create, edit, +delete, or other mutation actions. Links may navigate to list/detail routes; +they must not open create/edit panels from the homepage. + +Structure (see `docs/ui-redesign-tokens.md` → Dashboard and +`src/pages/dashboard-page.tsx`): + +1. Compact header (greeting, neutral role chip, date). +2. Role-scoped workspace portal cards (section navigation + optional counts). +3. Needs attention + Upcoming lists (side by side on large screens). + +Rules: + +- Monochrome/grayscale chrome; semantic color only for status badges. +- Portal cards: horizontal dense row; desktop title and count as `Title | N`. +- No redundant KPI strip under cards, no activity charts, no guide/marketing CTA blocks on the homepage. +- Card set is role-scoped and must stay aligned with nav/`docs/role-scope-matrix.md` + (e.g. personal `/work` for teacher–manager only; admin uses staff-work + users). +- Attention items are time-sensitive exams/events only; empty states are informational text. Role scope rules: diff --git a/docs/role-scope-matrix.md b/docs/role-scope-matrix.md index 19ffcc8..8f40b19 100644 --- a/docs/role-scope-matrix.md +++ b/docs/role-scope-matrix.md @@ -115,4 +115,4 @@ - ✅ = access granted - ❌ = access denied - ❌ (FE) = hidden by the frontend only — the backend permits the underlying own-data read; never treat as a security boundary -- (badge) = visual indicator showing minimum role requirement on dashboard cards +- (badge) = optional neutral min-role chip on dashboard portal cards (muted border; not a colored accent) diff --git a/docs/ui-redesign-tokens.md b/docs/ui-redesign-tokens.md index 7e9bffc..43795bf 100644 --- a/docs/ui-redesign-tokens.md +++ b/docs/ui-redesign-tokens.md @@ -2,8 +2,10 @@ ## Direction -Dense school admin UI: Fintables-style tables, Cloudflare-style grouped sidebar, -neutral surfaces, subtle borders, one blue accent. +Dense school admin UI: Fintables-style tables, Cloudflare-style grouped sidebar +and status boards, neutral surfaces, subtle borders, one blue accent for +interactive chrome only. Dashboard and overview surfaces stay grayscale; color +is reserved for semantic status (success / warning / danger / info). ## Color @@ -79,6 +81,47 @@ Implemented: - mono IDs and tabular metrics - neutral surfaces, subtle borders, no gradients or decorative cards +## Dashboard (homepage) + +Reference implementation: `src/pages/dashboard-page.tsx`. + +### Intent + +- Observation / navigation board, not a mutation surface. +- Cloudflare-style density: quiet borders, flat cards, mono counts, no vanity decoration. + +### Structure + +1. Header — greeting, neutral role chip, date. +2. Workspace portal cards — role-scoped section links. +3. Needs attention + Upcoming — two columns from `lg`, stacked on small screens. + +### Portal card anatomy + +```text +┌──────────────────────────────────────────────┐ +│ [icon] Courses | 12 │ +│ Browse courses and class materials. │ +└──────────────────────────────────────────────┘ +``` + +- Horizontal row: left icon box (muted border, no tinted fill), middle title + one-line description, count on the **same line as the title**. +- Desktop title/count separator: literal `|` in muted border color (`Title | 12`). Count uses `.mono` / tabular nums. +- No colored top bars, no per-card accent tints, no large stacked KPI under the description. +- Do not add a second KPI strip that repeats the same course/exam/event counts. +- Grid: `grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4`, compact padding (`px-3 py-3` / `sm:px-4`), min height ~4.5–5rem. +- Optional min-role badge is neutral (border + muted), hidden on the smallest width if it crowds the row. + +### Attention / upcoming lists + +- Divided list inside one bordered card; row is a full-width link. +- Status uses semantic color only (dot + small badge): active (emerald), today (amber), soon (muted). +- Empty states are plain text — never “create exam/event” CTAs. + +### Out of scope for dashboard + +- Activity bar charts, multi-color portal accents, guide/marketing footers, create shortcuts, redundant summary KPI tiles under the portal grid. + ## Current Implementation Notes - Data-heavy admin and management views should prefer `DataToolbar`, `DataTableFrame`, and `.data-table`. @@ -91,6 +134,7 @@ Implemented: - User-facing tables should prefer usernames/display names over raw ids; show raw ids only as fallback or in explicit id columns. - Header actions use compact icon + label buttons with equal min-width; related sections should use matching badge labels and button sizing. - Attendance status UI uses shared metadata: localized label, short detail text, and semantic color classes. +- Homepage/dashboard follows the **Dashboard (homepage)** section above; keep list pages dense-table oriented, not dashboard-card oriented. Static wireframe: