Skip to content

Convert unnecessary drawer navigation to flex Box#2021

Open
GregorShear wants to merge 2 commits into
mainfrom
claude/nav-drawer-to-box
Open

Convert unnecessary drawer navigation to flex Box#2021
GregorShear wants to merge 2 commits into
mainfrom
claude/nav-drawer-to-box

Conversation

@GregorShear

Copy link
Copy Markdown
Contributor

The old drawer-style navigation was abandoned (by setting a drawer prop variant="permanent") but the MUI drawer component was left in place.

This PR simplifies navigation and layout by replacing Drawer with Box (keeping the existing expand/collapse behavior that was bolted onto the old Drawer).

@github-actions

github-actions Bot commented Jul 1, 2026

Copy link
Copy Markdown

⚪ Code Health

No change to the dead-code surface.

60 Unused files

File imported nowhere — delete (or import) it.

     src/hooks/useDelay.ts
     src/hooks/useDraft.ts
     src/hooks/useExpressWorkflowAuth.ts
     src/pages/NoGrants.tsx
     src/pages/OAuth.tsx
     src/services/encryption.ts
     src/types/global.ts
     src/types/vitest.ts
     src/components/graphics/PoweredByEstuaryWatermark.tsx
     src/components/graphs/TaskHoursByMonthGraph.tsx
…and 50 more

157 Unused exports

Exported symbol with no references outside its own file — un-export it, or delete it if unused entirely

     src/context/Theme.tsx : sample_blue
     src/context/Theme.tsx : successDark
     src/context/Theme.tsx : infoMain
     src/context/Theme.tsx : logoColors
     src/context/Theme.tsx : chipDraggableIndex
     src/context/Theme.tsx : headerLinkIndex
     src/context/Theme.tsx : intensifiedOutlineThick
     src/context/Theme.tsx : tableAlternateRowsSx
     src/context/Theme.tsx : draggableChipIconSx
     src/context/Theme.tsx : hiddenButAccessibleInput
…and 147 more

103 Unused exported types

Exported type with no references outside its own file — un-export it, or delete it if unused entirely

     src/utils/dataPlane-utils.ts : ErrorFlags
     src/test/test-utils.tsx : AllTheProvidersProps
     src/stores/Tables/Store.ts : StatsSchema
     src/api/liveSpecsExt.ts : CaptureQueryWithSpec
     src/api/liveSpecsExt.ts : MaterializationQuery
     src/api/liveSpecsExt.ts : MaterializationQueryWithSpec
     src/api/liveSpecsExt.ts : CollectionQuery
     src/api/liveSpecsExt.ts : LiveSpecsExtQuery_DetailsForm
     src/api/liveSpecsExt.ts : LiveSpecsExtQuery_DataPlaneAuthReq
     src/api/liveSpecsExt.ts : LiveSpecsExtQuery_Latest
…and 93 more

14 Unused exported enum members

An enum member referenced nowhere

     src/services/supabase.ts : CONNECTOR_TAGS
     src/services/supabase.ts : DRAFTS_EXT
     src/services/supabase.ts : TASKS_BY_DAY
     src/stores/names.ts : QUEUED_TASKS
     src/stores/Tables/hooks.ts : accessGrants
     src/stores/Tables/hooks.ts : accessLinks
     src/stores/Tables/hooks.ts : billing
     src/stores/Tables/hooks.ts : connectors
     src/stores/Tables/hooks.ts : entitySelector
     src/stores/Tables/hooks.ts : prefixes
…and 4 more

5 Unused dependencies

In package.json but never imported

     package.json : @mui/lab
     package.json : @testing-library/jest-dom
     package.json : @urql/exchange-retry
     package.json : logrocket-react
     package.json : stripe

3 Unused devDependencies

In package.json devDependencies but never used

     package.json : @types/logrocket-react
     package.json : @types/react-inspector
     package.json : sharp

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR removes the leftover MUI Drawer used for a now-permanent navigation rail and replaces it with a simpler Box-based flex layout, while preserving the expand/collapse behavior via persisted local storage state.

Changes:

  • Replace MuiDrawer with a flex Box in the navigation component.
  • Move navigation open/closed persistence into Navigation (via useLocalStorage) and simplify Layout to a pure flex layout.
  • Replace NavWidths enum with a constant widths object.

Reviewed changes

Copilot reviewed 3 out of 4 changed files in this pull request and generated 3 comments.

File Description
src/context/Theme.tsx Converts NavWidths from an enum to a const object for navigation sizing.
src/components/navigation/Navigation.tsx Replaces Drawer with Box, adds persisted open/close state, and updates toggle behavior.
src/app/Layout.tsx Simplifies layout to a flex row with Navigation as a sibling (removes margin-based offsetting).
.gitignore Adds AGENTS.md to ignored files.
Comments suppressed due to low confidence (1)

src/components/navigation/Navigation.tsx:62

  • Stack is set to height: '100%' while also rendering a sibling <Toolbar /> above it. With the outer nav container at height: '100%', this makes the content always overflow by the toolbar height, causing a persistent scrollbar. Prefer flex sizing for the remaining space.
            <Toolbar />

            <Stack
                sx={{
                    height: '100%',
                    justifyContent: 'space-between',
                    overflowX: 'hidden',
                }}

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +35 to +38
const [nav, setNav] = useLocalStorage<{ open: boolean }>(
Keys.NAVIGATION_SETTINGS
);
const open = nav?.open ?? true;

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

IMO it's a wash either way and i have a slight preference for not writing to localstorage (which the default would do) unless the user actually interacts.

Comment on lines 116 to 119
<ListItemButton
component="a"
onClick={openNavigation}
onClick={() => setNav({ open: !open })}
sx={{

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

component="a": ✅ good catch

functional setter: passing for now - YAGNI?

Comment thread src/context/Theme.tsx Outdated

@jshearer jshearer left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM % a couple of optional nits

width,
height: '100%',
width: open ? NavWidths.FULL : NavWidths.RAIL,
flexShrink: 0,

@jshearer jshearer Jul 2, 2026

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The old permanent-Drawer paper was position: fixed at zIndex.drawer (1200), so it stacked above other fixed chrome. This plain Box has no z-index, so the AgentSkills Toast (position: fixed; right: 24; bottom: 24; width: 380; zIndex: 175, shown to every user until dismissed) now paints over the bottom of the nav on windows narrower than ~604px — covering the collapse toggle and ModeSwitch and stealing their clicks (the toast root has its own onClick).

Low severity since it only bites below the sm breakpoint, but it is a regression vs. the Drawer. A zIndex on this Box (or repositioning the toast) would restore the old stacking.

Comment on lines +56 to +57
transition: (boxTheme) =>
`${boxTheme.transitions.duration.shortest}ms`,

@jshearer jshearer Jul 2, 2026

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since this line is being rewritten anyway, worth cleaning up the carried-over Drawer idiom: a bare `${...}ms` shorthand means transition-property: all, so the background two lines up also animates on theme-mode switch, and the boxTheme callback duplicates the theme from useTheme() already in scope.

Suggested change
transition: (boxTheme) =>
`${boxTheme.transitions.duration.shortest}ms`,
transition: theme.transitions.create('width', {
duration: theme.transitions.duration.shortest,
}),

matches the pattern used elsewhere (e.g. WizardContent.tsx).

@GregorShear GregorShear force-pushed the claude/code-health-checks branch 4 times, most recently from a4152a1 to 604416d Compare July 2, 2026 20:20
Base automatically changed from claude/code-health-checks to main July 2, 2026 21:22
@GregorShear GregorShear force-pushed the claude/nav-drawer-to-box branch from cb9661b to 521e1bd Compare July 2, 2026 21:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants