From d3096cec59291a9c219324c65f760ee9bd547985 Mon Sep 17 00:00:00 2001 From: ngqile Date: Tue, 1 Dec 2026 22:18:30 +0800 Subject: [PATCH] docs: design and OpenSpec change for visitor pages and shell refinements Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01EFUzfj5akPxyikzGc2iAHM --- .../2026-12-01-visual-followup-design.md | 49 +++++++++++++++ .../.openspec.yaml | 2 + .../refine-visitor-pages-and-shell/design.md | 27 +++++++++ .../proposal.md | 29 +++++++++ .../specs/admin-visual-design/spec.md | 60 +++++++++++++++++++ .../refine-visitor-pages-and-shell/tasks.md | 48 +++++++++++++++ 6 files changed, 215 insertions(+) create mode 100644 docs/superpowers/specs/2026-12-01-visual-followup-design.md create mode 100644 openspec/changes/refine-visitor-pages-and-shell/.openspec.yaml create mode 100644 openspec/changes/refine-visitor-pages-and-shell/design.md create mode 100644 openspec/changes/refine-visitor-pages-and-shell/proposal.md create mode 100644 openspec/changes/refine-visitor-pages-and-shell/specs/admin-visual-design/spec.md create mode 100644 openspec/changes/refine-visitor-pages-and-shell/tasks.md diff --git a/docs/superpowers/specs/2026-12-01-visual-followup-design.md b/docs/superpowers/specs/2026-12-01-visual-followup-design.md new file mode 100644 index 0000000..90ca6fa --- /dev/null +++ b/docs/superpowers/specs/2026-12-01-visual-followup-design.md @@ -0,0 +1,49 @@ +# Visual follow-up: visitor pages, My QR, login and shell fixes + +Date: 2026-12-01. Follows `2026-12-01-visual-foundation-design.md` (merged), on the same tokens and DESIGN.md. + +## Intent + +Visitors judge INS and CV by the page they get when they scan a QR at the booth. Today that page is a plain stack of inputs with a long consent text and the company name only as small grey text. Staff see small leftovers in the shell from the first visual change. Finish the revamp before go-live (2027-01-15) so every screen a visitor or staff member sees matches the new look. + +## Decisions + +- **Neutral look (owner, 2026-12-01).** Visitor pages use Co-Lite's tokens with the company name prominent. No per-company logo or colour. Per-company branding is a later change if INS or CV ask for it. +- **One way to build it (my call).** Restyle with the existing tokens and components. No new dependencies, no backend change, no copy change except the labels listed below. + +## Scope + +1. **Visitor pages `/r`, `/i`, `/c` (shared `RegistrationForm` and the check-in lookup)** + - The page sits on the slate ground. The form is a white card (border, `shadow-card`), full width at 360 px and max-width `md` from `sm`. + - Event header at the top of the card: company name as a small uppercase label in the accent colour, then the event name (h1), then dates and location on their own lines with calendar and map-pin icons. The pipe-separated line goes. + - Fields keep their order and rules. Mobile gets the hint "Mobile or email is required" under the mobile field (new key in the default messages). + - The privacy notice stays fully shown in both languages, as the spec requires. It becomes fine print: `text-xs`, muted foreground (contrast already tested ≥ 4.5), on a muted panel, with the language headings as small labels. + - The consent row aligns the checkbox to the first line of text and gets normal line height. + - The states (loading, inactive, too many, not yet, ended, thank you, welcome, checked in) render in the same card, with an icon (check, clock, alert) and a clear heading. The "register another person" button stays. + - Footer: "Powered by Containerverse Sdn. Bhd." small and muted under the card, the same component as the admin shell. +2. **My QR codes.** Each code is a card: event name as the card title, dates and location under it, the QR, then the buttons in one row that wraps on phones. "Switched off" stays as the warning badge in the card header. +3. **Login and reset password.** They already use the new look. Remove the stale comments that describe the old brown and gold panel. Reset password gets the same two-column layout as login, so the two match. +4. **Header label.** The trail no longer repeats the page title. On a top-level page (`/events`) it shows nothing. On a sub-page (`/events/new`, an event's page) it shows the parent as a link back ("Events"). +5. **Tables on phones.** When a table is wider than the screen, a soft fade on the right edge shows there is more to scroll. Pure CSS (background-attachment scroll shadows) on the shared table container, so every table gets it. The fade goes away at the end of the scroll. +6. **Sidebar groups.** The flat list of 11 items gets one quiet divider with a small muted label "Administration" before Users, Roles, Emails, Login security, Audit log and Companies. Work items (Dashboard, Events, Event leads, Interests, Leads) stay above. The collapsed rail shows the divider without the label. The grouping is a fixed list of module names in the portal, since the menu tree from the server is flat. + +## Non-goals + +- Per-company logo or colour, or any change to Companies. +- New fields, flows or copy on the visitor pages beyond the hint above. +- Any change to how the visitor pages follow the light or dark theme. They keep today's behaviour. + +## Anti-goals + +- Hiding or shortening the privacy notice. It must stay readable in both languages. +- Anything that slows the visitor form on a phone (no new fonts, images or libraries). + +## Verification + +- Vitest, typecheck and lint, with the exit-code check. +- Playwright at 1280 and 360 px: `/r`, `/i` and `/c` in each state, My QR, login, reset password, `/events` and `/events/new` header, a wide table at 360 px, and the sidebar in full and rail mode. +- The token and contrast tests stay green. + +## Left to the builder + +Icon choice within lucide, exact spacing, and the fade width. diff --git a/openspec/changes/refine-visitor-pages-and-shell/.openspec.yaml b/openspec/changes/refine-visitor-pages-and-shell/.openspec.yaml new file mode 100644 index 0000000..785b150 --- /dev/null +++ b/openspec/changes/refine-visitor-pages-and-shell/.openspec.yaml @@ -0,0 +1,2 @@ +schema: spec-driven +created: 2026-12-01 diff --git a/openspec/changes/refine-visitor-pages-and-shell/design.md b/openspec/changes/refine-visitor-pages-and-shell/design.md new file mode 100644 index 0000000..6e82394 --- /dev/null +++ b/openspec/changes/refine-visitor-pages-and-shell/design.md @@ -0,0 +1,27 @@ +## Context + +The product design is in `docs/superpowers/specs/2026-12-01-visual-followup-design.md`. It builds on the tokens, components and DESIGN.md from `add-visual-foundation`. The owner chose the neutral look. + +## Goals / Non-Goals + +**Goals:** a visitor-page card layout, My QR cards, reset password matching login, the header trail, the table scroll cue and the sidebar sections. + +**Non-Goals:** per-company branding, backend changes, new dependencies, changing the theme behaviour of the visitor pages. + +## Decisions + +- **One shared visitor card.** Add a `VisitorCard` in `app/components/registration/` that renders the ground, the card, the event header and the footer. `/r`, `/i` and `/c` wrap every state in it. `RegistrationForm` drops its own header and takes the card's. The states render a small `VisitorState` (icon, heading, optional text, optional action) inside the card. Alternative rejected: styling each page separately, which would let the three pages drift. +- **Fine-print notice.** Keep the `whitespace-pre-line` text and set it as `text-xs text-muted-foreground` on `bg-muted`. The muted foreground is already contrast-tested at ≥ 4.5 on card and muted. +- **Scroll cue in CSS.** Use the background-attachment `local` versus `scroll` gradient technique on the `table-container` in `ui/table.tsx`, with colours from `--card`, as a utility in `globals.css`. It needs no JavaScript and no resize observers. Sticky header cells keep their opaque background. +- **Trail.** In `Breadcrumbs`, return nothing when the pathname equals the leaf's own URL. Otherwise render the leaf as a link (the parent of the current sub-page), as it does now. +- **Sidebar sections.** Keep a fixed `ADMIN_MODULES` list of module names (`BO_USERS`, `BO_ROLES`, `BO_EMAILS`, `BO_LOGIN_SECURITY`, `BO_AUDIT_LOG`, `BO_COMPANIES`; Companies is added by `useAclSidebar` for super admins, the rest come from the menu tree) in `aclSidebar.ts`. Split the top-level links into work and admin lists when rendering. The server menu tree is flat, so the grouping lives in the portal. A module not in the list stays with the work items. +- **Reset password** reuses the login page's two-column frame. Extract it to a small `AuthFrame` only if both pages need the same markup; otherwise copy the wrapper classes. + +## Risks / Trade-offs + +- The fixed admin-module list goes stale when a new admin module is added. It then falls into the work section, which is visible and harmless. Mark it with a `ponytail:` comment. +- The CSS scroll shadows need opaque table cells, or the fade draws under them. Row hover uses a token background, so check it at 360 px. + +## Migration Plan + +Portal deploy only. Roll back by redeploying the previous portal image. diff --git a/openspec/changes/refine-visitor-pages-and-shell/proposal.md b/openspec/changes/refine-visitor-pages-and-shell/proposal.md new file mode 100644 index 0000000..a1ea77f --- /dev/null +++ b/openspec/changes/refine-visitor-pages-and-shell/proposal.md @@ -0,0 +1,29 @@ +## Why + +Visitors judge INS and CV by the page they get when they scan a booth QR. Today that page is a plain stack of inputs with a long consent text, and the company name appears only as small grey text. Staff still see leftovers in the shell from `add-visual-foundation`: the header label repeats the page title, phone tables cut off with no scroll cue, and the sidebar is one flat list of 11 items. This change finishes the revamp before go-live. + +## What Changes + +- The visitor pages `/r`, `/i` and `/c` get a card layout with an event header (company label, event name, dates and location). The privacy notice becomes fine print and stays complete in both languages. The states get an icon and a heading. A "Mobile or email is required" hint is added. +- My QR codes shows each code as a card. +- Reset password matches the login layout. The stale login comments go. +- The header trail stops repeating the page title. On a sub-page it shows the parent as a link back. +- Wide tables show a fade on the edge that can still scroll. +- The sidebar gets an "Administration" divider before the admin items. +- The look is neutral: Co-Lite tokens, with no per-company logo or colour (owner decision, 2026-12-01). + +## Capabilities + +### New Capabilities + +None. + +### Modified Capabilities + +- `admin-visual-design`: adds requirements for the visitor page look, the header trail, the table scroll cue and the sidebar sections. + +## Impact + +- Portal only (`solvway-admin-portal`): `RegistrationForm`, the `/r`, `/i` and `/c` pages, `my-qr`, `reset-password`, `login` (comments only), `Breadcrumbs`, the `ui/table` container, `Sidebar`, `globals.css`, and the i18n messages (one new key). +- No backend, API, SQL or dependency change. +- Product design: `docs/superpowers/specs/2026-12-01-visual-followup-design.md`. diff --git a/openspec/changes/refine-visitor-pages-and-shell/specs/admin-visual-design/spec.md b/openspec/changes/refine-visitor-pages-and-shell/specs/admin-visual-design/spec.md new file mode 100644 index 0000000..09931da --- /dev/null +++ b/openspec/changes/refine-visitor-pages-and-shell/specs/admin-visual-design/spec.md @@ -0,0 +1,60 @@ +## ADDED Requirements + +### Requirement: Visitor Page Look + +The public visitor pages (registration, invitation and check-in) SHALL show their content in one card on the page ground. The card SHALL be headed by the company name as a small label, the event name as the main heading, and the event dates and location. The pages SHALL use only the portal's theme tokens and SHALL NOT show a per-company logo or colour. The privacy notice SHALL be shown in full in English and Bahasa Malaysia as smaller, muted text that keeps at least 4.5:1 contrast. + +#### Scenario: Visitor opens a registration code + +- **WHEN** a visitor opens the registration page of an INS event +- **THEN** the card shows "INS" as a label above the event name, then the event dates and location +- **AND** the full privacy notice appears in both languages above the consent box + +#### Scenario: Visitor needs a contact + +- **WHEN** a visitor sees the mobile field on the registration form +- **THEN** a hint under it says that a mobile number or an email is required + +#### Scenario: Visitor reaches an end state + +- **WHEN** a visitor's registration is accepted, or the code is inactive, or check-in has not opened yet +- **THEN** the same card shows an icon and a heading for that state + +### Requirement: Header Trail Without Repeats + +The admin header SHALL NOT repeat the page title. On a page reached directly from the sidebar it SHALL show no trail. On a page below one, it SHALL show the parent page as a link back. + +#### Scenario: Top-level page + +- **WHEN** an admin opens the Events list +- **THEN** the header shows no trail text + +#### Scenario: Sub-page + +- **WHEN** an admin opens the new event page +- **THEN** the header shows "Events" as a link to the Events list + +### Requirement: Table Scroll Cue + +A table wider than its container SHALL show a fade on each edge where more columns can be scrolled into view. The fade SHALL disappear at that end of the scroll. + +#### Scenario: Users list on a phone + +- **WHEN** an admin opens the Users list at 360 px wide +- **THEN** a fade shows on the right edge of the table +- **AND** after scrolling to the last column the right fade is gone + +### Requirement: Sidebar Sections + +The sidebar SHALL list the work pages first, then an "Administration" section for Users, Roles, Emails, Login security, Audit log and Companies. The section SHALL be marked by a divider and a small muted label, and only the divider SHALL show in the collapsed rail. A section with no item the admin may open SHALL NOT show. + +#### Scenario: Super admin sidebar + +- **WHEN** a super admin opens the portal +- **THEN** Dashboard, Events, Event leads, Interests and Leads are listed above the "Administration" label +- **AND** Users, Roles, Emails, Login security, Audit log and Companies are listed below it + +#### Scenario: Staff without admin pages + +- **WHEN** a staff user who can open only Events and Event leads opens the portal +- **THEN** the sidebar shows no "Administration" label diff --git a/openspec/changes/refine-visitor-pages-and-shell/tasks.md b/openspec/changes/refine-visitor-pages-and-shell/tasks.md new file mode 100644 index 0000000..7f8063d --- /dev/null +++ b/openspec/changes/refine-visitor-pages-and-shell/tasks.md @@ -0,0 +1,48 @@ +# Tasks: refine-visitor-pages-and-shell + +Design: `design.md` and `docs/superpowers/specs/2026-12-01-visual-followup-design.md`. Portal only. Every task is TDD, followed by the review gate. Tasks run serially in this order, because several of them touch `globals.css` and the i18n messages. + +Verify for every task: `cd solvway-admin-portal && npx vitest run; echo VITEST=$? && npx tsc --noEmit && npm run lint`. Check the vitest exit code: an unhandled error fails the run even when every test passes. + +## 1. Shell + +- [ ] 1.1 Header trail without repeats: `Breadcrumbs` shows nothing on a page whose URL is the matched leaf's own URL, and shows the leaf as a link on a sub-page. + - Depends on: none + - Scope: `solvway-admin-portal/app/components/app/Breadcrumbs*` +- [ ] 1.2 Sidebar sections: an `ADMIN_MODULES` list in `aclSidebar.ts`, the work and Administration split in `Sidebar` (full sidebar and drawer: divider and label; rail: divider only; no section when it has no items), and the "Administration" label in `defaultMessages.ts`. + - Depends on: 1.1 + - Scope: `solvway-admin-portal/app/lib/aclSidebar*`, `solvway-admin-portal/app/components/app/Sidebar*`, `solvway-admin-portal/app/lib/i18n/defaultMessages.ts` +- [ ] 1.3 Table scroll cue: a scroll-shadow utility in `globals.css` applied to the `table-container`, with colours from tokens only (the design-tokens test stays green). + - Depends on: 1.2 + - Scope: `solvway-admin-portal/app/components/ui/table*`, `solvway-admin-portal/app/globals.css`, `solvway-admin-portal/app/globals.test.ts` + +## 2. Visitor pages + +- [ ] 2.1 `VisitorCard` (ground, card, event header with the company label, the dates and location with icons, footer) and `VisitorState` (icon, heading, text, action). `RegistrationForm` drops its header, adds the "Mobile or email is required" hint (new key in `defaultMessages.ts`), sets the notice as fine print, and aligns the consent row. + - Depends on: 1.3 + - Scope: `solvway-admin-portal/app/components/registration/**` except `QrCodeItem*`, `solvway-admin-portal/app/lib/i18n/defaultMessages.ts` +- [ ] 2.2 `/r`, `/i` and `/c` render every state inside `VisitorCard`, with `VisitorState` for loading, inactive, error, too many, not yet, ended, thank you, welcome and checked in. Existing behaviour and text stay the same. + - Depends on: 2.1 + - Scope: `solvway-admin-portal/app/r/**`, `solvway-admin-portal/app/i/**`, `solvway-admin-portal/app/c/**` + +## 3. Staff screens + +- [ ] 3.1 My QR codes as cards: the event name as the title, dates and location, the switched-off badge in the card header, the QR and a wrapping button row. + - Depends on: 2.2 + - Scope: `solvway-admin-portal/app/my-qr/**`, `solvway-admin-portal/app/components/registration/QrCodeItem*` +- [ ] 3.2 Reset password uses the login page's two-column frame. Remove the stale brown and gold comments in login. + - Depends on: 3.1 + - Scope: `solvway-admin-portal/app/reset-password/**`, `solvway-admin-portal/app/login/**` + +## 4. Release check + +- [ ] 4.1 Playwright at 1280 and 360 px: + - `/r`, `/i` and `/c` in each reachable state; + - My QR, using a throwaway staff user that is reverted afterwards; + - login and reset password; + - the `/events` and `/events/new` header; + - the Users table at 360 px, before and after scrolling; + - the sidebar, full and rail. + + Run the full portal verify. Record the result here. + - Depends on: 3.2