Skip to content

feat(styling): add flag-gated top navigation replacing sidebar - #3448

Merged
baktun14 merged 5 commits into
mainfrom
feat/styling-top-nav-replaces-sidebar
Jul 17, 2026
Merged

feat(styling): add flag-gated top navigation replacing sidebar#3448
baktun14 merged 5 commits into
mainfrom
feat/styling-top-nav-replaces-sidebar

Conversation

@baktun14

@baktun14 baktun14 commented Jul 16, 2026

Copy link
Copy Markdown
Contributor

Why

Closes CON-298

Console Redesign v2 moves primary navigation from the left sidebar to a single top nav bar: it frees horizontal space for content-heavy pages (configure deployment, deployment details), reduces cognitive load for the most-visited pages, and aligns with AkashML's nav structure. Design approved in Figma (see issue).

What

image image image image image

Everything ships behind a new ui_top_nav Unleash flag (off by default) — flag-off keeps the current sidebar chrome byte-for-byte; old components are removed in a post-rollout cleanup ticket.

  • TopNav: logo · Deployments / Providers / Templates (active state via aria-current) · Settings dropdown (Billing + Usage behind billing_usage, API Keys, Alerts behind alerts) · hackathon coupon entry · avatar menu. No wallet balance pill per product decision. Renders TopBanner and publishes --app-header-height like the old Nav (hook extracted to usePublishHeaderHeight and shared). Mobile: hamburger → Sheet with the same links. minimal mode preserves the stripped onboarding chrome.
  • TopNavAccountMenu: Profile → /user/settings, inline Theme (Light|Dark segmented control, keeps the SSR theme cookie), Docs (new tab), Privacy Policy, Terms of Service, Contact us, Log out; Sign up/Sign in when signed out.
  • Layout branches on the flag: TopNav-only chrome with full-width content when on, unchanged sidebar layout when off.
  • 17 new unit tests (flag gating, auth states, active links, minimal mode, logout, theme cookie).

Runtime-verified locally (Playwright against npm run dev):

  • flag on — nav links + active states, settings dropdown routes, avatar menu items, Light/Dark toggle (cookie persists, works with menu open), mobile sheet navigation, signed-out Sign up/Sign in on public pages, light + dark themes
  • flag off — sidebar chrome untouched (collapse button, deploy CTA, wallet pill, no top-nav DOM)

Rollout notes

  • ui_top_nav must be created in Unleash (off); local dev sees it ON via NEXT_PUBLIC_UNLEASH_ENABLE_ALL.
  • E2E page objects (tests/ui/pages/Sidebar.ts) navigate via the sidebar — update them before enabling the flag in test environments.
  • Trial banner is tracked separately in CON-321; old sidebar/nav component removal is a follow-up cleanup ticket.

Summary by CodeRabbit

  • New Features
    • Added an optional top navigation bar behind a feature flag, with primary links, settings dropdown, account menu, mobile side navigation, and active-page highlighting.
    • Added a Light/Dark theme toggle that saves the selected theme via cookies.
    • Settings dropdown items are now shown/hidden based on feature flags (e.g., billing/usage/alerts).
  • Bug Fixes
    • Improved responsive layout spacing by publishing header height and adjusting sidebar/mobile offsets when the top navigation is enabled.
  • Tests
    • Added UI tests for the theme toggle, top navigation, and account menu across signed-in/signed-out and feature-flag states.

@baktun14
baktun14 requested a review from a team as a code owner July 16, 2026 21:33
@coderabbitai

coderabbitai Bot commented Jul 16, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Warning

Review limit reached

You’ve reached a temporary PR review limit under our Fair Usage Limits Policy.

Your recent review volume is higher than typical usage, so adaptive limits are currently applied.

Next review available in: 7 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 85e21c64-2d94-497e-b87d-6e8db3b9701a

📥 Commits

Reviewing files that changed from the base of the PR and between 766b388 and 0766f8c.

📒 Files selected for processing (3)
  • apps/deploy-web/src/components/layout/TopNav/TopNav.tsx
  • apps/deploy-web/src/components/layout/TopNav/TopNavAccountMenu.spec.tsx
  • apps/deploy-web/src/components/layout/TopNav/TopNavAccountMenu.tsx
📝 Walkthrough

Walkthrough

The layout now selects a feature-flagged responsive top navigation with account controls, theme persistence, active routes, settings links, mobile navigation, and shared header-height synchronization.

Changes

Top navigation rollout

Layer / File(s) Summary
Feature-flagged layout integration
apps/deploy-web/src/types/feature-flags.ts, apps/deploy-web/src/components/layout/Layout.tsx
Adds ui_top_nav and switches between TopNav and Nav, updating sidebar visibility and layout spacing.
Shared header-height publishing
apps/deploy-web/src/components/layout/usePublishHeaderHeight.ts, apps/deploy-web/src/components/layout/Nav.tsx
Extracts header measurement and CSS variable synchronization into a reusable hook.
Top navigation shell
apps/deploy-web/src/components/layout/TopNav/TopNav.tsx, apps/deploy-web/src/components/layout/TopNav/TopNav.spec.tsx
Adds responsive navigation, active-route handling, settings links, feature-flag checks, minimal-mode behavior, and coverage for these paths.
Account and theme controls
apps/deploy-web/src/components/layout/TopNav/TopNavAccountMenu.tsx, apps/deploy-web/src/components/layout/TopNav/ThemeToggle.tsx, apps/deploy-web/src/components/layout/TopNav/*.spec.tsx
Adds account actions, authentication states, theme selection, cookie persistence, logout, profile navigation, and related tests.

Estimated code review effort: 3 (Moderate) | ~30 minutes

Possibly related PRs

Suggested reviewers: stalniy

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/styling-top-nav-replaces-sidebar

Comment @coderabbitai help to get the list of available commands.

@codecov

codecov Bot commented Jul 16, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 87.28814% with 15 lines in your changes missing coverage. Please review.
✅ Project coverage is 71.97%. Comparing base (e7d9050) to head (0766f8c).
⚠️ Report is 2 commits behind head on main.
✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
apps/deploy-web/src/components/layout/Layout.tsx 0.00% 5 Missing and 1 partial ⚠️
...src/components/layout/TopNav/TopNavAccountMenu.tsx 87.17% 5 Missing ⚠️
...deploy-web/src/components/layout/TopNav/TopNav.tsx 90.69% 4 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #3448      +/-   ##
==========================================
- Coverage   72.84%   71.97%   -0.87%     
==========================================
  Files        1168     1084      -84     
  Lines       29585    27420    -2165     
  Branches     7331     6939     -392     
==========================================
- Hits        21551    19736    -1815     
+ Misses       7070     6754     -316     
+ Partials      964      930      -34     
Flag Coverage Δ *Carryforward flag
api 85.98% <ø> (ø) Carriedforward from 766b388
deploy-web 62.30% <87.28%> (+0.49%) ⬆️
log-collector ?
notifications 91.44% <ø> (ø) Carriedforward from 766b388
provider-console 81.38% <ø> (ø) Carriedforward from 766b388
provider-inventory ?
provider-proxy 86.42% <ø> (ø) Carriedforward from 766b388
tx-signer ?

*This pull request uses carry forward flags. Click here to find out more.

Files with missing lines Coverage Δ
apps/deploy-web/src/components/layout/Nav.tsx 13.33% <ø> (+2.98%) ⬆️
...y-web/src/components/layout/TopNav/ThemeToggle.tsx 100.00% <100.00%> (ø)
...eb/src/components/layout/usePublishHeaderHeight.ts 100.00% <100.00%> (ø)
...deploy-web/src/components/layout/TopNav/TopNav.tsx 90.69% <90.69%> (ø)
...src/components/layout/TopNav/TopNavAccountMenu.tsx 87.17% <87.17%> (ø)
apps/deploy-web/src/components/layout/Layout.tsx 14.00% <0.00%> (-0.90%) ⬇️

... and 111 files with indirect coverage changes

🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@coderabbitai coderabbitai Bot 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.

Actionable comments posted: 2

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@apps/deploy-web/src/components/layout/TopNav/ThemeToggle.tsx`:
- Around line 25-28: Update onThemeClick to persist the theme cookie beyond the
current session by adding an appropriate Max-Age or Expires attribute to the
document.cookie assignment, while preserving the existing theme value and path.

In `@apps/deploy-web/src/components/layout/TopNav/TopNav.tsx`:
- Around line 55-67: Update isRouteActive in TopNav to match route prefixes only
when pathname equals the prefix or continues with a slash boundary, preventing
paths such as /providers-old from being marked active. Preserve the existing
multi-prefix behavior and pathname guard.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: ba50dd97-0d0d-468d-a133-f1c81db57a77

📥 Commits

Reviewing files that changed from the base of the PR and between f090e31 and 0692c63.

📒 Files selected for processing (10)
  • apps/deploy-web/src/components/layout/Layout.tsx
  • apps/deploy-web/src/components/layout/Nav.tsx
  • apps/deploy-web/src/components/layout/TopNav/ThemeToggle.spec.tsx
  • apps/deploy-web/src/components/layout/TopNav/ThemeToggle.tsx
  • apps/deploy-web/src/components/layout/TopNav/TopNav.spec.tsx
  • apps/deploy-web/src/components/layout/TopNav/TopNav.tsx
  • apps/deploy-web/src/components/layout/TopNav/TopNavAccountMenu.spec.tsx
  • apps/deploy-web/src/components/layout/TopNav/TopNavAccountMenu.tsx
  • apps/deploy-web/src/components/layout/usePublishHeaderHeight.ts
  • apps/deploy-web/src/types/feature-flags.ts

Comment thread apps/deploy-web/src/components/layout/TopNav/ThemeToggle.tsx
Comment thread apps/deploy-web/src/components/layout/TopNav/TopNav.tsx Outdated
baktun14 added 3 commits July 16, 2026 22:04
… refine spacing

Add sidebar-matching icons to the mobile nav links, give the sheet proper
padding so the logo no longer touches the edge, fold the account menu into
the single mobile hamburger via an inline variant, and widen the desktop
header padding.
@baktun14
baktun14 added this pull request to the merge queue Jul 17, 2026
Merged via the queue into main with commit c3efa34 Jul 17, 2026
57 checks passed
@baktun14
baktun14 deleted the feat/styling-top-nav-replaces-sidebar branch July 17, 2026 12:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants