Skip to content

Registry UI: fix theming bugs and small UX polish#1474

Merged
ricardo-devis-agullo merged 1 commit into
masterfrom
ui-improvements
May 24, 2026
Merged

Registry UI: fix theming bugs and small UX polish#1474
ricardo-devis-agullo merged 1 commit into
masterfrom
ui-improvements

Conversation

@ricardo-devis-agullo
Copy link
Copy Markdown
Collaborator

Summary

Small, low-risk UI/UX improvements to the registry web views and a new npm run preview script for previewing them locally. No interaction model changes.

Bug fixes (src/registry/views/static/style.ts)

  • Replace undefined --color-text-default with --color-text-primary on .componentRow .title .name and .componentRow .release (component name and version were silently falling back to inherited color).
  • Replace undefined --color-info with --color-text-secondary on .author.
  • .filters input no longer hard-codes color: #0f0f23; background-color: #eee; — filter inputs were broken in dark mode. Now uses the themed tokens.
  • Remove stray, invalid @media (min-width: 1024px) { margin-left: 15px; } block with no selector inside.
  • .info-item display: flow (not a valid CSS value) → display: flex, so the align-items: start actually applies on desktop.

Aesthetic polish (same file)

  • .stats-badge mini-chart bars now use three shades of brand indigo (--color-primary-light/--color-primary/--color-primary-dark) instead of unrelated green/red/blue.
  • Theme-toggle icon hover rotation reduced from 180° to 15° (less distracting on incidental mouse-overs).
  • Scrollbar thumb uses a flat --color-border-hover with --color-primary on hover, instead of the indigo→cyan gradient swap.
  • New .empty-state class for themed empty-state messages.

UX improvements

src/registry/views/partials/components-list.tsx

  • Remove autofocus from the search input (it was stealing focus and scrolling on every navigation, including back/forward and mobile).
  • Add aria-label to both filter inputs (placeholder-as-label is a common a11y issue).

src/registry/views/static/index.ts

  • Wrap the search regex in a safeRegExp helper so invalid patterns ([, c++, etc.) no longer throw an uncaught SyntaxError and break filtering.
  • Debounce the keyup handler at 80ms.
  • Focus the search input on initial load only when there is no URL hash, so deep-linking to a tab doesn't yank focus.
  • Tab clicks now call history.replaceState, so refresh and back/forward preserve the selected tab.
  • History tab's empty state uses the new .empty-state class instead of inline color: #64748b.

Tooling

  • Add npm run previewbun run preview/uiPreview.ts. Serves the mocked home and info views on http://localhost:4444 with auto-reload, using the existing preview/uiPreview.ts + preview/fakeVM.ts.

Verification

Local checks against npm run preview:

  • Home (/) and info (/:name/:version/~info) both return HTTP 200.
  • All targeted regression patterns absent from rendered HTML: --color-text-default, --color-info, display: flow, background-color: #eee, rotate(180deg), new RegExp(s), inline color: #64748b; padding: 2em.
  • All positive markers present: empty-state, rotate(15deg), aria-label="Filter by component …", safeRegExp, history.replaceState, debounce(.
  • Light and dark themes both render cleanly; filter inputs now match the theme.

Files changed

 package.json                                    |  1 +
 src/registry/views/partials/components-list.tsx |  3 +-
 src/registry/views/static/index.ts              | 44 +++++++++++++++++++---
 src/registry/views/static/style.ts              | 36 +++++++++--------
 4 files changed, 62 insertions(+), 22 deletions(-)

@ricardo-devis-agullo ricardo-devis-agullo merged commit 0f28b21 into master May 24, 2026
3 checks passed
@ricardo-devis-agullo ricardo-devis-agullo deleted the ui-improvements branch May 24, 2026 09:34
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