Design 001: Split expenses
The product’s texts are in Italian in
src/messages.it.js. This document gives the English meaning of each text key, so it can be read without Italian.
- Spec:
specs/001-split-expenses/spec.md - Status: Approved
What you are approving
- One page with three areas (People, Expenses, Result) and “reset all” at the bottom. Expenses are added and edited in a full-screen panel, with “Cancel” at the top and “Save” at the bottom.
- Plain style, one accent colour, light or dark as the phone is set. Balances always say in words “is owed” or “owes”, not only with colour.
- Decisions taken for you (fix them if you do not like them): in the new panel all people are already ticked as “shared by”, and the payer must be chosen; the expense list shows the most recent at the top.
- Exact colours and sizes are not chosen here: they come with the design system in the first build task. No image or graphic file was used.
- The gap found (“who paid was not chosen”) is now covered by the spec (R30, AC37).
0. Sources
| # | Item (file or link) | Version or date read | Covers | Role |
|---|---|---|---|---|
| S1 | The human’s answers in conversation (panel for the expense form; sober style, one accent colour, state in words not only colour) | 2026-12-02 | Expense form, visual tone | authoritative |
Reading of images: N/A – no images or design files were provided.
1. Flows
- Add people and expenses (US1, US2, US4). Open the page → in “People” type a name and tap “Add” (repeat) → tap “Add expense” → in the panel fill description, amount, payer, sharers → “Save” → the panel closes, the expense is at the top of the list and “Result” has changed.
- Fix a mistake (US3). Tap an expense → the panel opens with its values → change → “Save”; or tap “Delete” in the panel → confirmation → “Delete” confirms, “Cancel” leaves the expense.
- Remove a person (US1). Tap “Remove” next to a name. If the person is in no expense they disappear; otherwise a message says why not (R6).
- Reopen the page (US5). The saved people and expenses are shown as they were. If the saved data is unreadable, a notice offers to start empty (R20).
- Start again (US5). Tap “Reset all” at the bottom → confirmation that says the data cannot be recovered → “Reset” confirms, “Cancel” leaves everything.
2. Screens
Screen: Main page
- Purpose: record the group, see the result. Everything except the expense form lives here.
- Entry points: opening the page.
- Source: spec only (areas and order), S1 (style).
- Layout (360 px first): one column, top to bottom:
- Notices (only when needed): unreadable data (R20); saving not allowed (R21).
- People: a field “Name” with button “Add”; below, one row per person with a “Remove” button; a counter “n of 12”.
- Expenses: button “Add expense” (shown only if there is at least one person, AC34); below, one row per expense, newest first (proposed): description, amount, “paid by
". Each row is one touch target that opens the panel. A counter "n of 500". - Result: first the balances, one row per person: name and “is owed 10.00 €” / “owes 10.00 €” / “is even”, with a sign (+ / −) and not only a colour; then “To settle up” with one row per payment: “Bruno owes 10.00 € to Anna”; or the message that everything is even (R17).
- Reset all, a secondary-style button at the very bottom, away from the main actions.
- Larger screens: content stays in one centred column of limited width (about 640 px), so lines stay readable; nothing else changes (largest viewport in the profile: 1280 px).
- Main actions: add person, remove person, add or open expense, reset.
- Covers: US1 · US4 · US5 · R1-R6, R12, R15-R18, R22, R25-R27
Screen: Expense panel (add and edit)
- Purpose: enter or change one expense.
- Entry points: “Add expense”; tapping an expense row.
- Source: S1, spec (fields).
- Layout (360 px first): full-screen panel over the page. Top bar: “Cancel” (left) and the title “New expense” or “Edit expense”. Body: field “Description”; field “Amount (€)”; choice “Paid by” (one of the people, none chosen at first); choice “Shared by” (one tick per person; all ticked at first in a new expense, proposed; in an edit, the saved ones). Bottom: large button “Save”; in an edit, also “Delete expense” as a secondary button above or beside it. Every error appears next to its field and the typed values stay (R24).
- Larger screens: the panel becomes a centred box of limited width over a dimmed page.
- Main actions: save, cancel, delete (edit only).
- Covers: US2 · US3 · R7-R11, R13, R14, R23, R24
Screen: Confirmation dialogs
- Purpose: ask before something that cannot be undone.
- Entry points: “Delete expense” in the panel; “Reset all”; the offer to start empty in the unreadable-data notice.
- Source: spec (R14, R20, R22) and proposed (look).
- Layout: a small centred box with the question and two buttons; the safe one (“Cancel”) is the first in reading order.
- Main actions: confirm, cancel.
- Covers: US3 · US5 · R14, R20, R22
3. States
| Screen / component | Empty | Loading | Error | Offline | Permission denied | Source |
|---|---|---|---|---|---|---|
| People | Text “No people yet. Add the first to start.” | N/A – data is read before showing the page | Message next to the name field (empty, too long, duplicate, 12 reached) | N/A – no network is used (R29) | N/A | spec + proposed |
| Expenses | Text “No expenses yet. Record the first.” (button shown only with at least one person; without people: “Add at least one person first.”) | N/A | Messages in the panel next to fields; “limit of 500 expenses reached” message | N/A | N/A | spec + proposed |
| Result | Message “Everyone is even.” | N/A | N/A – computed from valid data | N/A | N/A | spec + proposed |
| Notice: unreadable data | N/A | N/A | Notice with “Start again” (after confirmation); nothing from the saved data is shown; while the notice is shown, the name field, “Add” and “Add expense” are not offered | N/A | N/A | spec (R20) |
| Notice: saving not allowed | N/A | N/A | Notice “The browser does not allow saving: data is lost if you close the page.” | N/A | The notice itself | spec (R21) |
4. Components
No design system exists yet (project/design-system.md); every component is a proposal for it, built from tokens that the design-system task defines.
| Component | Existing / New | Notes |
|---|---|---|
| Text field with label and error line | New | Used for name, description, amount; label always visible, error linked to the field |
| Primary button / secondary button | New | At least 44×44 px; the accent colour only on primary |
| List row (with action) | New | People, expenses, balances, payments; whole expense row is one target |
| Choice list (one of many; many of many) | New | Payer (radio-style), sharers (tick boxes), each with a 44 px target |
| Full-screen panel / dialog | New | Traps keyboard focus while open; closes with “Cancel” |
| Notice (inline banner) | New | Text plus icon; not colour only |
| Counter text (“n of 12”) | New | Plain text |
5. Copy (i18n)
All strings live in the text catalogue (W4). Errors never repeat what the user typed (R25).
| Key | Text | Context |
|---|---|---|
| people.title | People | Area heading |
| people.name.label | Name | Field label |
| people.add | Add | Button |
| people.remove | Remove | Button on each person (accessible name adds the person’s name) |
| people.counter | {n} of 12 | Counter |
| people.empty | No people yet. Add the first to start. | Empty state |
| people.error.empty | Enter a name. | R2 |
| people.error.tooLong | The name can have at most 30 characters. | R2 |
| people.error.duplicate | There is already a person with this name. | R3 |
| people.error.limit | You have reached the limit of 12 people. | R4 |
| people.error.inUse | You cannot remove a person who appears in an expense. Edit or delete those expenses first. | R6 |
| expenses.title | Expenses | Area heading |
| expenses.add | Add expense | Button |
| expenses.paidBy | paid by {name} | Row |
| expenses.counter | {n} of 500 | Counter |
| expenses.empty | No expenses yet. Record the first. | Empty state |
| expenses.needPeople | Add at least one person first. | Empty state, no people |
| expenses.error.limit | You have reached the limit of 500 expenses. | R12 |
| panel.title.new | New expense | Panel |
| panel.title.edit | Edit expense | Panel |
| panel.description.label | Description | Field |
| panel.amount.label | Amount (€) | Field |
| panel.payer.label | Paid by | Choice |
| panel.sharers.label | Who shares the expense | Choice |
| panel.save | Save | Button |
| panel.cancel | Cancel | Button |
| panel.delete | Delete expense | Button, edit only |
| panel.error.descEmpty | Enter a description. | R8 |
| panel.error.descTooLong | The description can have at most 60 characters. | R8 |
| panel.error.amountInvalid | Enter an amount above zero, with at most two decimals (for example 12.50). | R9 |
| panel.error.amountTooBig | The amount can be at most 99,999.99 €. | R9 |
| panel.error.noSharers | Choose at least one person who shares the expense. | R10 |
| panel.error.noPayer | Choose who paid. | R30 |
| result.title | Result | Area heading |
| result.receives | is owed {amount} | Balance > 0 |
| result.owes | owes {amount} | Balance < 0 |
| result.even | is even | Balance = 0 |
| result.settle.title | To settle up | Payments heading |
| result.payment | {from} owes {amount} to {to} | Payment row |
| result.allEven | Everyone is even. | R17 |
| confirm.deleteExpense | Delete this expense? | R14 |
| confirm.deleteExpense.yes | Delete | Button |
| reset.button | Reset all | R22 |
| confirm.reset | Delete all people and all expenses? The data cannot be recovered. | R22 |
| confirm.reset.yes | Reset | Button |
| notice.corrupt | The saved data cannot be read. | R20 |
| notice.corrupt.action | Start again | Button, then confirmation as in R22 |
| notice.noStorage | The browser does not allow saving: data is lost if you close the page. | R21 |
| status.personAdded | Person added | Announcement (Section 6) |
| status.personRemoved | Person removed | Announcement (Section 6) |
| status.expenseSaved | Expense saved | Announcement (Section 6) |
| status.expenseDeleted | Expense deleted | Announcement (Section 6) |
6. Accessibility
- Order: notices, People, Expenses, Result, Reset all; keyboard order follows the visual order; the page has landmarks and one heading per area, and a meaningful title.
- Labels: every field has a visible label; buttons that repeat (“Remove”, expense rows) have an accessible name that includes the person or expense.
- Errors: next to the field, linked to it, and announced when they appear; focus moves to the first field with an error after a failed save.
- Dynamic changes: after adding, removing, saving or deleting, a short status announcement (“Person added”, “Expense saved”, “Expense deleted”) and the result area is a live region that is updated politely, without moving focus.
- Panel and dialogs: focus moves inside when they open, stays inside while open, and returns to the element that opened them; Escape closes them (same as “Cancel”).
- Colour: the accent colour and the text meet the contrast of WCAG 2.2 AA; no meaning by colour alone (balances use words and signs; notices use text and icon).
- Targets: at least 44×44 px for every control; text can grow to 200% without losing content; motion off under reduced motion (W3).
- Keyboard: the whole flow works without a pointer (AC35).
7. Conflicts, gaps and open questions
- Gap resolved: the missing-payer case is now R30 and AC37 in the spec; the message
panel.error.noPayerserves it. - Proposed, not in the spec: new expense starts with all people ticked as sharers; expenses listed newest first; counters “n of 12” and “n of 500”; the order of people in lists is the order of adding (spec). Confirm or change.
- Not shown anywhere: nothing from the spec’s UI requirements is left without a screen or state. No conflicts between sources.
- Sources: only S1 (conversation). No image, file or link was received.
8. Approval
- Approved by: Luca Lanzano
- Date: 2026-12-02
Change log
- 2026-12-02: after the spec change (R30, AC37), the missing-payer gap is marked resolved; copy key source updated; approval reset to Draft.
- 2026-12-02: change request accepted by the human: added the four announcement texts (status.*) to Section 5; approval reset to Draft.
- 2026-12-02: change request CR1 (from verification 001, F1) accepted by the human: the unreadable-data notice blocks adding until “Start again” is confirmed.