Commit Graph
10 Commits
Author SHA1 Message Date
petriandClaude Opus 5.5 45dbb04344 Keep the chosen language across sign-in and forced sign-out
A language picked on a signed-out page is now stored on the account when
the user signs in (StoreLocaleChosenBeforeLogin), so the app does not
switch back to the account default. EnsureAccountIsUsable keeps the user's
language for the login page when it ends a disabled account's session.

ChangePreferredLocale runs in a transaction like the other use cases, the
language names come from layout.languages instead of the Locale enum, and
the translation test also compares fi.json with en.json and rejects
English files without a Finnish counterpart.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-25 07:09:22 +02:00
petriandClaude Opus 5.5 4f926c238b Let the theme be chosen by clicking its label in the profile menu
Clicking a theme option's text moved focus nowhere, and the focusout rule
closed the panel before the radio was checked. The panel now closes only
when focus moves to an element outside it; clicks outside and Escape still
close it. Each theme option is a full-width row with a hover state, and
the chosen one is also shown in bold.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-25 06:36:52 +02:00
petriandClaude Opus 5.5 8aead06972 Add English to the UI and a profile menu for language and theme
Every UI string now exists in lang/fi and lang/en; a unit test checks that
both languages have the same keys and placeholders. A user's language is
stored on the account (users.locale) and applied by the SetLocale web
middleware, falling back to the session's choice on signed-out pages and
then APP_LOCALE. Emails use the user's language through
HasLocalePreference, and the login page keeps the language after logout.

The header's name, theme toggle and logout button become one profile menu
(a disclosure) with the language buttons, light/dark/system theme radios
kept on the device, and logging out. Signed-out pages get a Suomi/English
switch next to the theme toggle.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-25 06:28:39 +02:00
petriandClaude Opus 5.5 6936d0950b Keep the header dark and give the light theme a grey content background
The header and its menu popovers always use the dark theme colours, the
light theme body is zinc-100 and Kanban columns zinc-200 so they still
stand out. The theme toggle icon follows the page theme through a new
page-dark variant, and TallStackUI hint and selection group description
texts are one shade darker to keep 4.5:1 contrast on the grey background.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-25 06:01:50 +02:00
petriandClaude Sonnet 5.5 48030e7689 Group the main menu into role-aware popover groups
Replace the flat link row with disclosure groups (Työt, Oma kirjaus,
Asiakkaat ja myynti, Hallinto, Ylläpito) built by App\View\MainMenu from
Gate abilities, and add menu links for new job, quick sales list and
workflow templates.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
2026-11-24 19:14:11 +02:00
petriandClaude Opus 5.5 b3d8e66477 Add quick job intake for phones
Phase 1, item 5:
- New page /jobs/quick (Pikavastaanotto): customer (search or quick
  add), name, short description, service unit, responsible person and
  starting status (Alustava or Prospekti) in one column. The job is
  created with CreateCustomerJob, so numbering, reference checks and
  history are the same as on the full form.
- After saving, the form clears for the next job (responsible person
  and status stay), and a status message with the job number and links
  to the job and its edit page takes focus.
- The customer search of the job form moves to a PicksCustomer trait and
  an <x-jobs.customer-picker> component shared by both pages.
- Menu link and a list button for users who may open jobs; nav items
  accept several route patterns.
- PHPStan ignores unused-trait only for Livewire Concerns, which are
  used from excluded single-file components.
- Spec and CLAUDE.md updated.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-23 19:07:25 +02:00
petriandClaude Opus 5.5 70e107f6e2 Add customer jobs with numbering, members, tags, links and history
Phase 1, item 4. New Jobs module:
- Customer jobs with the spec's fields except money (phase 2): yearly
  running numbers (2026-0001) from a locked counter row, service units,
  schedule, kind, status, priority, payment basis, estimated hours,
  PO reference, instructions, members (responsible, contact person,
  customer contact, biller, billing unit, other members), tags shared
  across jobs, and links.
- Every change is recorded field by field and shown on the job page with
  names and Finnish dates.
- References to other modules are checked through their query
  contracts: contact and billing unit must be the customer's own;
  service units and users must be in use unless already on the job.
- Job list with search, filters and "my jobs" on by default; job form
  with an accessible customer search and quick add; job page.
- Access: subcontractors see only jobs they are members of, read only;
  billing statuses for management and the job's biller; archiving for
  management.

Related changes:
- Customers: one internal customer (created by a migration) for internal
  work; contacts and billing units used by a job cannot be removed.
- Users and Catalog: batch name lookups and active user options with
  roles for other modules.
- <x-checkbox-group> component; spec and CLAUDE.md updated.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-23 18:57:18 +02:00
petriandClaude Opus 5.5 51b2d4a252 Add catalog module for service units, services and work types
Phase 1, item 3: the hierarchy customer jobs, tasks and time entries
will refer to.

- New Catalog module: service unit > optional service > work type.
  Names are unique per level (case-insensitive); items are never
  deleted, only deactivated, and foreign keys restrict deletes.
- Pohjatiedot page (/catalog, admins and management): add, rename,
  reorder with move up/down buttons (keyboard-friendly, focus kept and
  announced) and an "in use" checkbox per row. Work types can move to
  another service of the same unit.
- A migration inserts the starting catalog from the specification when
  the tables are empty, so every installation has it.
- CatalogQueries gives other modules the active service units and the
  work types of chosen units plus the shared ones.
- Spec and CLAUDE.md updated.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-23 18:27:58 +02:00
petriandClaude Opus 5.5 e0b8f4970f Add customer contacts, billing units and consumer personal identity codes
Customer page and contacts/billing units (phase 1, item 2):
- New customer page (customers.show) with details, contacts and billing
  units; add and edit on their own pages, delete after confirmation.
  Creating or editing a customer now leads to this page.
- Contacts: name, title, phone, email, note. Billing units: name,
  billing address, e-invoice address (12-35 letters/digits), operator
  (required with an e-invoice address) and reference.
- Use cases check that the row belongs to the customer, so ids in the
  URL can't reach another customer's rows.
- EmailAddress moves from Users to Shared so both modules can use it.
- <x-confirm-dialog> (native <dialog>) replaces <x-modal>, whose title,
  close button and focus handling are not accessible; solid red buttons
  use red-700 via published NormalButtonColors for 4.5:1 contrast.

Personal identity code (henkilötunnus) for consumers who are invoiced:
- Validated (date, century sign, check character), stored encrypted
  with an HMAC blind index for duplicate checks; never in
  CustomerSummary, search, logs or Livewire state.
- Admins and management see it in full and may remove it; others enter
  it and see only the masked form. The form never shows the stored code.

Spec, architecture doc and CLAUDE.md updated.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-23 18:11:06 +02:00
petriandClaude Opus 5.5 90d6f5bd66 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]>
2026-11-22 12:22:03 +02:00