diff --git a/SPEC.md b/SPEC.md index 48cb35f..1c5d7b7 100644 --- a/SPEC.md +++ b/SPEC.md @@ -283,6 +283,10 @@ the minimum in practice, and is easy to reason about. 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. +- Pull to add: on a touch screen, dragging the Expenses or Balances tab down + from the very top shows a "Pull to add expense" pill under the header; + releasing once it reads "Release to add" opens the add sheet. It replaces + the browser's pull-to-refresh there (sync is live anyway). - **One photo per expense** (receipt), see 9. - Category, date, note. - Comments thread on each expense. diff --git a/apps/web/src/components/GroupPage.svelte b/apps/web/src/components/GroupPage.svelte index 4115412..91c8450 100644 --- a/apps/web/src/components/GroupPage.svelte +++ b/apps/web/src/components/GroupPage.svelte @@ -13,6 +13,7 @@ import GroupSettings from './GroupSettings.svelte'; import Icon from './Icon.svelte'; import IdentityPicker from './IdentityPicker.svelte'; + import PullToAdd from './PullToAdd.svelte'; import Stats from './Stats.svelte'; // Keyed by group id in App.svelte, so reading it once is enough. @@ -121,6 +122,11 @@ nav(e, `${base}/e/new`)} aria-label={t('add_expense')}> {/if} + router.go(`${base}/e/new`)} + /> + {#if route.name === 'expense'} {:else if route.name === 'expense-edit'} diff --git a/apps/web/src/components/PullToAdd.svelte b/apps/web/src/components/PullToAdd.svelte new file mode 100644 index 0000000..68b8780 --- /dev/null +++ b/apps/web/src/components/PullToAdd.svelte @@ -0,0 +1,123 @@ + + + + + diff --git a/apps/web/src/lib/locales/cs.ts b/apps/web/src/lib/locales/cs.ts index 134594f..d9dd88d 100644 --- a/apps/web/src/lib/locales/cs.ts +++ b/apps/web/src/lib/locales/cs.ts @@ -62,6 +62,8 @@ const cs: Messages = { stats: 'Statistiky', activity: 'Aktivita', add_expense: 'Přidat výdaj', + pull_to_add: 'Táhněte dolů pro nový výdaj', + release_to_add: 'Pusťte a přidejte', no_expenses: 'Zatím žádné výdaje. Klepněte na + a přidejte první.', total_spent: 'Celkem utraceno', summary: 'Přehled', diff --git a/apps/web/src/lib/locales/en.ts b/apps/web/src/lib/locales/en.ts index dd48b74..ffe52a8 100644 --- a/apps/web/src/lib/locales/en.ts +++ b/apps/web/src/lib/locales/en.ts @@ -68,6 +68,8 @@ const en = { stats: 'Stats', activity: 'Activity', add_expense: 'Add expense', + pull_to_add: 'Pull to add expense', + release_to_add: 'Release to add', no_expenses: 'No expenses yet. Tap + to add the first one.', total_spent: 'Total spent', summary: 'Summary',