Rewrite frontend with shadcn/ui#1
Conversation
- Replace Tailwind CDN with build-time Tailwind v4 via @tailwindcss/vite - Init shadcn with Radix/Nova preset, dark mode via CSS variables - Sidebar: shadcn Sidebar with auto-collapse to Sheet on mobile - File tree: shadcn Collapsible + ScrollArea - Editor toolbar: shadcn Button, Input - History panel: shadcn ScrollArea, Button - Loading states: shadcn Skeleton - All panels use semantic color tokens (bg-accent, text-muted-foreground, etc.) - Mobile responsive: sidebar trigger + Sheet on narrow viewports Components added: sidebar, scroll-area, button, input, sheet, separator, collapsible, tooltip, skeleton
Deploying with
|
| Status | Name | Latest Commit | Updated (UTC) |
|---|---|---|---|
| ❌ Deployment failed View logs |
cf-artifact-viewer | cbc858c | Apr 21 2026, 10:57 PM |
| <SidebarMenuButton asChild isActive={false}> | ||
| <Link to="/$artifact" params={{ artifact: r.name }} search={{}} activeProps={{ className: "bg-sidebar-accent" }}> | ||
| {hasEdits ? "* " : ""}{r.name} | ||
| </Link> | ||
| </SidebarMenuButton> |
There was a problem hiding this comment.
🔴 asChild prop does nothing in Base UI's SidebarMenuButton — Link renders nested inside a button instead of replacing it
SidebarMenuButton is built on Base UI's useRender hook (src/components/ui/sidebar.tsx:513), which uses a render prop for element composition — not the asChild pattern from Radix UI. Passing asChild here means it falls through to ...props and gets spread as an unrecognized HTML attribute on the underlying <button> element. The <Link> child is rendered inside the button rather than replacing it, producing invalid HTML (<button> containing <a>) and potentially broken navigation/active-state styling.
Expected usage with Base UI's render prop
<SidebarMenuButton
render={<Link to="/$artifact" params={{ artifact: r.name }} search={{}} activeProps={{ className: "bg-sidebar-accent" }} />}
isActive={false}
>
{hasEdits ? "* " : ""}{r.name}
</SidebarMenuButton>Prompt for agents
In src/routes/__root.tsx at line 72-76, `SidebarMenuButton` is called with `asChild` which is a Radix UI concept. This component is built on Base UI which uses a `render` prop instead for element composition (see src/components/ui/sidebar.tsx:499-528 where `useRender` is used with a `render` prop). The `asChild` prop is ignored and falls through to the DOM as an invalid attribute, causing the `<Link>` to be rendered as a child inside a `<button>` rather than replacing it. This produces invalid HTML (button containing anchor) and may break navigation. Replace `asChild` with the `render` prop pattern: pass the `<Link>` element via `render` and move the text content to be children of `SidebarMenuButton`.
Was this helpful? React with 👍 or 👎 to provide feedback.
Summary
Test deployment
https://artifact-viewer-shadcn.iterate-dev-stg.workers.dev/
Screenshots
🤖 Generated with Claude Code
Note
Low Risk
Adds a
shadcn/uicomponents.jsonconfig file only; no runtime code paths change, so risk is minimal and limited to tooling/config expectations.Overview
Introduces
components.jsonto configureshadcn/uigeneration (style preset, Tailwind CSS entry atsrc/styles/app.css, and path aliases for~/components,~/components/ui,~/lib, and~/hooks).No application code changes are included in this diff; this is a tooling/config addition for consistent component scaffolding.
Reviewed by Cursor Bugbot for commit cbc858c. Bugbot is set up for automated code reviews on this repo. Configure here.