From 90d6f5bd666785b58f78d704234756b1c7271628 Mon Sep 17 00:00:00 2001 From: Petri Saarinen Date: Sun, 22 Nov 2026 12:22:03 +0200 Subject: [PATCH] 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 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 --- .agents/skills/fluxui-development/SKILL.md | 81 ------ .../infer-conventions/references/checklist.md | 2 - .claude/skills/fluxui-development/SKILL.md | 81 ------ .../infer-conventions/references/checklist.md | 2 - CLAUDE.md | 19 +- .../Presentation/Livewire/⚡form.blade.php | 32 +-- .../Presentation/Livewire/⚡index.blade.php | 71 ++--- .../Livewire/⚡forgot-password.blade.php | 12 +- .../Presentation/Livewire/⚡form.blade.php | 57 ++-- .../Presentation/Livewire/⚡index.blade.php | 86 +++--- .../Presentation/Livewire/⚡login.blade.php | 19 +- .../Livewire/⚡reset-password.blade.php | 18 +- app/Providers/AppServiceProvider.php | 37 ++- .../TallStackUi/Colors/AlertColors.php | 261 +++++++++++++++++ .../TallStackUi/Colors/LinkColors.php | 53 ++++ boost.json | 1 - composer.json | 4 +- composer.lock | 150 +++++----- docs/architecture.md | 4 +- lang/fi/auth.php | 1 + lang/fi/customers.php | 1 + lang/fi/users.php | 1 + lang/vendor/ts-ui/fi/messages.php | 263 ++++++++++++++++++ package-lock.json | 37 +++ package.json | 1 + resources/css/app.css | 28 +- .../views/components/password-field.blade.php | 34 +++ resources/views/layouts/app.blade.php | 50 ++-- resources/views/pages/⚡home.blade.php | 12 +- resources/views/partials/nav-item.blade.php | 15 + .../partials/tallstackui-script.blade.php | 11 + .../views/partials/theme-toggle.blade.php | 26 +- tests/Browser/ThemeToggleTest.php | 8 +- tests/Browser/UsersAccessibilityTest.php | 12 + tests/Feature/TallStackUiScriptTest.php | 12 + 35 files changed, 1054 insertions(+), 448 deletions(-) delete mode 100644 .agents/skills/fluxui-development/SKILL.md delete mode 100644 .claude/skills/fluxui-development/SKILL.md create mode 100644 app/View/Components/TallStackUi/Colors/AlertColors.php create mode 100644 app/View/Components/TallStackUi/Colors/LinkColors.php create mode 100644 lang/vendor/ts-ui/fi/messages.php create mode 100644 resources/views/components/password-field.blade.php create mode 100644 resources/views/partials/nav-item.blade.php create mode 100644 resources/views/partials/tallstackui-script.blade.php create mode 100644 tests/Feature/TallStackUiScriptTest.php diff --git a/.agents/skills/fluxui-development/SKILL.md b/.agents/skills/fluxui-development/SKILL.md deleted file mode 100644 index d690d44..0000000 --- a/.agents/skills/fluxui-development/SKILL.md +++ /dev/null @@ -1,81 +0,0 @@ ---- -name: fluxui-development -description: "Use this skill for Flux UI development in Livewire applications only. Trigger when working with components, building or customizing Livewire component UIs, creating forms, modals, tables, or other interactive elements. Covers: flux: components (buttons, inputs, modals, forms, tables, date-pickers, kanban, badges, tooltips, etc.), component composition, Tailwind CSS styling, Heroicons/Lucide icon integration, validation patterns, responsive design, and theming. Do not use for non-Livewire frameworks or non-component styling." -license: MIT -metadata: - author: laravel ---- - -# Flux UI development - -## Documentation - -Use `search-docs` for detailed Flux UI patterns and documentation. - -## Basic usage - -This project uses the free edition of Flux UI, which includes all free components and variants but not Pro components. - -Flux UI is a component library for Livewire built with Tailwind CSS. - -Use a Flux UI component when one exists. If no Flux component fits your needs, fall back to a standard Blade component. - - -```blade -Click me -``` - -## Available components (free edition) - -Available: avatar, badge, brand, breadcrumbs, button, callout, card, checkbox, dropdown, field, heading, icon, input, modal, navbar, otp-input, pagination, profile, progress, radio, select, separator, skeleton, switch, table, text, textarea, toast, tooltip - -## Icons - -Flux includes [Heroicons](https://heroicons.com/) as its default icon set. Look up exact icon names on the Heroicons site. Do not guess or invent icon names. - - -```blade -Export -``` - -For an icon that Heroicons lacks, use [Lucide](https://lucide.dev/). Import the icons you need with the Artisan command: - -```bash -php artisan flux:icon crown grip-vertical github -``` - -## Common patterns - -### Form fields - - -```blade - - Email - - - -``` - -### Modals - - -```blade - - Title -

Content

-
-``` - -## Verification - -1. Check that the component renders correctly -2. Test interactive states -3. Verify mobile responsiveness - -## Common pitfalls - -- Trying to use Pro-only components in the free edition -- Not checking whether a Flux component exists before building a custom one -- Forgetting to use the `search-docs` tool for component-specific documentation -- Not following the project's existing Flux patterns diff --git a/.agents/skills/infer-conventions/references/checklist.md b/.agents/skills/infer-conventions/references/checklist.md index c0ae08a..c48bc52 100644 --- a/.agents/skills/infer-conventions/references/checklist.md +++ b/.agents/skills/infer-conventions/references/checklist.md @@ -85,8 +85,6 @@ This app ships a frontend stack, so the items below apply. - Hint: `ls app/View/Components`. Grep ` components, building or customizing Livewire component UIs, creating forms, modals, tables, or other interactive elements. Covers: flux: components (buttons, inputs, modals, forms, tables, date-pickers, kanban, badges, tooltips, etc.), component composition, Tailwind CSS styling, Heroicons/Lucide icon integration, validation patterns, responsive design, and theming. Do not use for non-Livewire frameworks or non-component styling." -license: MIT -metadata: - author: laravel ---- - -# Flux UI development - -## Documentation - -Use `search-docs` for detailed Flux UI patterns and documentation. - -## Basic usage - -This project uses the free edition of Flux UI, which includes all free components and variants but not Pro components. - -Flux UI is a component library for Livewire built with Tailwind CSS. - -Use a Flux UI component when one exists. If no Flux component fits your needs, fall back to a standard Blade component. - - -```blade -Click me -``` - -## Available components (free edition) - -Available: avatar, badge, brand, breadcrumbs, button, callout, card, checkbox, dropdown, field, heading, icon, input, modal, navbar, otp-input, pagination, profile, progress, radio, select, separator, skeleton, switch, table, text, textarea, toast, tooltip - -## Icons - -Flux includes [Heroicons](https://heroicons.com/) as its default icon set. Look up exact icon names on the Heroicons site. Do not guess or invent icon names. - - -```blade -Export -``` - -For an icon that Heroicons lacks, use [Lucide](https://lucide.dev/). Import the icons you need with the Artisan command: - -```bash -php artisan flux:icon crown grip-vertical github -``` - -## Common patterns - -### Form fields - - -```blade - - Email - - - -``` - -### Modals - - -```blade - - Title -

Content

-
-``` - -## Verification - -1. Check that the component renders correctly -2. Test interactive states -3. Verify mobile responsiveness - -## Common pitfalls - -- Trying to use Pro-only components in the free edition -- Not checking whether a Flux component exists before building a custom one -- Forgetting to use the `search-docs` tool for component-specific documentation -- Not following the project's existing Flux patterns diff --git a/.claude/skills/infer-conventions/references/checklist.md b/.claude/skills/infer-conventions/references/checklist.md index c0ae08a..c48bc52 100644 --- a/.claude/skills/infer-conventions/references/checklist.md +++ b/.claude/skills/infer-conventions/references/checklist.md @@ -85,8 +85,6 @@ This app ships a frontend stack, so the items below apply. - Hint: `ls app/View/Components`. Grep ``, ``), 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): + - ``: its reveal button has no name. Use `` (`resources/views/components/password-field.blade.php`). + - ``: unnamed `role="switch"`. Use `resources/views/partials/theme-toggle.blade.php`, which drives `tallstackui_darkTheme({ default: 'system' })` on `` (localStorage `dark-theme`; an inline script in the layout applies it before paint). + - ``: root-relative asset URLs that 404 in a subfolder (local XAMPP). The layout includes `resources/views/partials/tallstackui-script.blade.php` instead. + - ``: 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 (`` 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 `` for dialogs and check that focus moves in and returns. - The layout (`resources/views/layouts/app.blade.php`) provides a skip link and a `
` landmark. Keep them, and add `
@livewireScripts - @fluxScripts diff --git a/resources/views/pages/⚡home.blade.php b/resources/views/pages/⚡home.blade.php index 7a4b64e..aca786d 100644 --- a/resources/views/pages/⚡home.blade.php +++ b/resources/views/pages/⚡home.blade.php @@ -15,15 +15,13 @@ new #[Title('Toiminnanohjaus')] class extends Component ?>
- Toiminnanohjaus +

Toiminnanohjaus

- Livewire ja Flux UI toimivat. Tämä on väliaikainen kokeilusivu. +

Livewire ja TallStackUI toimivat. Tämä on väliaikainen kokeilusivu.

- - Lisää klikkaus - + - +

Klikattu {{ $clickCount }} kertaa - +

diff --git a/resources/views/partials/nav-item.blade.php b/resources/views/partials/nav-item.blade.php new file mode 100644 index 0000000..61d4fe2 --- /dev/null +++ b/resources/views/partials/nav-item.blade.php @@ -0,0 +1,15 @@ +{{-- Main menu link. The current page is marked with aria-current and an underline, not colour alone. --}} +@php($current = request()->routeIs($pattern)) + + $current, + 'text-zinc-600 hover:bg-zinc-100 hover:text-zinc-900 dark:text-zinc-300 dark:hover:bg-zinc-700 dark:hover:text-white' => ! $current, + ]) +> + {{ $label }} + diff --git a/resources/views/partials/tallstackui-script.blade.php b/resources/views/partials/tallstackui-script.blade.php new file mode 100644 index 0000000..3b4a435 --- /dev/null +++ b/resources/views/partials/tallstackui-script.blade.php @@ -0,0 +1,11 @@ +{{-- + TallStackUI's writes root-relative URLs + ("/tallstackui/script/..."), which 404 when the app runs in a subfolder, + as it does locally under XAMPP (/toiminnanohjaus/public). Prefix them with + the app's own URL so the assets load in both setups. +--}} +{!! str_replace( + ['"/tallstackui/script/', '"/tallstackui/style/'], + ['"'.url('tallstackui/script').'/', '"'.url('tallstackui/style').'/'], + \TallStackUi\Facades\TallStackUi::directives()->script(), +) !!} diff --git a/resources/views/partials/theme-toggle.blade.php b/resources/views/partials/theme-toggle.blade.php index a833c66..7910f95 100644 --- a/resources/views/partials/theme-toggle.blade.php +++ b/resources/views/partials/theme-toggle.blade.php @@ -1,19 +1,21 @@ {{-- - Light/dark theme toggle. Flux stores the choice in localStorage - ("flux.appearance") and @fluxAppearance applies it before the page paints. + Light/dark theme toggle. It drives the tallstackui_darkTheme() state on + , which stores the choice in localStorage ("dark-theme"); the + inline script in the layout applies it before the first paint. + + Not : its role="switch" button has no accessible name. The name stays "Tumma teema"; aria-pressed tells whether it is on. --}} - - +