Skip to content

Review sidebar mechanisms (Sidebar, SidebarDrawer, transitions) #911

@frano-m

Description

@frano-m

Background

While working on filter popover positioning (#912 / fran/278-filter-position), we noticed the SidebarDrawer (src/components/Layout/components/Sidebar/components/SidebarDrawer/sidebarDrawer.tsx) is a styled MUI Popover made to look like a left-anchored drawer:

  • Anchored at (0,0) via anchorReference="anchorPosition", marginThreshold={0}
  • Sized to 312px × 100vh through MuiPaper-root overrides
  • Uses the filter folder's DrawerTransition (Slide) to fake the slide-in
  • Carries hacks: box-shadow: 0 1px 4px 0 transparent (with the comment "possible bug — box shadow 'none' affects rendering of main content") and overflow: visible so the close IconButton can render outside the paper

Meanwhile, the filter drawer surface (src/components/Filter/components/surfaces/drawer/Drawer/drawer.tsx) uses MUI <Drawer> directly. So we have two different "drawer" implementations sitting next to each other.

What to review

Loose scope — not committing to a specific refactor up front. Worth taking a step back and looking at the sidebar mechanism as a whole:

  • SidebarDrawer: should this be MUI <Drawer> instead of a styled Popover? Pros: built-in modal/backdrop/focus/Escape behavior, drops the box-shadow & overflow: visible workarounds, alignment with the filter drawer surface. Trade-off: the close IconButton currently positions outside the paper, so layout would shift.
  • Permanent vs. temporary sidebar split (Sidebar.tsx): is the breakpoint-based swap between PermanentSidebar and SidebarDrawer still the right shape? Could be unified.
  • DrawerTransition reuse: SidebarDrawer imports the filter's DrawerTransition. If SidebarDrawer becomes a real Drawer, the filter's transition stays put and the cross-folder dependency goes away.
  • Two drawer surfaces in the codebase: confirm whether SidebarDrawer and the filter Drawer should share an abstraction or stay distinct.

Out of scope

Notes

Spec is intentionally exploratory. Investigation comes first; implementation decisions follow from what the review surfaces.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions