feat(bookkeeping): journal-entry form UX — persistent tabs, focus-advance, opt-in balance fill, period guards (#650)

Captures working-tree changes to the journal-entry form:
- Persist form state across tab switches: forceMount the three bookkeeping tabs (page.tsx) + hide inactive forceMounted panels in the Tabs primitive (tabs.tsx; no-op for non-forceMount tabs).
- AccountCombobox: new onCommit callback fires on a definitive account selection (dropdown pick or full 4-digit entry); the form uses it to auto-advance focus to the debit field (mobile + desktop layouts via refs + visibility check).
- Replace the surprising auto-fill-balancing-amount on account select with opt-in double-click on a debit/credit field (handleFillBalance) — the prior behaviour misfired when splitting across lines.
- Keep exactly one trailing blank row (StrictMode-safe idempotent effect).
- Review-step safety warnings: different-month-than-last-voucher and closed/locked-period notices (paired sv/en strings) — guards against posting to the wrong month/period.

Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
Jakob Wennberg
2026-06-03 18:02:34 +02:00
committed by GitHub
co-authored by Claude Opus 4.8
parent dfd87dd294
commit 05651e6402
6 changed files with 145 additions and 23 deletions
+3 -3
View File
@@ -162,12 +162,12 @@ export default function BookkeepingPage() {
<TabsTrigger value="accounts">{t('tab_accounts')}</TabsTrigger>
</TabsList>
<TabsContent value="journal" className="space-y-4">
<TabsContent value="journal" forceMount className="space-y-4">
<FiscalYearSelector value={periodId} onChange={setPeriodId} />
<JournalEntryList key={`${refreshKey}-${periodId ?? 'all'}`} periodId={periodId ?? undefined} />
</TabsContent>
<TabsContent value="new-entry">
<TabsContent value="new-entry" forceMount>
{isLoadingCopy ? (
<div className="flex items-center gap-2 py-12 justify-center text-muted-foreground">
<Loader2 className="h-4 w-4 animate-spin" />
@@ -202,7 +202,7 @@ export default function BookkeepingPage() {
)}
</TabsContent>
<TabsContent value="accounts">
<TabsContent value="accounts" forceMount>
<ChartOfAccountsManager />
</TabsContent>
</Tabs>