feat(fuselage): Migrate `Sidebar` and `Sidepanel` to `Item` components
Proposed changes (including videos or screenshots)
Renders the Sidebar and Sidepanel components with the Item family from #2281. The public rcx-sidebar-* classes stay in place.
SidebarItem, its parts andSidebarLinkrender withItem,ItemMedia,ItemIcon,ItemContent,ItemRow,ItemTitle,ItemDescription,ItemMetaandItemActions.- New optional
labelprop onSidebarItemIconnames the icon for assistive technology. SidebarGroupTitle,SidebarCollapseGroupandSidebarCollapseGroupMenurender asItemGroupHeader,ItemGroupandItemActions. The collapse group's list is named by its title. This keeps the restyled collapse group header from #2285.- Sidebar rows, links and the collapse group header use the
mdinset from theItemscale, set inside the components. It replaces the fixed 12px inset, and headers and rows line up. SidebarItemcan render as a container row: passis='div'and put the newSidebarItemLinkinsideSidebarItemTitle. Only the title is the link, and it covers the whole row, so menus and buttons sit beside it instead of inside it. The newSidebarItemActionsholds always-visible buttons, such as accepting or rejecting a call.SidebarItemalso gets ahighlightedprop. Adivrow dropshref,target,relanddownload. The default anchor row is unchanged.SidebarDividerrenders asItemDivider.SidepanelListrenders as anItemGroupandSidepanelDivideras anItemDivider, keeping the full-width line underSidepanelHeader.- Fix: a hidden
ItemActions reveal='hover'no longer leaves its container's gap behind inItem,ItemRoworItemGroupHeader. Trailing content lines up with rows without actions and doesn't shift when the actions appear. - Fix:
SidebarCollapseGroupno longer passes itsactionsprop to the DOM.
Issue(s)
Related: RocketChat/Rocket.Chat#42520, which applies the Item components in Rocket.Chat.
Further comments
This PR used to hold the whole Item migration. It is now split into three independent PRs off main:
- this PR: Sidebar and Sidepanel
- #2310: Options, Select and Menu (merge first)
- #2311:
ItemMetatruncate
The hidden-actions gap fix is the first commit here and in #2310, because both PRs start rendering ItemActions reveal='hover'. Whichever merges second drops the duplicate when rebased onto main.
If #2310 merges first, this PR needs a rebase and yarn jest -u. Only generated React ids in the Sidebar and Sidepanel snapshots change.
Not changed here: SidebarLink still renders its menu inside its anchor. Moving it out changes the DOM for existing callers, so it belongs in a separate fix. Container rows are the way to keep menus and buttons out of the link.
Each component change has jest-axe coverage and updated snapshots. Container rows also have specs checking that no button sits inside the link and that the link is named by its title alone. fuselage.api.md and the visual-regression snapshots were regenerated for this branch.
š¤ Generated with Claude Code