feat(ui): shared migration primitives (UI migration PR 3) (#1122)

* feat(ui): shared migration primitives (UI migration PR 3)

The component kit every page migration (PR 4-8) builds on:

- ContextPicker: the one-per-page chip-dropdown context scope (convention
  8), right-aligned popover with checks and muted annotations
- FyPicker: fiscal-year picker on ContextPicker with the same controlled
  API and per-company localStorage key as FiscalYearSelector, which it
  replaces page by page from PR 4
- SplitButton: primary + caret menu, last-used mode persisted per user
  via ui_state.create_mode (lib/ui-state/client, unit-tested); nav
  persistence refactored onto the same helper
- ConfirmDialog: centered min-460px confirm-up-front dialog (convention
  10) with pending state on an awaitable onConfirm
- HelpPopover: 17px "?" after the H1 opening an anchored popover
  (convention 7); PageHeader gets a `help` slot
- AttnLine: the one-ochre-sentence attention pattern (convention 6) with
  optional inline action; new AA-safe --attn token pair
- RowStatus: chips-mark-exceptions helper (convention 5)
- SlideOver: right review panel, 480px, 18px inset, rounded, veil + Esc
  (convention 13), with header kicker / body / footer slots
- Stagger: .stagger-enter applied to the five target pages' list
  containers (bookkeeping, transactions, pending, invoices,
  supplier-invoices); structural loading.tsx added for supplier-invoices,
  customers, kpi, pending, deadlines

No page adopts the new pickers/dialogs yet: that is PR 4-8, one page per
PR against this kit.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

* fix(ui): FyPicker chip must not double the Rakenskapsar label

Real fiscal periods are often named "Rakenskapsar 2026" already; only
prefix the label when the period name lacks it.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
Jakob Wennberg
2026-07-23 21:29:36 +02:00
committed by GitHub
co-authored by Claude Fable 5
parent d59e4708cf
commit 5b5ee8e429
26 changed files with 1171 additions and 24 deletions
+4 -4
View File
@@ -672,7 +672,7 @@ export default function JournalEntryList() {
// Verifikat/Utkast toggle stays reachable.
if (!loading && entries.length === 0 && !hasActiveFilters && listMode === 'committed' && draftCount === 0) {
return (
<DataList>
<DataList className="stagger-enter">
<DataListEmpty
icon={<BookOpen className="h-6 w-6" />}
title={t('empty_title')}
@@ -933,7 +933,7 @@ export default function JournalEntryList() {
</div>
{loading ? (
<DataList>
<DataList className="stagger-enter">
<DataListLoading />
</DataList>
) : filteredEntries.length === 0 ? (
@@ -941,7 +941,7 @@ export default function JournalEntryList() {
// filtered committed view with no matches, or a committed view with no
// posted entries yet (but drafts exist, hence we got here, not the
// pristine early return above).
<DataList>
<DataList className="stagger-enter">
<DataListEmpty
icon={
listMode === 'drafts' || !hasActiveFilters ? (
@@ -967,7 +967,7 @@ export default function JournalEntryList() {
/>
</DataList>
) : (
<DataList>
<DataList className="stagger-enter">
{/* Batch-mark "Inget underlag krävs": select-all + contextual action bar,
rendered as the list header so it reads as part of the ledger rather
than a detached box above it. */}