Skip to content

feat(ui): rework the interface and front-end practices - #9

Closed
arnaud-zg wants to merge 1 commit into
test/testing-trophyfrom
feat/ui-ux-rework
Closed

arnaud-zg wants to merge 1 commit into
test/testing-trophyfrom
feat/ui-ux-rework

Conversation

@arnaud-zg

Copy link
Copy Markdown
Owner

Stacked on #8.

Summary

Correctness:

  • gate TanStackRouterDevtools behind dev mode, it was shipping to production
  • reportWebVitals() was called with no callback, its own guard made it a no-op
    forever. Wired it to forward Core Web Vitals to Umami
  • moved the lore video iframe out of ModalDescription (invalid HTML, and it left the
    dialog's accessible description empty), dropped ?autoplay=1
  • AnimatePresence wrapped a stable container instead of the cart items, so exit
    animations never fired

Accessibility:

  • --ring was too light to pass contrast in either theme, darkened both
  • modal close button hit area 16px to 44px
  • "Read Lore" was a button calling window.open(), now a real link
  • mobile cart toggle gets aria-expanded/aria-controls, the cart is a landmark, the
    product grid and cart items are real lists, cart total is aria-live

Design and layout:

  • a working light/dark/system theme toggle, using tokens that already existed in
    styles.css but nothing applied
  • replaced CRA-era hardcoded hex colors with the site's own tokens
  • fixed the product grid's premature 3-column squeeze between 1024 and 1280px, gave the
    sticky cart its own scroll region instead of growing past the viewport
  • extracted CartSummaryRow, removing ~80 duplicated lines from ShoppingCart.tsx
  • added a footer landmark, first one in the app
  • deleted dead files: an unimported stylesheet that would have broken the layout if
    anyone ever imported it, two unused primitives, two unused assets
  • fixed manifest.json, still named "TanStack App", and linked it

Performance: first 3 product cards load eagerly instead of lazy, preconnect to the image
host and to Umami.

flowchart LR
  A[CRA leftover colors] --> B[design tokens + dark mode]
  C[devtools always on] --> D[dev only, lazy]
  E[div grid] --> F[ul/li landmarks]
Loading

Not done here, called out for later: i18n extraction (next PR), OG image / canonical /
hreflang (the SEO PR after that).

Test plan

  • pnpm typecheck
  • pnpm check
  • pnpm test:coverage, 20 files, 112 tests, thresholds pass
  • pnpm build
  • pnpm test:e2e
  • Manually checked light/dark screenshots at 1280px for home and shop

🤖 Generated with Claude Code

https://claude.ai/code/session_014BcGPRc3sgUJYKihGRXh5g

Correctness:
- gate TanStackRouterDevtools behind import.meta.env.DEV and lazy-load it, it was
  shipping to production unconditionally
- reportWebVitals() was called with no callback, so its own guard clause made it a
  no-op forever. Wired it to actually forward Core Web Vitals to Umami
- moved the lore video iframe out of ModalDescription (a <p>, invalid HTML for an
  iframe, and it made the dialog's accessible description empty), gave it a real
  description, and dropped ?autoplay=1 (WCAG 1.4.2)
- AnimatePresence wrapped a single stable-keyed container instead of the cart items
  themselves, so item exit animations never fired

Accessibility:
- --ring was too light to pass 3:1 non-text contrast in either theme, darkened both
- the modal close button had a ~16px hit area, now 44px with a visible hover state
- "Read Lore" was a button that called window.open(), now a real link
- the mobile cart toggle gets aria-expanded/aria-controls, the cart is a landmark
  (<aside aria-labelledby>), the product grid and cart items are real lists
- cart items promoted from h4 to h3 (Your Inventory was h2 straight to h4), and their
  images and the product images go alt="" since the adjacent text already names them
- the cart total is aria-live, the free-shipping Free badge got real color contrast

Design and layout:
- a working light/dark/system theme toggle, using tokens that already existed in
  styles.css but nothing ever applied
- replaced the CRA-era hardcoded hex colors on the header and home page with the
  site's own tokens
- fixed the product grid's premature 3-column squeeze between 1024 and 1280px
  (xl: instead of lg:), gave the sticky cart a max-height with its own scroll
  region instead of growing past the viewport, dropped the mt-14 alignment hack
- extracted CartSummaryRow, removing ~80 lines of duplicated subtotal/shipping/tax
  markup from ShoppingCart.tsx
- added a footer landmark, first one in the app
- deleted dead files: styles/index.css (unimported Vite scaffolding that would have
  broken the layout if anyone ever did import it), sheet.tsx, input.tsx, react.svg,
  vite.svg
- fixed public/manifest.json, still named "TanStack App", and linked it from
  index.html

Performance:
- the first 3 product cards load eagerly with fetchpriority high instead of lazy,
  they're the ones competing for LCP
- preconnect to the image host and to Umami

Coverage-worthy new code got its own tests: theme.ts and ThemeToggle.

Not done here, called out for later: full i18n extraction (next PR), and the OG image /
canonical / hreflang pass (the SEO PR after that).

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_014BcGPRc3sgUJYKihGRXh5g
@arnaud-zg

Copy link
Copy Markdown
Owner Author

Superseded by #18 (combined testing trophy + UI rework).

@arnaud-zg arnaud-zg closed this Sep 2, 2026
@arnaud-zg
arnaud-zg deleted the feat/ui-ux-rework branch September 2, 2026 19:01
@arnaud-zg
arnaud-zg restored the feat/ui-ux-rework branch September 2, 2026 19:13
@arnaud-zg arnaud-zg reopened this Sep 2, 2026
@arnaud-zg

Copy link
Copy Markdown
Owner Author

Closing as stale/superseded — this branch stack's work already landed on main via a reorganized set of PRs (see #17, #7, #18, #10, #12, #13, #19, #16, #14, #20). Re-merging this branch now would conflict with / partially revert that work.

@arnaud-zg arnaud-zg closed this Sep 2, 2026
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