Skip to content

Re-sync frontend UI primitives with the @nebari registry - #565

Merged
jbouder merged 5 commits into
mainfrom
chore/nebari-registry-sync
Sep 8, 2026
Merged

jbouder merged 5 commits into
mainfrom
chore/nebari-registry-sync

Conversation

@jbouder

@jbouder jbouder commented Sep 4, 2026 •

Copy link
Copy Markdown
Contributor

Part of nebari-dev/nebari-design#143
Closes #563

Summary

Re-syncs frontend/ against the @nebari shadcn registry and clears the drift that accumulated since #460.

  • Registry items re-added with --overwrite (alert, badge, button, card, code-block, dialog, dropdown-menu, input, navigation-menu, select, spinner, table, tabs, textarea, utils): code-block, select and table had drifted; the rest were already current. No exported API changed, so no callers needed edits.
  • @nebari/theme re-applied: src/index.css gains the new --info / --info-foreground tokens (light + dark) and their --color-info* @theme mappings. Everything else already matched globals.css. The only app-defined tokens left are --header-action-hover and --sign-out-foreground (nebi has no notification feed, so --notification-badge is intentionally not declared).
  • App-owned code moved out of registry-managed paths: confirm-dialog (+ test), split-button, user-badge now live in src/components/; capitalize moves to src/lib/strings.ts and the status colour helpers to src/lib/status.ts, so src/lib/utils.ts is the registry file again. Importers and tests updated; split-button got the explicit type="button" Biome flagged once it became lintable.
  • Theme hook replaced: the hand-rolled useThemePreference / useLocalStorageState are deleted in favour of @nebari/use-theme-preference (src/hooks/use-theme-preference.ts + theme-provider.tsx). ThemeProvider is mounted once in main.tsx with the existing nebi:themeMode key (src/lib/theme.ts), App reads useTheme(), and Layout / ProfileMenu take ThemeMode from the registry hook. index.html now carries the pre-paint bootstrap script generated by themeBootstrapScript('nebi:themeMode'), so a dark-mode user no longer sees a light flash. The old hook tests were ported to use-theme-preference.test.tsx (including a legacy-key restore case).
  • Header: the last hard-coded rgba() shadows are gone (shadow-sm for the selected theme option, shadow-[0_0_6px] shadow-primary/40 for the Local/Remote indicator dots), the profile menu is the recipe's 248px, and the brand link is labelled "Go to homepage". The header already used h-14 ... pl-4, bg-header text-header-foreground border-border, an h-8 w-auto logo, MenuBarActions gap-2, a menuitemradio theme picker and text-sign-out-foreground.
  • @nebari/claude-skill installed at frontend/.claude/skills/nebari-ui/SKILL.md. The repo-wide .claude/ ignore in the root .gitignore is narrowed to .claude/* + !.claude/skills/ so the installed skill is actually tracked.
  • Registry-owned hook files are excluded from Biome the same way src/components/ui already is.

Follow-up

  • Rebuild ProfileMenu on the registry DropdownMenu per the Nebari header recipe #564 — ProfileMenu is still a hand-rolled popover; rebuilding it on the registry DropdownMenu + Menu.RadioGroup per the header recipe is a structural change (it also changes the keyboard model the unit and e2e tests assert), so it is filed separately rather than folded into this parity sweep.
  • src/lib/status.ts and src/components/user-badge.tsx still use Tailwind palette classes (bg-yellow-100 etc.) rather than semantic tokens. They were moved verbatim; re-tokenising them is out of scope here.

nebari-dev/nebari-design#143 cross-cutting checklist (this repo)

  • Every file under src/components/ui/ that maps to a registry item is identical to registry/nebari/ui/<name>.tsx after Biome — 10 files are byte-identical; button, dialog, dropdown-menu, navigation-menu differ only by shadcn's alias resolution (@/ui/... → @/components/ui/..., 1 import line each). table.tsx's leading // biome-ignore-all comment, which the shadcn CLI strips on install, was restored so the file matches byte-for-byte.
  • Intentional local divergence moved out of components/ui/ into app-owned wrappers (confirm-dialog, split-button, user-badge) or src/lib/ (strings.ts, status.ts)
  • components.json declares @nebari → https://nebari-dev.github.io/nebari-design/r/{name}.json (already present)
  • Theme tokens match registry/nebari/globals.css (only --info* was missing); hand-rolled theme hook replaced by @nebari/use-theme-preference
  • @nebari/claude-skill installed — frontend/.claude/skills/nebari-ui/SKILL.md
  • App header matches the canonical recipe or the gap is filed — mechanical fixes applied here; the DropdownMenu composition gap is Rebuild ProfileMenu on the registry DropdownMenu per the Nebari header recipe #564
  • No hard-coded hex/rgb() colours in .tsx — grep -rnE '#[0-9a-fA-F]{3,8}\b|rgba?\(' src --include='*.tsx' --include='*.ts' outside components/ui/ returns nothing
  • @base-ui/react satisfies the registry's ^1.6.0 — nebi stays on ^1.7.0 (shadcn did not change it)
  • npm run ci, npm run build, npm test pass (39 files / 264 tests)

Test plan

  • npm run ci (Biome) — clean (the pre-existing "run biome migrate" info remains)
  • npm run build — passes
  • npm test — 264 passed
  • Playwright e2e (npm run test:e2e) — not run locally; CI covers it. The selectTheme helper still targets menuitemradio items by the same labels.

🤖 Generated with Claude Code

jbouder and others added 3 commits September 4, 2026 12:33
confirm-dialog, split-button and user-badge are nebi-specific wrappers, not
@Nebari registry items, so they now live in src/components/ instead of
src/components/ui/. Likewise capitalize and the status colour helpers move
from src/lib/utils.ts (registry-owned, cn() only) into src/lib/strings.ts and
src/lib/status.ts. Importers and tests follow; split-button gains the explicit
button type Biome requires now that it is linted.

Co-Authored-By: Claude Fable 5.1 <[email protected]>
Re-add every installed registry item with --overwrite (code-block, select and
table had drifted; the rest were already current), re-apply @nebari/theme
(adds the --info tokens) and install the @nebari/claude-skill so Claude Code
sessions in frontend/ get the nebari-ui skill. The repo-wide .claude/ ignore
now lets .claude/skills/ through so the installed skill is tracked.

Co-Authored-By: Claude Fable 5.1 <[email protected]>
Replace the hand-rolled useThemePreference/useLocalStorageState pair with the
registry's use-theme-preference + theme-provider, mounted once in main.tsx with
the existing nebi:themeMode storage key so saved preferences survive. App reads
theme state via useTheme(); Layout/ProfileMenu take ThemeMode from the registry
hook. index.html gains the pre-paint bootstrap script generated by
themeBootstrapScript('nebi:themeMode') so dark users no longer see a light
flash. The registry hook files are excluded from Biome like components/ui.

Header: drop the last hard-coded rgba shadows in favour of shadow-sm and
shadow-primary/40, size the profile menu at the recipe's 248px, and label the
brand link "Go to homepage".

Co-Authored-By: Claude Fable 5.1 <[email protected]>
Drop the horizontal padding around the Light/Dark/System control so it
matches the Nebari header recipe. The extra 16px left the muted track too
narrow for the three pills and the System option ran past its edge.

Co-Authored-By: Claude Fable 5.1 <[email protected]>
@jbouder
jbouder requested a review from MUFFANUJ September 4, 2026 18:41

@pmeier pmeier left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Minor comments.

Comment thread .gitignore Resolved
Store the registry-installed skill at frontend/.agents/skills so it is
agent-agnostic, and track frontend/.claude/skills as a symlink to it so
Claude Code (and shadcn re-syncs, which target .claude/skills) still
find it. Only the skills directory is linked so per-directory
settings.local.json files stay out of the tracked tree.

Generalize the .gitignore rules to **/.claude/* and **/.agents/*; the
previous .claude/* pattern was root-anchored and never applied to
frontend/.claude/.

Co-Authored-By: Claude Fable 5.1 <[email protected]>

@MUFFANUJ MUFFANUJ left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@jbouder
jbouder merged commit 0d9bd8a into main Sep 8, 2026
13 checks passed
@jbouder
jbouder deleted the chore/nebari-registry-sync branch September 8, 2026 14:01
tylerpotts added a commit to MUFFANUJ/nebi that referenced this pull request Sep 8, 2026
Resolve conflicts with nebari-dev#565, which made src/lib/utils.ts registry-owned
(cn() only) and split the app helpers into src/lib/status.ts and
src/lib/strings.ts. getWorkspaceVersionLabel moves out of utils.ts into a
new src/lib/versions.ts with its tests; VersionHistory and
RemoteWorkspaceDetail import it from there, and RemoteWorkspaceDetail
picks up main's relocated user-badge, status and strings imports.
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.

Re-sync frontend/ with the @nebari design registry

3 participants