From 43a569d248d1a54ec64c4a5678627bdc8bc1af91 Mon Sep 17 00:00:00 2001 From: Jakob Wennberg Date: Tue, 25 Aug 2026 10:43:32 +0200 Subject: [PATCH] =?UTF-8?q?fix(reconciliation):=20declutter=20the=20Avst?= =?UTF-8?q?=C3=A4mning=20header=20and=20quiet=20the=20underlag=20section?= =?UTF-8?q?=20(#1886)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The header keeps only the page scope (räkenskapsår, intervall); the Översikt/Matcha manuellt switch moves down to the body it switches, and the Bokslutsbilagor link sits under the account rail it summarizes. The underlag section is one quiet line when nothing is attached, lists files only when there are some, and comes after the numbers instead of before them. The native file input is display:none: sr-only still leaked the browser's "Ingen fil har valts". Claude-Session: https://claude.ai/code/session_01RvFveUpbdPBXdm7f5FEYoz Co-authored-by: Jakob Wennberg <311770904+jakobwennberg-oss@users.noreply.github.com> Co-authored-by: Claude Fable 5 --- components/reconciliation/AccountOverview.tsx | 12 +++---- .../reconciliation/ReconciliationRail.tsx | 5 ++- .../reconciliation/ReconciliationUnderlag.tsx | 24 +++++++------- .../ReconciliationWorkspace.tsx | 32 +++++++++++-------- messages/en.json | 1 + messages/sv.json | 1 + 6 files changed, 43 insertions(+), 32 deletions(-) diff --git a/components/reconciliation/AccountOverview.tsx b/components/reconciliation/AccountOverview.tsx index 036af05e..1d3658b0 100644 --- a/components/reconciliation/AccountOverview.tsx +++ b/components/reconciliation/AccountOverview.tsx @@ -558,12 +558,6 @@ export function AccountOverview({ account, rail, otherBankAccounts = [], window,

)} - {/* Underlag for the balansdag in play: the signed date, else the date the next sign-off would cover. */} - = signoffDefaultDate ? status.signoff.through_date : signoffDefaultDate} - /> - {/* Bridge: how the difference is explained. */} {status.bridge.length > 0 && (
@@ -626,6 +620,12 @@ export function AccountOverview({ account, rail, otherBankAccounts = [], window, )} + {/* Underlag for the balansdag in play: the signed date, else the date the next sign-off would cover. */} + = signoffDefaultDate ? status.signoff.through_date : signoffDefaultDate} + /> + {items.older_unmatched_count > 0 && (

{t('older_unmatched', { count: items.older_unmatched_count })} diff --git a/components/reconciliation/ReconciliationRail.tsx b/components/reconciliation/ReconciliationRail.tsx index 5b566870..846ec1c6 100644 --- a/components/reconciliation/ReconciliationRail.tsx +++ b/components/reconciliation/ReconciliationRail.tsx @@ -62,11 +62,13 @@ interface ReconciliationRailProps { accounts: ReconciliationAccount[] selectedKey: string | null onSelect: (accountKey: string) => void + /** Rendered under the list: the way to the pärm the accounts feed. */ + footer?: React.ReactNode } const MANUAL_OPEN_STORAGE_KEY = 'Accounted:recon-rail-manual-open' -export function ReconciliationRail({ accounts, selectedKey, onSelect }: ReconciliationRailProps) { +export function ReconciliationRail({ accounts, selectedKey, onSelect, footer }: ReconciliationRailProps) { const t = useTranslations('reconciliation') const fed = accounts.filter((a) => a.kind !== 'manual') const manual = accounts.filter((a) => a.kind === 'manual') @@ -207,6 +209,7 @@ export function ReconciliationRail({ accounts, selectedKey, onSelect }: Reconcil )} + {footer} ) } diff --git a/components/reconciliation/ReconciliationUnderlag.tsx b/components/reconciliation/ReconciliationUnderlag.tsx index 83b681a8..4087d028 100644 --- a/components/reconciliation/ReconciliationUnderlag.tsx +++ b/components/reconciliation/ReconciliationUnderlag.tsx @@ -3,7 +3,6 @@ import { useCallback, useEffect, useRef, useState } from 'react' import { useTranslations } from 'next-intl' import { Paperclip } from 'lucide-react' -import { Button } from '@/components/ui/button' import { QUIET_LINK_CLASS, HOVER_REVEAL_CLASS } from '@/components/ui/dry-table' import { useToast } from '@/components/ui/use-toast' import { cn, formatDate } from '@/lib/utils' @@ -111,11 +110,16 @@ export function ReconciliationUnderlag({ accountKey, throughDate, canWrite = tru } return ( -

+

{t('heading_dated', { date: formatDate(throughDate) })}

+ {attachments !== null && attachments.length === 0 && ( + + {t('empty_short')} + + )} {canWrite && ( <> void upload(e.target.files)} aria-label={t('attach')} /> - + )}
- {attachments === null ? null : attachments.length === 0 ? ( -

{t('empty')}

- ) : ( + {attachments === null || attachments.length === 0 ? null : (
    {attachments.map((a) => (
  • diff --git a/components/reconciliation/ReconciliationWorkspace.tsx b/components/reconciliation/ReconciliationWorkspace.tsx index 229e3e66..95dcd75e 100644 --- a/components/reconciliation/ReconciliationWorkspace.tsx +++ b/components/reconciliation/ReconciliationWorkspace.tsx @@ -124,18 +124,6 @@ export function ReconciliationWorkspace({ initialPeriods, initialCompanyId }: Re } action={
    - - {tParm('open_parm')} - - { @@ -205,12 +193,28 @@ export function ReconciliationWorkspace({ initialPeriods, initialCompanyId }: Re ) } + const railFooter = ( + + {tParm('open_parm')} + + ) + return (
    {header} + {/* How the selected account is worked: a view of the body, so it sits with the body, not with the page scope. */} + {selected && mode === 'match' && (
    - +
    void load()} />
    @@ -220,7 +224,7 @@ export function ReconciliationWorkspace({ initialPeriods, initialCompanyId }: Re } + rail={} otherBankAccounts={accounts.filter((a) => a.kind === 'bank' && a.account_key !== selected.account_key && !a.superseded_by)} window={window} onChanged={() => void load()} diff --git a/messages/en.json b/messages/en.json index dc67cc04..831426d1 100644 --- a/messages/en.json +++ b/messages/en.json @@ -8066,6 +8066,7 @@ "heading_dated": "Supporting documents as of {date}", "attach": "Attach document", "empty": "No supporting documents for this date. Attach the bank statement, engagement letter or other specification the account was reconciled against.", + "empty_short": "nothing attached", "remove": "Remove", "attached": "{name} attached", "removed": "{name} removed. The file stays in the archive with a note about the removal.", diff --git a/messages/sv.json b/messages/sv.json index de89003a..fb0fd225 100644 --- a/messages/sv.json +++ b/messages/sv.json @@ -8066,6 +8066,7 @@ "heading_dated": "Underlag per {date}", "attach": "Bifoga underlag", "empty": "Inget underlag bifogat för det här datumet. Bifoga kontoutdrag, engagemangsbesked eller annan specifikation som kontot stämts av mot.", + "empty_short": "inget bifogat", "remove": "Ta bort", "attached": "{name} bifogad", "removed": "{name} borttagen. Filen finns kvar i arkivet med en notering om borttagningen.",