diff --git a/SPEC.md b/SPEC.md index e9767ae..9c41991 100644 --- a/SPEC.md +++ b/SPEC.md @@ -180,11 +180,8 @@ Split `value` meaning per mode: | `exact` | amount in minor units | sum == amount | | `percent` | basis points (100 % = 10000) | sum == 10000 | -Multiple payers are supported (`payers` list) — e.g. several people chipping -in for a car. The editor shows a single payer by default; choosing "Several -people" in *Paid by* lists every member with an amount box. Empty boxes show -the unassigned remainder as a placeholder, a live line reads "Remaining" / -"Over by" / "Adds up to the total", and the expense list shows "N payers". +Multiple payers are supported (`payers` list); the default UI shows a single +payer with an "add payer" option. --- @@ -265,8 +262,8 @@ the minimum in practice, and is easy to reason about. - Create group: name, base currency (default by locale: CZK for Czech, EUR otherwise), icon/emoji, initial members. - Share: copy link, native share sheet, QR code. -- Settings: rename, members, "who am I", default category, remove from - device, export, delete group (see 8.3). +- Settings: rename, members, "who am I", remove from device, export, delete + group (see 8.3). - **Base currency is locked once the group has any expense or transfer.** It can be changed freely while the group is empty; afterwards the setting is read-only with a short explanation. Clients enforce this during replay too: @@ -281,18 +278,6 @@ 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. -- Touch gestures on the group page (shortcuts; every action also has a - button): pull up past the end of the Expenses or Balances tab to add an - expense (a "Pull up to add expense" pill rises from behind the tab bar and - reads "Release to add" once far enough; at the bottom so the browser's - pull-to-refresh still works), and swipe left/right to move between the - Expenses, Balances, Stats and Activity tabs. Swipes starting within 24px - of the screen edge are left to the OS back gesture. - **One photo per expense** (receipt), see 9. - Category, date, note. - Comments thread on each expense. @@ -303,12 +288,6 @@ Fixed v1 set with icons: food & drink, groceries, transport, accommodation, entertainment, shopping, utilities, rent, travel, gifts, health, other. Transfers have their own implicit category. -Each group has a **default category** (`group.updated` → `defaultCategory`, -one of the set above; absent means "other") that new expenses start with. -Replay ignores a `group.updated` whose `defaultCategory` isn't in the set, -without applying any other field of that event. Each category has an icon -colour (`CATEGORY_COLORS` in `apps/web/src/lib/format.ts`). - ### 7.4 Recurring expenses - A template (expense object + rule: weekly / monthly / yearly, interval, @@ -456,22 +435,11 @@ which group ids exist. 1. **Home**: groups saved on this device, each showing my balance. "New group", "Open link/scan QR". -2. **Group**: on Expenses and Balances, a header with my balance as the - headline number ("You're owed / You owe / settled up"; the group total if - "who am I" isn't set), the group's total spent, and round quick actions: - Add · Payment · Settle up · Share. Tabs: Expenses · Balances (settle up) · - Stats · Activity. A floating "+" appears only once the quick actions have - scrolled off screen. Touch gestures: pull up at the end of the page to - add, swipe sideways to change tab (see 7.2). +2. **Group**: tabs: Expenses · Balances (settle up) · Stats · Activity. + Floating "+" button for a new expense. 3. **Expense editor** (sheet on mobile, dialog on desktop). 4. **Expense detail**: photo, split breakdown, comments, history. -5. **Group settings**, kept short: Share (copy link, native share, QR), - Group (icon, name, main currency and default category side by side; Save - appears only when something changed), Members ("You are" picker on top; - rename/archive as icon buttons; add member as the last row), - Notifications (one switch; hidden where push isn't available), Repeating - expenses (only when there are any), Export, Danger zone (delete asks for - the group name only after it is tapped). +5. **Group settings**. 6. **App settings**: language, theme, notifications. ### 10.3 Language diff --git a/apps/web/src/app.css b/apps/web/src/app.css index 16f2eb7..1d00059 100644 --- a/apps/web/src/app.css +++ b/apps/web/src/app.css @@ -70,7 +70,6 @@ } * { box-sizing: border-box; } -svg { flex-shrink: 0; } /* icons beside wrapping text must not be squashed */ html { -webkit-text-size-adjust: 100%; } body { margin: 0; @@ -83,8 +82,7 @@ body { h1, h2, h3 { line-height: 1.2; margin: 0; } h1 { font-size: 1.35rem; } h2 { font-size: 1.05rem; } -h3 { font-size: 1.05rem; font-weight: 700; letter-spacing: -0.01em; } -h3.day { font-size: 0.85rem; font-weight: 600; letter-spacing: 0; color: var(--muted); padding-left: 4px; } +h3 { font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); font-weight: 600; } a { color: var(--accent); } p { margin: 0; } .muted { color: var(--muted); } @@ -147,8 +145,6 @@ button, .btn { .btn.primary:hover { filter: brightness(1.08); } .btn.danger { color: var(--danger); border-color: color-mix(in srgb, var(--danger) 40%, var(--border)); } .btn.ghost { background: transparent; border-color: transparent; } -.btn.tint { background: color-mix(in srgb, var(--accent) 15%, var(--surface)); border-color: transparent; color: var(--accent); } -.btn.tint:hover { background: color-mix(in srgb, var(--accent) 24%, var(--surface)); } .btn.small { min-height: 34px; padding: 0 14px; font-size: 0.9rem; } .btn.block { width: 100%; } .btn:disabled { opacity: 0.5; cursor: not-allowed; } @@ -170,13 +166,9 @@ input:focus-visible, select:focus-visible, textarea:focus-visible, .btn:focus-vi input[type='checkbox'] { width: 22px; height: 22px; min-height: 0; accent-color: var(--accent); flex-shrink: 0; } input[type='date'] { min-width: 0; } -.seg { - display: flex; background: var(--surface); border: 1px solid var(--line); border-radius: 999px; padding: 3px; gap: 3px; - overflow-x: auto; scrollbar-width: none; /* very narrow screens scroll rather than wrap */ -} -.seg::-webkit-scrollbar { display: none; } +.seg { display: flex; background: var(--surface); border: 1px solid var(--line); border-radius: 999px; padding: 3px; gap: 3px; } .seg button { - flex: 1 0 auto; white-space: nowrap; min-height: 38px; border: 0; border-radius: 999px; background: transparent; color: var(--muted); font-weight: 600; font-size: 0.9rem; padding: 0 8px; + flex: 1; min-height: 38px; border: 0; border-radius: 999px; background: transparent; color: var(--muted); font-weight: 600; font-size: 0.9rem; padding: 0 8px; } .seg button[aria-pressed='true'] { background: var(--surface-2); color: var(--text); } @@ -231,11 +223,6 @@ dialog.sheet { padding: 0; border: 0; color: var(--text); background: var(--bg); 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 { @@ -267,10 +254,3 @@ dialog.sheet::backdrop { background: rgb(0 0 0 / 0.5); } .fab { bottom: 32px; right: max(32px, calc(50% - 560px + 32px)); } .page { padding-bottom: 48px; } } - -/* round category icon tinted with its category colour (set --cat inline) */ -.cat-icon { background: color-mix(in srgb, var(--cat, var(--muted)) 24%, var(--surface-2)); } - -/* money with the whole number emphasised (see moneyParts) */ -.money .cur, .money .frac { color: var(--muted); font-size: 0.82em; font-weight: inherit; } -.pos .money .cur, .pos .money .frac, .neg .money .cur, .neg .money .frac { color: inherit; opacity: 0.8; } diff --git a/apps/web/src/components/Balances.svelte b/apps/web/src/components/Balances.svelte index 563eeb0..a07095b 100644 --- a/apps/web/src/components/Balances.svelte +++ b/apps/web/src/components/Balances.svelte @@ -42,14 +42,14 @@
{#each members as { m, i, bal } (m.id)}
- + {m.name}{m.id === session.me ? ` (${t('you')})` : ''} - + {bal === 0 ? t('settled') : (bal > 0 ? '+' : '−') + conv(Math.abs(bal))}
@@ -62,18 +62,12 @@ {:else}
{#each transfers as tr} - {@const from = session.state.members.findIndex((m) => m.id === tr.from)} - {@const to = session.state.members.findIndex((m) => m.id === tr.to)}
- {session.memberName(tr.from)} → {session.memberName(tr.to)} - {conv(tr.amount)} + {conv(tr.amount)} - +
{/each}
@@ -91,10 +85,7 @@
diff --git a/apps/web/src/components/ExpenseList.svelte b/apps/web/src/components/ExpenseList.svelte index f866bc4..0f12c94 100644 --- a/apps/web/src/components/ExpenseList.svelte +++ b/apps/web/src/components/ExpenseList.svelte @@ -1,11 +1,10 @@
+
+
+
{t('total_spent')}
+
{money(total, session.base)}
+
+
+ {#if Object.keys(session.state.expenses).length > 6} {/if} @@ -58,50 +70,34 @@ {#each rows as day (day.date)}
-

{dayLabel(day.date)}

+

{dayLabel(day.date)}

{/each}
- - diff --git a/apps/web/src/components/GroupGestures.svelte b/apps/web/src/components/GroupGestures.svelte deleted file mode 100644 index 57ebce3..0000000 --- a/apps/web/src/components/GroupGestures.svelte +++ /dev/null @@ -1,215 +0,0 @@ - - - - - diff --git a/apps/web/src/components/GroupHeader.svelte b/apps/web/src/components/GroupHeader.svelte deleted file mode 100644 index c27d346..0000000 --- a/apps/web/src/components/GroupHeader.svelte +++ /dev/null @@ -1,74 +0,0 @@ - - -
- {#if mine === null} -
{t('total_spent')}
-
- {:else} -
{mine > 0 ? t('hero_owed') : mine < 0 ? t('hero_owe') : t('hero_settled')}
-
-
{t('total_spent')}
- {/if} -
- - - - diff --git a/apps/web/src/components/GroupPage.svelte b/apps/web/src/components/GroupPage.svelte index 7170c2d..5ecd727 100644 --- a/apps/web/src/components/GroupPage.svelte +++ b/apps/web/src/components/GroupPage.svelte @@ -1,5 +1,5 @@ - -{money(minor, currency, { sign })} diff --git a/apps/web/src/components/Sheet.svelte b/apps/web/src/components/Sheet.svelte index dadbe07..88522d5 100644 --- a/apps/web/src/components/Sheet.svelte +++ b/apps/web/src/components/Sheet.svelte @@ -10,17 +10,12 @@ $effect(() => { dialog.showModal(); - // showModal() focuses the first control (the close button), which shows a - // focus ring even after a tap. Focus the dialog itself instead, unless a - // field asked for focus with autofocus. Tab still reaches every control. - if (!dialog.querySelector('[autofocus]')) dialog.focus(); return () => dialog.close(); }); { e.preventDefault(); onclose(); }} diff --git a/apps/web/src/components/Stats.svelte b/apps/web/src/components/Stats.svelte index 6e061ea..6137fb6 100644 --- a/apps/web/src/components/Stats.svelte +++ b/apps/web/src/components/Stats.svelte @@ -31,7 +31,7 @@
-
+
{#each [['all', 'range_all'], ['year', 'range_year'], ['month', 'range_month'], ['30', 'range_30']] as const as [r, label]} {/each} @@ -118,20 +118,19 @@