← Back to Pull requests

fix(web/nav-rail): switch to the drawer only below mobileBreakpoint #316

Open
unknown opened this pull request with 453 lines diff across 5 files
View on GitHub
unknown unknown commented on Nov 15, 2026 01:50 UTC
Author

What this changes

NavRail.Provider now draws the drawer only when the viewport is narrower than mobileBreakpoint, as its prop doc says ("The viewport width below which the rail is a drawer"). Before, the query was (max-width: ${breakpoint}), which also matches at exactly the breakpoint. It is now (width < ${breakpoint}). The usage notes say where the boundary sits.

Why

Apps hide their own phone header with Tailwind's matching variant, and Tailwind v4 breakpoints are min-width. With mobileBreakpoint="64rem" and a header marked lg:hidden, a 1024px window got both at once: the rail turned into a closed drawer, and the header holding the trigger that opens it was hidden. The page was left with no navigation. 1024px is a common width (iPad landscape, small laptops), and the default 48rem has the same gap against md:. width < is the range syntax Tailwind v4 uses for its own max- variants, so the two now meet at the same pixel.

Type of change

  • Bug fix
  • How it was tested

    Web only. I applied the same change as a patch over panelui-web@0.17.0 in Outlayr's dashboard (mobileBreakpoint="64rem", phone header lg:hidden) and checked it in Chrome:

  • At 1023px the phone header shows and its trigger opens the drawer.

  • At 1024px and 1025px the rail is a 56px column and the header is hidden. Before, 1024px showed neither.
  • packages/web typecheck and build pass, and so do npm test and npm run lint. Docs, registry and skills are regenerated.

  • Light and dark themes
  • Screenshots

    Outlayr's dashboard at 1024×768.

    | | Light | Dark |
    | --- | --- | --- |
    | Before | <img src="https://raw.githubusercontent.com/danestves/PanelUI/pr-assets/nav-rail/breakpoint/before-1024-light.png" width="420" alt="Dashboard at 1024px in light mode with no rail and no phone header, so no navigation"> | <img src="https://raw.githubusercontent.com/danestves/PanelUI/pr-assets/nav-rail/breakpoint/before-1024-dark.png" width="420" alt="Dashboard at 1024px in dark mode with no rail and no phone header, so no navigation"> |
    | After | <img src="https://raw.githubusercontent.com/danestves/PanelUI/pr-assets/nav-rail/breakpoint/after-1024-light.png" width="420" alt="Dashboard at 1024px in light mode with the rail shown as a column"> | <img src="https://raw.githubusercontent.com/danestves/PanelUI/pr-assets/nav-rail/breakpoint/after-1024-dark.png" width="420" alt="Dashboard at 1024px in dark mode with the rail shown as a column"> |

    Checklist

  • npm run typecheck passes (packages/web)

  • npm run build passes (packages/web)

  • Commits follow Conventional Commits

  • apps/docs/scripts/web-usage/nav-rail.json updated

  • npm run docs:generate --workspace=docs has been run and the generated files are committed
  • Notes for the reviewer

    Range media queries need Chrome 104, Safari 16.4 or Firefox 63, the same floor Tailwind v4 already sets. This touches nav-rail/index.tsx and the generated nav-rail.json, as #313, #314 and #315 do, so whichever lands later needs docs:generate again.

    Created with Claude Opus 5.5 in T3 Code (Claude Code harness).

    <!-- This is an auto-generated comment: release notes by coderabbit.ai -->

    <!-- coderabbit-ai-generated:v1 -->

    Summary by CodeRabbit

    Bug Fixes
    The navigation rail now switches to its drawer layout only below the configured mobile breakpoint. At exactly the breakpoint, it remains in column layout.
    Documentation
    * Clarified the breakpoint behavior and noted that the default breakpoint is 48rem.

    <!-- end of auto-generated comment: release notes by coderabbit.ai -->

    Diff: 453 lines (+339 / -114) across 5 files Reviewer: coderabbitai[bot] Review duration: 10m
    All Vouch review confidence checks passed
    Residual risk 0.27 = Change Risk (0.45) × (1 − Review Confidence (0.41)). Review depth and reviewer attention state are adequate.
    Model 1 · Change Risk (XGBoost)
    Score: 0.45 · 453 lines diff across 5 files
    0.45
    Model 2 · Review Depth (DistilBERT)
    Depth Score: 0.02 · 1 substantive comment(s)
    0.02
    Model 3 · Review Timing & Attention
    Session adequacy: 91% · Reviewer familiarity: 35%
    40%
    Bedrock Claude 3 · Risk Narration
    (disconnected)
    Groq
    Groq Risk Narration
    AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
    Model 1 · Change Risk Attribution
    SHAP Weights
    Diff Size diff_size
    0.366
    Shallow Review Depth shallow_review_depth
    0.344
    Real PR Conversation Timeline
    1 comments
    "Review active on #316"
    general weight: 0.35
    Assignees
    Unassigned
    Labels
    risk: low confidence: 40.7% reviewed
    Vouch Risk Breakdown
    AI-powered review risk analysis
    Change Risk
    Change Risk · Model 1 (XGBoost)
    Predicted defect probability (0.00–1.00) based on diff churn, modified sensitive files, and author risk history.
    Score: 45.5% (MEDIUM) · Higher = larger blast radius
    45.5%
    Review Confidence
    Review Confidence · Models 2 & 3
    Scrutiny score (0.00–1.00) combining DistilBERT semantic review depth with reviewer familiarity and session dwell time.
    Score: 40.7% · Lower = rushed or shallow review
    40.7%
    Residual Risk
    Residual Risk · Core Equation
    Residual = Change × (1 − Confidence)
    Unmitigated risk surviving review. ≥ 0.65 triggers an automated re-queue to protect production.
    Score: 26.9% · Safe to merge
    26.9%