refactor(ui): align CommandDialog with upstream composition contract#5027
refactor(ui): align CommandDialog with upstream composition contract#5027ephraimduncan wants to merge 1 commit into
Conversation
|
|
Claude finished @ephraimduncan's task in 2m 16s —— View job ReviewClean, minimal, deletion-only realignment. Both variant files end up byte-identical apart from the flavor-specific dialog import, which matches the parallel Verified claims
Notes (non-blocking)
SimplifyThe simplification pass found no issues — the PR is itself a simplification (it deletes an abstraction layer), introduces no new state, effects, or duplication, and the only candidate nitpick (the redundant
|
|
Reviews (1): Last reviewed commit: "refactor(ui): align CommandDialog with u..." | Re-trigger Greptile |
What
Realigns
CommandDialogin the vendored command component (packages/ui/src/components/ui/{base,radix}/command.tsx) with shadcn upstream's current composition contract:showCloseButtondefault:true→false<Command className="[&_[cmdk-…]]…">auto-wrap;childrennow render directly insideDialogContentOmit<React.ComponentProps<typeof Dialog>, "children"> & { …; children: React.ReactNode }(children now required)Why
Registry items declare bare
"command"registryDependencies, which the shadcn CLI resolves against the official upstream registry — not our vendored copies. Upstream changedCommandDialogto render children directly (canonical usage passes an explicit<Command>child). A user following current shadcn examples against our vendored file gets nested cmdk roots (<Command>inside the auto-wrapped<Command>).Behavior change (old → new contract): callers must now pass an explicit
<Command>child and opt into the close button. No in-repo consumer usesCommandDialog(only definitions + exports), andtemplates/minimaldoes not shipcommand.tsx, so nothing needed migration.Deliberately deferred drift
Only the
CommandDialogcontract is synced. Upstream'sInputGroup-basedCommandInputand theCommandItemchecked-state indicator are not copied — upstream's version depends oninput-group, which has no Base twin in this repo. Upstream'scn-*classes are also skipped (this repo doesn't use that class system); the existing"overflow-hidden p-0"is kept.Verification
grep CommandDialogacross packages/apps/templates/examples → only definitions/exportspnpm sync-templates✓,pnpm lint✓,pnpm -C apps/registry build✓,packages/uitsc --noEmit✓packages/uiis private → no changeset