Skip to content

Mobile polish, phase 1: sheets, mini-player, Next up, micro-interactions - #23

Merged
antonsxh merged 3 commits into
mainfrom
mobile-polish-1
Nov 22, 2026
Merged

antonsxh merged 3 commits into
mainfrom
mobile-polish-1

Conversation

@antonsxh

@antonsxh antonsxh commented Nov 22, 2026 •

Copy link
Copy Markdown
Owner

Phase 1 of the iPhone PWA polish. Three goals: the next tap should always be obvious, interactions should feel tactile, and phones should show less.

What changes (phones ≤ 720px unless noted)

  • Next up on Home: a card at the top shows the first open task of today with one full-width Start focus button. Starting stays on Home and the mini-player slides in. With no open tasks it shows "Nothing planned / All done for today" and an Add a task button.
  • Compact Home header: today vs goal and the streak chip share one row. The streak hint and the week budget bar are hidden on phones.
  • Add-task forms: idle they show only the quest picker and the input. Duration and Top/Bottom appear once you type or focus the form.
  • Mini-player above the tab bar while a timer is active:
    • shows the quest colour, the task, the clock and a progress line;
    • one 44px button pauses, resumes, starts the waiting phase or skips the break;
    • tapping the rest of the bar opens Focus;
    • the top-bar timer chip is hidden on phones.
  • Bottom sheets (Dialog.svelte):
    • slide up and down and close when you drag them down;
    • stay above the iOS keyboard (visualViewport), use dvh instead of 100vh and respect the safe area;
    • the button row sticks to the bottom with a full-width primary button;
    • desktop keeps the centred modal.
  • Micro-interactions:
    • motion tokens, and prefers-reduced-motion switches all animation off;
    • buttons shrink and dim slightly when pressed;
    • completing a task: the check pops, then the tick draws and the title is struck through once the server confirms;
    • the active tab gets a pill that springs in, and Home's logged time ticks when it changes.
  • Wake lock on /focus while the clock runs. It is feature-detected and never logs console errors.
  • Smaller fixes:
    • Focus shows Resume as the primary button when paused;
    • the Review KPI cards are compact on phones;
    • the quest form's emoji grid no longer overlaps the budget field;
    • cancelling the Time-block dialog now clears Home's editor state.

Next up and the mini-player are phones only. On iPad and desktop they would compete with the task cards' ▶ and the timer chip.

Not in this PR: Phase 2 (Plan and Calendar as a day view with swipe) and Phase 3 (Web Push and the app-icon badge). WebKit in Playwright was tried but not added: the browser needs system libraries here, and CI installs none for e2e.

Screenshots

iPhone 390×844 (Chromium emulation).

Before After
Home
Home, timer running
Dialog → sheet
Review
After: empty state Mini-player paused (Plan) Sheet above the keyboard Focus paused

Desktop is unchanged: after-home-desktop.png

Video (sheet drag-dismiss, task check, Start focus → mini-player, pause/resume; recorded before the add-form disclosure commit): after-interactions.webm

Tests

  • Unit: motion, sheet, next-up, wake-lock, and primaryTimerAction in timer.test.ts. bun run test reports 366 pass.
  • e2e: new e2e/specs/mobile-polish.spec.ts (@mobile). Both tests were checked to fail with the bug reintroduced.
    • Next up → Start focus writes the DB session, and a pause from the mini-player survives a reload; tapping the bar opens Focus.
    • A sheet dragged down closes without saving, and the form still submits.
  • Results: test:e2e 87 passed, 2 skipped. test:e2e:mobile 43 passed, 3 skipped. check, lint and build are clean.
  • Not tested on a real iPhone: the keyboard vs the sheet, the wake lock, how :active feels, and Safari's animation rendering.

🤖 Generated with Claude Code

antonsxh and others added 3 commits November 22, 2026 13:01
- Motion tokens (--ease-out/-in/-spring, --dur-press/-pop/-sheet, --press-*) and #lib/motion.ts
  (CSS time/easing parsing, token-driven Svelte transitions); a global prefers-reduced-motion
  rule. Touch press feedback for controls, iOS callout/selection off on controls, touch-action.
- Dialog becomes a bottom sheet on phones: slides up/down, drag the header to dismiss
  (#lib/sheet.ts), anchored above the iOS keyboard via visualViewport, sticky .dialog-actions
  with a full-width primary button; exit animation for every way of closing, `onclosed`.
- Mini-player above the tab bar while a timer is active (phones), one big
  pause/resume/start/skip button (primaryTimerAction); the top-bar chip is hidden on phones.
- Home on phones: "Next up" card with Start focus (stays on Home) and an empty state that
  focuses the add input; one compact summary row (today vs goal + streak).
- Task completion animation (check pop, tick draw, strike-through), animated tab indicator,
  today's value ticks in. Focus: Resume is primary when paused; Screen Wake Lock while the
  clock runs (#lib/wake-lock.ts). Review KPIs compact on phones; quest form stacks.
- Styleguide: sheet + mini-player. Unit tests for the new pure logic, e2e
  mobile-polish.spec.ts. ROADMAP section and mobile UX principles in AGENTS.md.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… in use on phones

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Measured mid-animation, the header has moved on when the pointer goes down,
so the drag started on the sheet body and never dismissed (failed in CI).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@antonsxh
antonsxh merged commit 61e0675 into main Nov 22, 2026
6 checks passed
@antonsxh
antonsxh deleted the mobile-polish-1 branch November 22, 2026 12:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant