From 3e5670f978928f375f82a065f349f607137e7477 Mon Sep 17 00:00:00 2001 From: Jakob Wennberg Date: Sat, 5 Sep 2026 17:27:12 +0200 Subject: [PATCH] fix(expenses): "Vem betalade?" as a compact select in the Underlag rail (#2327) The four two-line radio rows pushed the primary button below the fold in the narrow rail. The question is now a select at the shared control height with the chosen answer's one-line consequence under it; the list keeps label + help per option and is pinned to the trigger width so it wraps inside the rail instead of spilling over the document viewer. Claude-Session: https://claude.ai/code/session_01P8YsvPqjfGxGZUkGeBVUWQ Co-authored-by: Jakob Wennberg <311770904+jakobwennberg-oss@users.noreply.github.com> Co-authored-by: Claude Fable 5.1 --- .../general/InvoiceInboxWorkspace.tsx | 61 ++++++++----------- 1 file changed, 27 insertions(+), 34 deletions(-) diff --git a/components/extensions/general/InvoiceInboxWorkspace.tsx b/components/extensions/general/InvoiceInboxWorkspace.tsx index bed5de8c..668a273b 100644 --- a/components/extensions/general/InvoiceInboxWorkspace.tsx +++ b/components/extensions/general/InvoiceInboxWorkspace.tsx @@ -23,6 +23,7 @@ import { DialogHeader, DialogTitle, } from '@/components/ui/dialog' +import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from '@/components/ui/select' import { useToast } from '@/components/ui/use-toast' import { Inbox, @@ -3083,7 +3084,13 @@ export type PayerChoice = 'company' | 'unpaid' | ExpensePayer const PAYER_ORDER: PayerChoice[] = ['company', 'owner', 'employee', 'unpaid'] -export function PayerChoiceList({ +/** + * The "Vem betalade?" control: a compact select so the rail keeps its + * primary button above the fold, with the chosen answer's one-line + * consequence under it. Each option in the list carries the same help so + * the choice is made with the consequence visible, not after. + */ +export function PayerChoiceSelect({ value, onChange, accountingMethod, @@ -3098,38 +3105,24 @@ export function PayerChoiceList({ return (

{t('payer_question')}

-
- {PAYER_ORDER.map((choice) => { - const selected = choice === value - return ( - - ) - })} -
+ +

{t(helpKey(value))}

) } @@ -3689,7 +3682,7 @@ function FieldsRail({ answer keeps BFL 5 kap 6-7 ยง intact (the underlag is booked as a verifikat, never forced into a supplier invoice), and the verifikat editor stays reachable below as the escape hatch. */} - + {payer === 'company' ? (