Skip to content

Improve mobile responsiveness, error recovery, and timeline UX#17

Merged
JasonWarrenUK merged 1 commit into
mainfrom
claude/project-assessment-polish-bzq2y3
Jun 14, 2026
Merged

Improve mobile responsiveness, error recovery, and timeline UX#17
JasonWarrenUK merged 1 commit into
mainfrom
claude/project-assessment-polish-bzq2y3

Conversation

@JasonWarrenUK

Copy link
Copy Markdown
Owner

Summary

Assessment of the project found the data pipeline and tests solid, but the UI had concrete gaps: no responsive breakpoints anywhere, fetch failures wiped the user's form input with no retry path, computed event categories were never surfaced, and the timeline started fully collapsed. This PR addresses those plus smaller polish items.

Functionality

  • Error recovery: the 500 path in +page.server.js now returns the submitted field values, so the form stays populated after a failure; the error alert gains a Try again button that resubmits the same values (requestSubmit() through the existing use:enhance flow)
  • Input hardening: maxlength="100" on name/location with a matching server-side guard; inputmode="numeric" on year fields

UX

  • Mobile responsiveness: sm: breakpoints across the form (year fields stack to one column), timeline (tighter indentation/dots), event cards, lifetime summary/oral history cards, and layout; heading sizes scale down on narrow viewports
  • Category badges: events' existing category field (conflict / upheaval / political / disaster / cultural) now renders as a small tinted pill on event cards
  • Auto-expand birth decade: the timeline opens with the character's birth decade expanded instead of a wall of collapsed rows ({#key} remount keeps this working across submissions)
  • Loading state: rotating archive-themed messages every 4s during long fetches, aria-busy on the submit button

Polish & accessibility

  • Warm goldenrod :focus-visible rings replacing default blue
  • sr-only live region announcing expanded decade count
  • Decade summary label reads "Events this decade" when nothing is hidden behind "Show more"
  • README/PLAN docs updated to match

Testing

  • npm run test — 86 tests pass
  • npm run build — clean
  • Drove the dev server: SSR output contains the responsive classes and hardening attributes; the form action round-trips successfully; the new length-guard returns the error with preserved field values
  • ⚠️ Visual checks at 375px/768px could not be done in this sandbox (headless-browser download and Wikipedia are blocked by the network allowlist) — the timeline dot/line offsets at mobile width are arithmetic estimates and worth a quick visual once-over

https://claude.ai/code/session_01U2zWLR5pw3C2WY1hgq3hHG


Generated by Claude Code

- Add sm: breakpoints across form, timeline, event cards, and layout so
  the app works on narrow viewports (fields stack, indentation tightens,
  headings scale down)
- Preserve form input on server fetch failure and add a "Try again"
  button to the error alert
- Surface event category (conflict/upheaval/political/disaster/cultural)
  as a themed badge on event cards
- Auto-expand the character's birth decade in the timeline
- Harden inputs: maxlength on name/location (client + server),
  inputmode=numeric on year fields
- Rotate loading messages during long fetches; add aria-busy
- Theme focus-visible rings to match the warm palette
- Add sr-only live region announcing expanded decade count
- Label decade summary "Events this decade" when nothing is hidden

https://claude.ai/code/session_01U2zWLR5pw3C2WY1hgq3hHG
@vercel

vercel Bot commented Jun 11, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
epoch Building Building Preview Jun 11, 2026 7:28am

@JasonWarrenUK JasonWarrenUK marked this pull request as ready for review June 14, 2026 15:59
@JasonWarrenUK JasonWarrenUK merged commit 5ef21bc into main Jun 14, 2026
2 checks passed
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.

2 participants