Skip to content

refactor: extract shared layout components from default and paper themes #144

@rohilsurana

Description

@rohilsurana

Problem

The default and paper themes duplicate significant layout logic:

  • Sidebar rendering and tree traversal
  • Version switcher component
  • Content directory buttons/dropdown
  • Mobile menu handling
  • Icon rendering from config

This makes bug fixes and feature additions (like new sidebar features) require changes in two places.

Suggested Fix

Extract shared components into `src/themes/shared/` or `src/components/layout/`:

  • `SidebarTree` — recursive tree rendering with configurable depth, icons, and active state
  • `VersionSwitcher` — already exists as separate files but with duplicated logic
  • `ContentDirNav` — content directory buttons/dropdown selector
  • `MobileMenu` — slide-out menu with sidebar content

Each theme would compose these shared components with its own layout structure and styling.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions