From 5f40882cd5eda9c7cf8136dda7c997c411795e0a Mon Sep 17 00:00:00 2001 From: agent Date: Fri, 6 Nov 2026 21:10:17 +0000 Subject: [PATCH 1/4] Expense editor: compact one-screen layout, balanced category tiles MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The add sheet was ~1,400px tall on a 390×844 phone and the 12 category chips wrapped into ragged rows. Now it fits one screen with three members: - currency is a pill beside the amount (native select laid over it) - categories are 12 equal tinted icon tiles, 6 × 2 (12 × 1 when wider), with the chosen name next to the label - date and payer share a row; "Several people" is the last payer option instead of a separate checkbox - photo, note and repeat are folded behind small buttons - Save is pinned to the bottom; Cancel dropped (the X closes) - sheet header is opaque and sheets get scroll-padding so focused fields aren't hidden under the header or the Save bar Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01HA82gVKYyo9BHLHPW4qr4x --- SPEC.md | 5 + apps/web/src/app.css | 4 + apps/web/src/components/ExpenseEditor.svelte | 261 +++++++++++++------ apps/web/src/components/Icon.svelte | 1 + apps/web/src/lib/locales/cs.ts | 3 +- apps/web/src/lib/locales/en.ts | 3 +- 6 files changed, 192 insertions(+), 85 deletions(-) diff --git a/SPEC.md b/SPEC.md index 1851532..48cb35f 100644 --- a/SPEC.md +++ b/SPEC.md @@ -278,6 +278,11 @@ the minimum in practice, and is easy to reason about. the daily rate for the expense date and is editable. - Split editor: equal / shares / exact / percent tabs; tap to exclude people; live "remaining to assign" indicator for exact and percent modes. +- The add sheet fits one phone screen (390×844, three members): currency as a + pill beside the amount; categories as 12 equal icon tiles (6 × 2 on phones, + one row of 12 when wider) with the chosen name beside the label; date and + payer side by side ("Several people" is the last payer option); photo, note + and repeat stay folded behind small buttons; Save is pinned to the bottom. - **One photo per expense** (receipt), see 9. - Category, date, note. - Comments thread on each expense. diff --git a/apps/web/src/app.css b/apps/web/src/app.css index b3484a8..16f2eb7 100644 --- a/apps/web/src/app.css +++ b/apps/web/src/app.css @@ -232,6 +232,10 @@ dialog.sheet { width: 100%; max-width: 100%; height: 100%; max-height: 100%; margin: 0; } dialog.sheet:focus { outline: none; } +/* Sheets scroll under an opaque header (and, in the editor, a pinned Save bar): + keep focused fields clear of both. */ +dialog.sheet { scroll-padding: 72px 0 96px; } +dialog.sheet .topbar { background: var(--bg); } dialog.sheet::backdrop { background: rgb(0 0 0 / 0.5); } @media (min-width: 760px) { dialog.sheet { diff --git a/apps/web/src/components/ExpenseEditor.svelte b/apps/web/src/components/ExpenseEditor.svelte index 0a7ea30..29d7e4c 100644 --- a/apps/web/src/components/ExpenseEditor.svelte +++ b/apps/web/src/components/ExpenseEditor.svelte @@ -1,12 +1,12 @@ -
+ {#if !existing} -
+
{/if} -
- - -
- -
+ +
+
+ + + + + + +
{#if currency !== base} -
- - (rateSource = 'manual')} /> - {base} +
+ + + (rateSource = 'manual')} /> + {base} + + + + {#if rateMissing && rateSource !== 'manual'}{t('rate_unavailable')} + {:else if rateSource.startsWith('ecb:')}{t('rate_source_ecb', { date: fmtDate(rateSource.slice(4)) })} + {:else if rateSource.startsWith('xr:')}{t('rate_source_xr', { date: fmtDate(rateSource.slice(3)) })} + {:else}{t('rate_source_manual')}{/if} + {#if amount && isValidRate(rateText.trim().replace(',', '.'))} · ≈ {money(Math.round(amount * Number(rateText.replace(',', '.')) * 10 ** (exponent(base) - exp)), base)}{/if} +
- -

- {#if rateMissing && rateSource !== 'manual'}{t('rate_unavailable')} - {:else if rateSource.startsWith('ecb:')}{t('rate_source_ecb', { date: fmtDate(rateSource.slice(4)) })} - {:else if rateSource.startsWith('xr:')}{t('rate_source_xr', { date: fmtDate(rateSource.slice(3)) })} - {:else}{t('rate_source_manual')}{/if} - {#if amount && isValidRate(rateText.trim().replace(',', '.'))} · ≈ {money(Math.round(amount * Number(rateText.replace(',', '.')) * 10 ** (exponent(base) - exp)), base)}{/if} -

{/if}
{#if kind === 'expense'} - + + + +
- {t('category')} -
+ {t('category')} · {t(`cat_${category}` as MsgKey)} +
{#each CATEGORIES as c} - {/each}
{/if} - - - {#if kind === 'transfer'} -
-