Replace Flux UI with TallStackUI 4
Rewrite the layout and all Customers and Users pages with TallStackUI components and remove livewire/flux and its Boost skill. Fix the TallStackUI accessibility gaps found by the axe tests: - password reveal and theme switch have no accessible name: add <x-password-field> and keep the own theme toggle button - select.native label is not tied to the control: add aria-label - contrast: darker primary palette, soft-customized error colours and published alert/link colour classes; neutral buttons use subtle black - follow the system theme by default (localStorage key dark-theme) Load TallStackUI assets from the app URL so they work in the XAMPP subfolder, add Finnish TallStackUI strings, and drop inputmode=numeric from the business ID field so iOS keyboards show the hyphen. Co-Authored-By: Claude Opus 5.5 <[email protected]>
This commit is contained in:
@@ -4,7 +4,7 @@ This file provides guidance to Claude Code (claude.ai/code) when working with co
|
||||
|
||||
## Project
|
||||
|
||||
An ERP / work-management system (*toiminnanohjausjärjestelmä*) for a small (5–10 person) Finnish media/marketing company. Stack: Laravel 13, Livewire 4 (single-file components), Flux UI 2 free edition, Tailwind 4, Vite 8, Pest, Larastan. Domain code lives in modules under `app/Modules` (so far `Shared`, `Users` and `Customers`); `/` is still a temporary Livewire demo page behind login (`resources/views/pages/⚡home.blade.php`, layout `resources/views/layouts/app.blade.php`, which has the main menu and logout for signed-in users).
|
||||
An ERP / work-management system (*toiminnanohjausjärjestelmä*) for a small (5–10 person) Finnish media/marketing company. Stack: Laravel 13, Livewire 4 (single-file components), TallStackUI 4 (Blade components, no prefix: `<x-input>`, `<x-button>`), Tailwind 4, Vite 8, Pest, Larastan. Domain code lives in modules under `app/Modules` (so far `Shared`, `Users` and `Customers`); `/` is still a temporary Livewire demo page behind login (`resources/views/pages/⚡home.blade.php`, layout `resources/views/layouts/app.blade.php`, which has the main menu and logout for signed-in users).
|
||||
|
||||
- **The specification is `määrittely.txt`** (Finnish). It defines users/roles, customer jobs (*asiakastyö*) and their fields and enums, time tracking, expenses, Kanban tasks, the service unit → service → work task hierarchy, and billing-material export. It ends with Claude's open questions and a proposed phased plan. Read it before designing any domain feature.
|
||||
- **Language rule:** code (identifiers, tables, columns, enum keys) is in English; the specification and the UI are in Finnish. Keep UI strings in translation files from the start.
|
||||
@@ -32,14 +32,21 @@ Read `docs/architecture.md` (Finnish) before adding or changing domain code. `ap
|
||||
|
||||
Accessibility is a contractual acceptance criterion. It covers the whole UI: navigation, forms, tables, reports, notifications, dialogs, login, and every business process. Every new or changed view must meet these rules:
|
||||
|
||||
- Use Flux components first; they ship with correct roles, focus handling and keyboard support. Every form control goes in `flux:field` with a `flux:label` and a `flux:error` (or uses the shorthand `label` prop). Placeholder text is not a label.
|
||||
- **UI components are TallStackUI.** Read the component's page in `vendor/tallstackui/tallstackui/.ai/components/` (index: `.ai/index.md`) before writing a tag; never guess props. Every form control has a visible `label` prop; TallStackUI shows the `wire:model` validation error under it. Placeholder text is not a label. Submit buttons use the `submit` prop, never `type="submit"`.
|
||||
- **TallStackUI accessibility gaps and the project fixes** (keep them; the axe tests catch regressions):
|
||||
- `<x-password>`: its reveal button has no name. Use `<x-password-field>` (`resources/views/components/password-field.blade.php`).
|
||||
- `<x-theme-switch>`: unnamed `role="switch"`. Use `resources/views/partials/theme-toggle.blade.php`, which drives `tallstackui_darkTheme({ default: 'system' })` on `<html>` (localStorage `dark-theme`; an inline script in the layout applies it before paint).
|
||||
- `<tallstackui:script />`: root-relative asset URLs that 404 in a subfolder (local XAMPP). The layout includes `resources/views/partials/tallstackui-script.blade.php` instead.
|
||||
- `<x-select.native>`: the label is not tied to the control, so also pass `:aria-label` with the same text.
|
||||
- Contrast: the primary palette is one step darker (`resources/css/app.css`); error text, label error and asterisk, and input/select error colours are changed by soft customization in `App\Providers\AppServiceProvider`; light alert and link text colours are in published colour classes `app/View/Components/TallStackUi/Colors/`. `flat` and `outline` buttons have no dark-mode text colour: use `subtle color="black"` for neutral buttons.
|
||||
- Finnish strings for TallStackUI's own components are in `lang/vendor/ts-ui/fi/messages.php`.
|
||||
- Never convey meaning by colour alone. Statuses, priorities (e.g. *kiire* = red), errors and warnings always also have visible text or an icon with text.
|
||||
- Announce dynamic changes: put status text in `role="status"` / `aria-live="polite"` (errors: `role="alert"`), or use Flux toast. Keep button names stable instead of putting changing state in them.
|
||||
- Make everything work with the keyboard alone, with a visible focus indicator and no focus traps. Use `flux:modal` for dialogs, so focus moves in and returns.
|
||||
- Announce dynamic changes: put status text in `role="status"` / `aria-live="polite"` (errors: `role="alert"`), or a TallStackUI toast (`<x-toast />` must then be added to the layout). Keep button names stable instead of putting changing state in them.
|
||||
- Make everything work with the keyboard alone, with a visible focus indicator and no focus traps. Use `<x-modal>` for dialogs and check that focus moves in and returns.
|
||||
- The layout (`resources/views/layouts/app.blade.php`) provides a skip link and a `<main id="main-content">` landmark. Keep them, and add `<nav aria-label="…">` for navigation.
|
||||
- One `h1` per page, logical heading order, and a descriptive page `#[Title]` on every page component.
|
||||
- Data tables use `flux:table` with column headers. Icon-only buttons need an accessible name (`aria-label` or Flux `tooltip`). Decorative images get `alt=""`.
|
||||
- Contrast is at least 4.5:1 for text and 3:1 for UI components and focus indicators, in both light and dark mode. Flux's default error text (red-500) fails this, so `resources/css/app.css` overrides `[data-flux-error]`. `flux:callout variant="warning"` also fails in light mode (2.8:1): use the default callout with a warning icon.
|
||||
- Data tables use `<x-table>` with `headers` (custom cells with `@interact('column_<index>', $row)`). Icon-only buttons need an `aria-label` (a `tooltip` alone is not a name). Decorative images get `alt=""`.
|
||||
- Contrast is at least 4.5:1 for text and 3:1 for UI components and focus indicators, in both light and dark mode.
|
||||
- Layouts must reflow at 320 px width and 400 % zoom without horizontal scrolling. Touch targets are at least 24×24 px.
|
||||
- Every new page gets a browser test in `tests/Browser` that uses `assertNoAccessibilityIssues(level: 2)` in light and dark mode and on desktop and mobile. See `tests/Browser/AccessibilityTest.php`. Automated axe checks catch only part of WCAG: also check new flows manually with the keyboard and a screen reader (NVDA).
|
||||
|
||||
|
||||
Reference in New Issue
Block a user