Skip to content
SprecherEast
Issue 468

tech-debt: Fixes the component gallery found: Button loading on the server, Media fill warning, planned variants in the docs

Back to our plan
Open
frontendtech-debtpriority: medium

Summary

Building the component gallery (#466) turned up three problems in shared components, and a fourth smaller gap. None is visible to visitors today, but each one will bite the next person who uses these components.

Details

  1. <Button loading> crashes any server component that renders it.
    • src/platform/ui/Button.tsx has no 'use client', and the loading state adds an onClick guard. React can't pass that from a server component, so the page returns a 500: "Event handlers cannot be passed to Client Component props".
    • Today loading only works inside client components, and nothing warns about it.
    • Fix: move the loading button's behavior into a small client part, so Button works anywhere, and add a test that renders <Button loading> from a server component.
  2. Media with fill logs a next/image warning on every use ("parent element with invalid position… static"). The <picture> it wraps the image in has no positioning. The image still lands in the right place, but every fill use warns: PageHeader · image and the media cards.
  3. docs/ui/component-set.md lists variants the code doesn't have.
    • Media: cover, background, thumbnail, framed, video, aspect, fallback. The component has fill, resource and src.
    • RichText: prose, compact, inverse. It has enableProse and enableGutter.
    • Either build them where a screen needs them or mark them as planned, so the doc says what exists.
  4. ThemeSelector exists but nothing renders it (knip.jsonc ignores it on purpose). Add it to the gallery, or decide where it belongs.

Acceptance criteria

  • Not done: <Button loading> renders from a server component, with a test.
  • Not done: No next/image fill warning in the console on a post page with a photo.
  • Not done: docs/ui/component-set.md marks every planned variant as planned, or the variant exists.
  • Not done: ThemeSelector is used or removed, and knip.jsonc drops its ignore.

Generated by Claude Code, opens in a new tab

See it on GitHub, opens in a new tab