Post-redesign follow-ups: iPhone data safety, drill spacing and progress, smoke tests, phrase dedupe, design polish

Merged
BI
8d ago
+3737-443

Requested by josh · project thread

Summary

The follow-ups recommended after the iPhone-first redesign, plus phone, PWA and design polish.

  • iPhone data safety: at startup the app asks the browser to keep its storage (navigator.storage.persist()). Safari, when not running from the Home Screen, shows a one-time Add to Home Screen hint. If saved data hasn't been backed up for 30 days, a calm reminder appears. Settings → Backup shows the last backup date. The bookkeeping lives in a device-only key, tc_data_safety, which backups leave out. The manifest gains Help me right now and Search shortcuts.
  • Drill:
    • Reviews come back after 1, 3 or 7 days (Not yet, Getting there, Confident), then grow further apart. All the copy says when a card returns.
    • A new Your progress section counts techniques by status, overall and per category. Tapping a category opens the track picker set to it.
    • Older saved review data still loads.
  • Shared phrases: 52 lines appear on more than one card. The combined Phrase Bank, all-cards Quick Lookup and search now list each one once, with "also on N more cards". Each card's own bank is unchanged and saved phrases still resolve.
  • Design:
    • Cards that fail to load, unknown cards, 404, Help's "not found" and empty Saved now share one empty-state component and offer a way forward.
    • The Use it tab ends with "Pairs well with".
    • Library rows read "Easy to medium · Medium impact".
  • Bugs fixed (found by the new tests):
    • Reloading /help, /help/:id, /search or /start returned HTTP 404 from server.mjs.
    • Tapping a search result straight after typing could leave you on search.
  • Tests: Playwright 1.63.0 smoke, offline and layout specs with iPhone 15 emulation. The new e2e-webkit.yml workflow runs them in WebKit. docs/iphone-test-checklist.md is a manual pass for a real iPhone.
  • README: Features, Routes and test instructions refreshed.
  • Search index: a build-time index was measured but not built. It would cut the first search on a throttled CPU from about 1.0 s to 0.3–0.5 s, but adds about 280 KB gzipped to the offline download.

Checks

  • Passed after merging every branch: format:check, lint, typecheck, all tests (908 app plus the scripts suite), production build and the code reviewer.
  • Passed locally: the Chromium iPhone e2e project, 19/19.
  • Not run yet: WebKit, the first run is in CI. The clipboard and service-worker offline specs may need adjusting there.
  • Not verified: a physical iPhone, VoiceOver and Dynamic Type.

Generated by Claude Code


Summary by cubic

Implements follow-ups from the iPhone-first redesign: protects saved data on iPhone Safari, changes drill review spacing, lists shared phrases once, and polishes the phone and design details. Also adds Playwright smoke tests in WebKit and fixes several bugs those tests uncovered.

Changes

  • Data safety: requests persistent storage, shows a one-time Add to Home Screen hint on iOS Safari and a calm backup reminder after 30 days; Settings shows the last backup date. Bookkeeping lives in a device-only key that backups leave out, plus new PWA shortcuts.
  • Drill: first ratings bring a review back in 1, 3 or 7 days, then grow apart; rating buttons use a short label (Tomorrow, In 3 days) while their accessible names keep the full sentence. A new Your progress section counts techniques by status overall and per category, and opens the track picker on that category. Older saved reviews still load.
  • Shared phrases: the combined Phrase Bank, search and Quick Lookup's all-cards view list each line once with "also on N more cards"; a situation-filtered Quick Lookup still shows every line. A merged line keeps every tone its copies carry, so tone filters and counts include them. Each card's own bank and saved lines are unchanged.
  • Design: failed loads, unknown cards, 404, Help's not found and empty Saved use one empty-state component; Use it ends with "Pairs well with"; Library rows spell out difficulty and impact. An unknown card's header reads Card not found, and the Help picker's eyebrow no longer repeats the page title.
  • Phone polish: iOS launch screens for 11 iPhone sizes replace the blank Home Screen launch; the manifest allows rotation, and landscape iPhones clear the notch or Dynamic Island in the sidebar, sheets, docks and search.
  • Polish and accessibility: selected segments lift above their track, bottom sheets centre on desktop, the dock fade reaches the bottom of the screen, and accessible names now match visible labels in order (WCAG 2.5.3) across the Library, tab bar, drill ratings, copy rows and playbook templates.
  • Load: preloads the Inter faces and warms a deep link's page chunk and data during boot, cutting first paint on /, /card/:id and /phrases.

Testing and bug fixes

  • Playwright 1.63.0 smoke, offline and layout specs with iPhone 15 emulation; a new e2e-webkit.yml CI workflow runs them in WebKit, and docs/iphone-test-checklist.md covers a manual pass. On WebKit the offline spec verifies the worker and precache, since WebKit can't reload offline in emulation; Chromium runs the real offline reload. Launch-screen files, sizes and links have vitest coverage.
  • Fixes: server.mjs returned HTTP 404 on /help, /help/:id, /search and /start; tapping a search result right after typing could leave you stuck on search.
  • README refreshed for the new routes and features.