Skip to content

refactor: investigate replacing Sidebar tablet overlay with shared Drawer component #918

@Aureliolo

Description

@Aureliolo

Context

PR #917 (feat/frontend-polish) implements a tablet-mode overlay sidebar with backdrop, FocusScope trap, Escape-to-close, and close-on-navigate behavior. CodeRabbit flagged that this custom overlay duplicates modal behavior that the shared Drawer component already centralizes.

Current state

The sidebar overlay (Sidebar.tsx lines 116-160) uses:

  • Manual backdrop div with onClick close
  • <aside> with role="dialog" and aria-label
  • Radix FocusScope trapped loop
  • Custom Escape key handler
  • Close-on-navigate via useEffect on location.pathname

Investigation needed

The shared Drawer component (web/src/components/ui/drawer.tsx) is a right-side slide-in panel. The sidebar overlay is a left-side panel with unique content (navigation items + footer with WS status, collapse toggle, command palette).

Evaluate:

  1. Can Drawer be adapted to support left-side rendering?
  2. Does Drawer's focus trap and backdrop behavior match what the sidebar needs?
  3. Would the refactoring simplify the Sidebar component meaningfully?
  4. Are there any behavioral differences that would be lost (close-on-navigate, specific ARIA attributes)?

Source

Found by CodeRabbit (PR #917, inline comment on Sidebar.tsx:159), validated by local review agents.

Acceptance criteria

  • Evaluate feasibility of using Drawer for sidebar overlay
  • If feasible, refactor Sidebar to use Drawer (or add side prop to Drawer)
  • If not feasible, document why in a comment in Sidebar.tsx

Metadata

Metadata

Assignees

No one assigned

    Labels

    scope:smallLess than 1 day of worktype:refactorCode restructuring, cleanupv0.5Minor version v0.5v0.5.1Patch release v0.5.1

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions