Skip to content

feat: adopt anfra-cloud's design system - #30

Merged
doanhthong merged 5 commits into
mainfrom
feat/anfra-cloud-style
Nov 2, 2026
Merged

doanhthong merged 5 commits into
mainfrom
feat/anfra-cloud-style

Conversation

@doanhthong

Copy link
Copy Markdown
Contributor

Summary

Makes the host look like the anfra-cloud web app by porting its design system and restyling the UI to match.

  • Tokens: src/index.css is a port of anfra-cloud's web/src/main.css:

    • the HDS primitive → semantic → shadcn-alias token tiers, for light and dark
    • Inter and Geist Mono, bundled with no CDN
    • named type roles (text-title, body, heading, label, caption). Tailwind's stock text sizes are switched off.
    • the 6/10/14 radius scale, the e1/e2 shadows, and the chart palette

    cn() now knows the type roles, so tailwind-merge keeps them.

  • UI primitives: all of src/components/ui/* takes its classes from the anfra-cloud components. Their APIs still work, but:

    • buttons are a step smaller (default h-8)
    • dialogs are narrower
    • CommandDialog has no close button by default
    • tooltips wait 400ms before showing
  • Shell: the sidebar, top bar, Home page, status line and theme toggle now use anfra-cloud's layout and nav styles:

    • the content area is a rounded panel beside the sidebar
    • the current nav item is a white chip
    • the page title uses the title type role
  • Panels: the prompt, versions and plugin panels and the command palette are restyled. The plugin panel and the palette are copied from their anfra-cloud counterparts. The Ask AI card gets anfra's violet and the HDS colors through setPluginTheme.

  • biome.json now ignores .claude/. A worktree's own biome.json there was breaking pnpm lint.

Deliberate differences

  • Sidebar header: it shows the logo plus "Demo". The typed "anfra" and the "demo" badge are gone, following DESIGN.md.
  • Prompt panel code chips: these are neutral, as in anfra-cloud, instead of reddish.
  • Not ported:
    • anfra-cloud's dark-mode logo, since this repo has a different logo file
    • the Home nav item and folder breadcrumbs, which would be new features

Testing

  • pnpm typecheck, pnpm lint, pnpm test (48/48) and pnpm build pass.
  • I looked at Home in light and dark with the anfra server down.
  • Not yet checked in a browser: an open Data App, the prompt, versions and plugin panels, the command palette and the Ask AI card. To check them, run pnpm dev:anfra.

🤖 Generated with Claude Code

doanhthong and others added 5 commits November 2, 2026 11:57
Port anfra-cloud web's tokens (HDS tiers, Inter and Geist Mono, type roles
in place of stock text sizes, 6/10/14 radii, e1/e2 elevation) and restyle
the shadcn primitives, the shell and the side panels to match it. The Ask
AI card takes anfra's violet and tokens through the plugin theme.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
- Truncate long endorsed app names in the sidebar, and put the logo back in the home link
- Keep disabled toolbar and panel commands still on hover and press
- Drop the focus outline on menu items, which show focus by their highlight
- Go home in place from the missing-app screen
- Share one ErrorAlert between the shell and the stage
- Take the Ask AI card's hover and pressed colours from the SDK's tokens
- Remove AppIcon's unused overlay

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- Show keyboard focus on panel tabs and sidebar items, which their containers clipped
- One isPlainClick check for in-place links, now also skipping alt-clicks
- Home's URL is `/`, so Go home lands where its href says
- aria-disabled styling lives in buttonVariants, not in each caller
- Single spacing in the About popover
- Clear data-pressing when the rail loses pointer capture
- Restore the Endorsed tooltip on the check mark
- Ask AI card radii follow the SDK's radius; drop fallbacks for tokens the SDK always sets
- Drop SidebarRail classes the primitive already has

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- Layer the global focus offset under the utilities, so inset focus rings on panel tabs and sidebar items apply
- Hand plugins the SDK's designTheme(), reading the anfra-design properties the page now defines: 10px control radius, and the hover, active, selected, sunken, warning and success tokens
- Draw the Ask AI menu's elevation as a 1px ring in dark mode
- Set data-pressing only once the rail holds the pointer, so it can't stick
- Drop the sidebar's own 0ms tooltip delay, so the app's applies

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@doanhthong
doanhthong merged commit 9504438 into main Nov 2, 2026
1 check passed
@doanhthong
doanhthong deleted the feat/anfra-cloud-style branch November 2, 2026 05:56
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