docs: visual foundation design and OpenSpec change
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01EFUzfj5akPxyikzGc2iAHM
This commit is contained in:
1 parent
92a90d5f48
commit
2a78ef0a79
7 files changed
+203
No files matched your search
@@ -0,0 +1,2 @@
|
||||
schema: spec-driven
|
||||
created: 2026-12-01
|
||||
@@ -0,0 +1,23 @@
|
||||
## Context
|
||||
|
||||
The portal is a Next.js app with shadcn-style components. Every colour already comes from CSS custom properties in `app/globals.css` (enforced by `app/design-tokens.test.ts`), so the look is mostly token values. The current tokens, fonts (Inter plus DM Sans headings) and 1rem radius came from the babyboo portal. Full design: `docs/superpowers/specs/2026-12-01-visual-foundation-design.md`.
|
||||
|
||||
## Goals / Non-Goals
|
||||
|
||||
**Goals:** replace the token values, fonts, radius and shadow; fix the shell and the wordmark; turn every native select into the shared Radix select.
|
||||
|
||||
**Non-Goals:** booth screen, visitor pages, login (follow-up change); per-company accent; new components or dependencies.
|
||||
|
||||
## Decisions
|
||||
|
||||
1. **Token values, not class rewrites.** Change `:root` and `.dark` values in `globals.css`: background white, foreground #0F172A, muted foreground #64748B, muted/secondary #F1F5F9, border #E2E8F0, primary and ring #2563EB, destructive red, plus success and warning tokens if missing. `--radius` becomes 0.5rem (cards 8px, controls 6px).
|
||||
2. **Inter only.** Drop the DM Sans font file and variable from `layout.tsx`; `--font-heading` points at Inter. The test that expects DM Sans on `<html>` is re-targeted to "only Inter" (requirement One Type Family).
|
||||
3. **Wordmark.** Remove `.brand-gradient-text` and its use; the sidebar shows a blue square mark plus solid "Co-Lite".
|
||||
4. **Selects.** Use the existing `app/components/ui/select.tsx`. Radix Select does not accept an empty string as a value, so "All companies" uses a sentinel value mapped back to `undefined`. Tests that used `selectOptions` on native selects open the menu and click the option instead (requirement Styled Dropdown Menus).
|
||||
5. **Dark theme.** Keep the existing `.dark` mechanism; re-derive its values from slate-900/800 surfaces and a lighter blue (#3B82F6) accent.
|
||||
|
||||
## Risks / Trade-offs
|
||||
|
||||
- [Re-targeted tests could hide a regression] → each changed test maps to a scenario in the new spec; the reviewer checks no assertion is weakened.
|
||||
- [Radix Select in jsdom] → the existing `select.test.tsx` already drives it; reuse its helpers.
|
||||
- [Screens look half-done until booth and visitor pages follow] → those pages are public or phone-only and are next in line.
|
||||
@@ -0,0 +1,27 @@
|
||||
## Why
|
||||
|
||||
The admin portal still wears the inherited babyboo look (brown primary, DM Sans headings, 16px corners, gradient wordmark, unstyled native select menus). The owner chose a replacement direction on 2026-12-01: the category-standard SaaS admin, done well. The invitations screens wait on this foundation.
|
||||
|
||||
## What Changes
|
||||
|
||||
- New look across the admin portal: white and slate with one blue accent, Inter only, 8px cards and 6px controls, one soft card shadow.
|
||||
- Dark theme re-derived from the same scale; light stays the default.
|
||||
- The wordmark becomes a solid "Co-Lite" with a small mark; no gradient text.
|
||||
- Every dropdown in the admin portal opens a styled option menu instead of the browser's native list (company picker, event form, user form, company status, event-lead forms).
|
||||
- Booth, visitor and login pages are out of scope (follow-up change).
|
||||
|
||||
## Capabilities
|
||||
|
||||
### New Capabilities
|
||||
|
||||
- `admin-visual-design`: the admin portal's theme rules: colours from theme tokens only, one accent colour, one type family, light default with a dark theme, the product wordmark, and styled dropdown menus.
|
||||
|
||||
### Modified Capabilities
|
||||
|
||||
None.
|
||||
|
||||
## Impact
|
||||
|
||||
- `solvway-admin-portal`: `app/globals.css`, `tailwind.config.ts`, `app/layout.tsx` (fonts), `app/components/app/*` (shell, company picker), `app/components/ui/*` where tokens are not enough, and the five other files with native selects.
|
||||
- Existing tests that pin the old font or drive native selects are re-targeted to the new requirements.
|
||||
- No backend, API or data changes.
|
||||
@@ -0,0 +1,75 @@
|
||||
## ADDED Requirements
|
||||
|
||||
### Requirement: Admin Colours Come From Theme Tokens
|
||||
|
||||
The admin portal SHALL take every colour from the theme tokens. A component MUST NOT use a fixed palette colour, except a modal scrim, a print-only sheet, a QR code's quiet zone, or a frame showing email HTML.
|
||||
|
||||
#### Scenario: A component uses a palette colour
|
||||
|
||||
- **WHEN** a component's classes include a fixed palette colour that is not on the exception list
|
||||
- **THEN** the portal's checks fail
|
||||
|
||||
### Requirement: One Accent Colour
|
||||
|
||||
The admin portal SHALL use slate neutrals for text, surfaces and borders, and one blue accent for primary actions, links, focus rings and the active navigation item. Status colours (success, warning, danger) SHALL appear only where they carry meaning.
|
||||
|
||||
#### Scenario: Primary action
|
||||
|
||||
- **WHEN** a page shows a primary button
|
||||
- **THEN** the button uses the accent colour and the other buttons on the page do not
|
||||
|
||||
#### Scenario: Active navigation item
|
||||
|
||||
- **WHEN** an admin is on the Events page
|
||||
- **THEN** the Events item in the sidebar is marked in the accent colour and no other item is
|
||||
|
||||
### Requirement: One Type Family
|
||||
|
||||
The admin portal SHALL set all text, headings included, in one sans-serif family, with tabular figures for numbers in tables and counts.
|
||||
|
||||
#### Scenario: Fonts loaded
|
||||
|
||||
- **WHEN** any admin page loads
|
||||
- **THEN** only the one family's font file is loaded
|
||||
|
||||
### Requirement: Light Default With A Dark Theme
|
||||
|
||||
The admin portal SHALL show the light theme by default and SHALL offer a dark theme derived from the same neutrals and accent.
|
||||
|
||||
#### Scenario: First visit
|
||||
|
||||
- **WHEN** an admin opens the portal with no theme preference saved
|
||||
- **THEN** the light theme is shown
|
||||
|
||||
#### Scenario: Dark theme chosen
|
||||
|
||||
- **WHEN** an admin switches to the dark theme
|
||||
- **THEN** every page uses the dark tokens and text keeps at least 4.5:1 contrast
|
||||
|
||||
### Requirement: Product Wordmark
|
||||
|
||||
The admin portal SHALL show the product name "Co-Lite" as solid text beside a small mark, and SHALL keep "Powered by Containerverse Sdn. Bhd." in the footer.
|
||||
|
||||
#### Scenario: Sidebar header
|
||||
|
||||
- **WHEN** an admin page loads
|
||||
- **THEN** the sidebar shows the mark and the text "Co-Lite" in a solid colour, not gradient-filled text
|
||||
|
||||
### Requirement: Styled Dropdown Menus
|
||||
|
||||
Every dropdown in the admin portal SHALL open a styled option menu that matches the portal's theme, and SHALL stay usable by keyboard and screen reader.
|
||||
|
||||
#### Scenario: Company picker
|
||||
|
||||
- **WHEN** a super admin opens the company picker in the header
|
||||
- **THEN** a styled menu lists "All companies" and each company code, and choosing one scopes the pages to that company
|
||||
|
||||
#### Scenario: Form dropdown
|
||||
|
||||
- **WHEN** an admin opens the salesperson, temperature or status dropdown on an event lead
|
||||
- **THEN** a styled menu opens, and the chosen value is saved with the form as before
|
||||
|
||||
#### Scenario: Keyboard use
|
||||
|
||||
- **WHEN** an admin focuses a dropdown and presses Enter or Space, then the arrow keys and Enter
|
||||
- **THEN** the menu opens, moves between options, and chooses one
|
||||
@@ -0,0 +1,34 @@
|
||||
# Tasks
|
||||
|
||||
Serial. One implementer at a time, Opus review gate per task.
|
||||
|
||||
## 1. Theme
|
||||
|
||||
- [ ] 1.1 Token values (light and dark), radius 0.5rem, one soft card shadow, Inter only (drop DM Sans), remove the gradient wordmark class.
|
||||
- Depends on: none
|
||||
- Tests first: `<html>` carries only the Inter font variable; `globals.css` has no DM Sans and no `brand-gradient-text`; `--primary` is the blue accent in light and dark.
|
||||
- Scope: `solvway-admin-portal/app/globals.css`, `solvway-admin-portal/app/layout.tsx`, `solvway-admin-portal/app/layout.test.tsx`, `solvway-admin-portal/app/globals.test.ts`, `solvway-admin-portal/app/fonts/**`, `solvway-admin-portal/tailwind.config.ts`
|
||||
- Verify: `cd solvway-admin-portal && npm run lint; echo L=$?; npx tsc --noEmit; echo T=$?; npx vitest run; echo V=$?`
|
||||
|
||||
## 2. Shell
|
||||
|
||||
- [ ] 2.1 Sidebar wordmark (mark plus solid "Co-Lite"), active item in the accent, header and page header spacing to the reference sketch; company picker becomes the styled select.
|
||||
- Depends on: 1.1
|
||||
- Tests first: sidebar shows "Co-Lite" with no gradient class; only the current nav item is marked active; the company picker opens a menu with "All companies" and each code, and choosing one sets the scope.
|
||||
- Scope: `solvway-admin-portal/app/components/app/**`, `solvway-admin-portal/app/components/ui/**`, `solvway-admin-portal/app/lib/CompanyScope*.tsx`
|
||||
- Verify: as 1.1
|
||||
|
||||
## 3. Form dropdowns
|
||||
|
||||
- [ ] 3.1 Replace the native selects in the event form, user form, company status, and the new and edit event-lead pages with the styled select; values save as before.
|
||||
- Depends on: 2.1
|
||||
- Tests first: each dropdown opens a menu, choosing an option sends that value on save; keyboard opens and chooses.
|
||||
- Scope: `solvway-admin-portal/app/components/events/**`, `solvway-admin-portal/app/components/users/**`, `solvway-admin-portal/app/companies/**`, `solvway-admin-portal/app/event-leads/**`, `solvway-admin-portal/app/companyScope.forms.test.tsx`
|
||||
- Verify: as 1.1
|
||||
|
||||
## 4. Check and record
|
||||
|
||||
- [ ] 4.1 Playwright at 1280 and 360 px, light and dark: dashboard, events list, event edit, event leads, a user form, companies; screenshots in the PR. Then the impeccable finish review and DESIGN.md from the built result.
|
||||
- Depends on: 3.1
|
||||
- Scope: `solvway-admin-portal/DESIGN.md`, `openspec/changes/add-visual-foundation/tasks.md`
|
||||
- Verify: as 1.1
|
||||
Reference in new issue
Block a user