PLEASE ANALYSE VISUALLY: .xdocs/figma/nav-over-breakpoints.jpg
Sidebar visual details:
<sidebar_visual_details>
- Persistent rail navigation (narrow vertical bar)
- Icons only, no labels visible
- Interaction: When user clicks an icon in the rail (screenshot 3), it navigates directly, no tooltip/popover
- Top bar now shows full logo ("DevOverflow") + search field
- Two-column layout: rail + main content
- Persistent sidebar with icons + labels
- Fixed width (appears ~220px /
w-56) - Same nav items as mobile sheet
- Two-column layout: sidebar + main content
- Full left sidebar (unchanged)
- Main content (centre)
- Right sidebar with contextual widgets e.g. "Top Questions" in screenshot (5)
- Three-column layout
- Pages requiring right sidebar: root, ask-question, collections.
</sidebar_visual_details>
Breakpoint analysis:
<breakpoint_analysis>
| # | Breakpoint | Range | Layout |
|:--|:-----------|:------|:-------|
| 1 | `< sm` | 0–639px | Mobile, nav closed |
| 2 | `< sm` | 0–639px | Mobile, nav open (sheet) |
| 3 | `sm` to `lg` | 640–1023px | Icon-only sidebar |
| 4 | `lg` to `xl` | 1024–1279px | Full sidebar |
| 5 | `≥ xl` | 1280px+ | Full sidebar + right sidebar |</breakpoint_analysis>
<important_implementation_notes>
This sidebar is the desktop version of components/mobile-nav:
- Applies to all pages
- The links used must mirror what is already implemented
- The buttons must be the same too - "Sign in", "Sign up", "Sign out"
- Links are positioned at the top, whilst buttons are aligned at the bottom. Essentially, two groups placed in different positions.
- ❓🔥 Does
mobile-nav.tsxneed to be refactored?
- ❓🔥 Does
- Active state of route - mirror
mobile-nav.tsx - Styling - centralised theming like
mobile-nav.tsxEXCEPT usebackgroundshadcn/ui semantic colour. - Mobile-first approach: Tailwind uses mobile-first breakpoints. Unprefixed utilities apply to all screens; prefixed utilities (e.g.,
sm:,md:,lg:etc.) apply at that breakpoint and above. </important_implementation_notes>
Current Route Structure:
app/(root)
├── (with-right-sidebar)
│ ├── layout.tsx ← includes Future RightSidebar
│ ├── page.tsx ← home
│ ├── ask-question
│ │ └── page.tsx
│ └── collections
│ └── page.tsx
├── (without-right-sidebar)
│ ├── community
│ │ └── page.tsx
│ ├── jobs
│ │ └── page.tsx
│ ├── profile
│ │ └── page.tsx
│ └── tags
│ └── page.tsx
└── layout.tsx ← shared: Navbar + LeftSidebar
Various flex properties that could be helpful
<flex_properties>
| Property | Docs | Description | Applicable? |
|---|---|---|---|
| Flex Direction | flex-col |
Sets item direction in container (row, column, row-reverse, column-reverse) | ✅ Core — use flex-col to stack nav groups vertically |
| Justify Content | justify-between |
Positions items along main axis; spreads items to container edges | ✅ Critical — use justify-between to push top 6 links up, bottom 2 down |
| Align Items | items-center |
Aligns items along cross-axis (perpendicular to main) | ✅ Useful — centre-align icons/labels horizontally within sidebar width |
| Flex Grow | grow |
Defines how items grow to fill available space proportionally | |
| Flex Shrink | shrink-0 |
Prevents items from shrinking when space is limited | shrink-0 on nav links to maintain consistent dimensions |
| Flex Basis | basis-16 |
Sets initial size of item before growing/shrinking | |
| Flex | flex-1 |
Shorthand for grow + shrink + basis together | flex-1 on spacer if using spacer approach (prefer justify-between) |
| Align Self | self-end |
Overrides container alignment for a specific item |
</flex_properties>
Remember, analyse mobile-nav.tsx - does it use flex already, and if not, should we refactor?