Pull down to add an expense

On touch screens, dragging the Expenses or Balances tab down from the top
slides a "Pull to add expense" pill out from under the header; releasing
once it reads "Release to add" opens the add sheet. Sideways swipes,
upward scrolls and touches on form controls are left alone, and the
browser's pull-to-refresh is suppressed only while a pull is in progress.
The visible Add buttons stay; the pill is aria-hidden.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01HA82gVKYyo9BHLHPW4qr4x
This commit is contained in:
agent 2026-11-06 21:27:53 +00:00
parent a10ec3c3b3
commit ce1b207906
5 changed files with 137 additions and 0 deletions

View file

@ -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 @@
<a class="fab" href="{base}/e/new" onclick={(e) => nav(e, `${base}/e/new`)} aria-label={t('add_expense')}><Icon name="plus" size={28} /></a>
{/if}
<PullToAdd
enabled={route.name === 'group' && withHeader && s.status !== 'gone' && !needsIdentity}
onadd={() => router.go(`${base}/e/new`)}
/>
{#if route.name === 'expense'}
<ExpenseDetail session={s} eid={route.eid} />
{:else if route.name === 'expense-edit'}