Skip to content

fix(ui): resolve review findings across existing primitives - #843

Open
jim-fung wants to merge 1 commit into
cosscom:mainfrom
jim-fung:fix/primitive-review-findings
Open

fix(ui): resolve review findings across existing primitives#843
jim-fung wants to merge 1 commit into
cosscom:mainfrom
jim-fung:fix/primitive-review-findings

Conversation

@jim-fung

@jim-fung jim-fung commented Aug 31, 2026

Copy link
Copy Markdown

Summary

Fixes from an extensive review of the existing primitives (all 54 components, verified against the Base UI 1.6 typings and shipped docs, apps/ui/AGENTS.md conventions, and cross-sibling consistency).

Bugs

  • Sidebar — write the state cookie via document.cookie: the Cookie Store API is unavailable in Firefox/Safari and non-secure contexts, so every toggle threw an unhandled ReferenceError. Also aligns the useMediaQuery md breakpoint (800px) with Tailwind's md (768px); between 768–799px the desktop layout rendered while the component behaved as mobile.
  • ToggleGroup — stop defaulting variant/size on the group so per-item props are honored (<ToggleGroupItem variant="outline"> previously rendered as default). Group-level visuals are unchanged when unset.
  • Menu / Context Menu — emit data-inset only when set: data-inset="false" still matches Tailwind v4's presence selector data-inset:, which applied inset padding to non-inset items.
  • Combobox — merge triggerProps/clearProps className via cn instead of letting the spread drop the trigger/clear positioning classes.
  • EmptyEmptyMedia spread props on both the wrapper and the inner icon element (duplicate ids, double-fired handlers).
  • Button — keep type="button" when render={<button />} (implicit-submit risk in forms), and use focusable aria-disabled (styled, pointer-blocked) for non-button renders instead of an invalid disabled attribute.
  • Autocomplete — the popup visual/animation classes sat on a wrapper <span> while Base UI applies the open/close state attributes to the Popup itself, so no enter/exit animation ran. Also adds the missing exit states to Popover.

Consistency

  • Toolbar honors orientation="vertical" (was a hardcoded flex row while Base UI flipped the roving-tabindex keys).
  • AlertDialog popup drops its focus outline; AlertDialogHeader/AlertDialogFooter support render like their dialog/sheet/drawer counterparts.
  • AccordionPanel applies consumer className to the panel element; missing data-slots added (checkbox-group, meter, scroll-area, field-control, field-validity).
  • RadioGroup matches CheckboxGroup's items-start; group.tsx fixes its cn import path, always emits data-orientation, and GroupSeparator flips horizontal inside vertical groups.
  • PreviewCardPopup uses the preview-card-popup data-slot, exposes side; PreviewCardCreateHandle and SheetCreateHandle added.
  • Dead utility classes removed from command, drawer, sheet, and otp-field.

Test plan

  • bun run typecheck, lint, format
  • registry:validate-deps, registry:build, ui:sync
  • docs app production build (81/81 pages)
  • Visual pass on menu inset padding, vertical toolbar, toggle-group per-item variants, popover/autocomplete animations

Notes

Bugs:
- sidebar: write the state cookie via document.cookie (Cookie Store API
  is unavailable in Firefox/Safari/non-secure contexts) and align the
  useMediaQuery md breakpoint with Tailwind's 768px so the 768-799px
  window no longer mixes desktop layout with mobile state
- toggle-group: stop defaulting variant/size on the group so per-item
  props win; the group still renders its default look when unset
- menu/context-menu: emit data-inset only when inset is set; the
  presence selector matched data-inset="false" and applied inset padding
- combobox: merge triggerProps/clearProps className via cn instead of
  letting the spread drop the positioning classes
- empty: EmptyMedia no longer spreads props on both the wrapper and the
  inner icon element (duplicate ids, double-fired handlers)
- button: keep type="button" when render is a native button, and use
  aria-disabled (focusable, pointer-blocked) instead of an invalid
  disabled attribute for non-button renders
- autocomplete: move popup visuals onto the Popup element so the
  enter/exit animations actually run, and add the missing exit states
  to Popover

Consistency and conventions:
- toolbar: honor orientation=vertical with flex-col
- alert-dialog: drop the popup focus outline; Header/Footer support
  render like their dialog/sheet/drawer counterparts
- accordion: apply consumer className to the panel element
- radio-group: align items to the start like checkbox-group
- group: fix the cn import path, default data-orientation, and flip
  GroupSeparator inside vertical groups
- preview-card: use the preview-card-popup data-slot, expose side, add
  PreviewCardCreateHandle; add SheetCreateHandle
- add missing data-slot attributes (checkbox-group, meter, scroll-area,
  field-control, field-validity)
- remove dead utility classes in command, drawer, sheet, otp-field
@vercel

vercel Bot commented Aug 31, 2026

Copy link
Copy Markdown

@jim-fung is attempting to deploy a commit to the cal Team on Vercel.

A member of the Team first needs to authorize it.

@vercel
vercel Bot temporarily deployed to Preview – coss-com-origin August 31, 2026 19:27 Inactive
@vercel

vercel Bot commented Aug 31, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Actions Updated (UTC)
coss-com-origin Skipped Skipped Aug 31, 2026 7:27pm

Request Review

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant