Skip to content

fix(navbar): make non-scrolled blog navbar full width on desktop#384

Open
mvanhorn wants to merge 2 commits into
keploy:mainfrom
mvanhorn:fix/issue-3428-navbar-full-width
Open

fix(navbar): make non-scrolled blog navbar full width on desktop#384
mvanhorn wants to merge 2 commits into
keploy:mainfrom
mvanhorn:fix/issue-3428-navbar-full-width

Conversation

@mvanhorn
Copy link
Copy Markdown

@mvanhorn mvanhorn commented May 5, 2026

Closes keploy/keploy#3428

What this PR does

In components/navbar/FloatingNavbar.tsx, the navWidthClasses ternary now resolves to w-full md:max-w-none for the non-scrolled state instead of w-[96%] md:max-w-6xl. The scrolled-state branch (w-[82%] md:max-w-5xl) is unchanged.

Net diff: 1 line in 1 file.

Why

The blog landing page's expanded navbar was being capped at max-w-6xl (72rem = 1152px) on desktop, so on a 1920px-wide viewport it rendered as ~60% of the header bar — visually about 80% (which is what the issue screenshot shows). The issue specifically asks for parity with keploy.io's landing-page navbar, which spans the full header.

The container that wraps <FloatingNavbar /> (components/header.tsx line 33) is fixed left-0 right-0 z-30 w-full ... and has no horizontal padding, so removing the max-width cap from the expanded navbar lets it fill the viewport, matching the issue's described behavior.

The non-blog-reading positioning class (fixed left-1/2 -translate-x-1/2) keeps the navbar centered, and w-full plus the -translate-x-1/2 math results in a centered full-width element. The blog-reading positioning class (relative top-0 mx-auto) similarly works with w-full.

What's NOT changed

  • The scroll-to-shrink animation (the isScrolled branch returns w-[82%] md:max-w-5xl exactly as before).
  • The padding ternary navPaddingClasses.
  • The shadow / glass / radius classes.
  • Any other component or page.

Verification

  • npm install succeeded (490 packages).
  • WORDPRESS_API_URL=https://example.com npm run lint passes — only pre-existing warnings appear in unrelated files (components/post-body.tsx, components/testimonials.tsx, etc.); no new errors or warnings on FloatingNavbar.tsx.
  • I do not have a live WordPress instance to spin up the dev server end-to-end; the change is a Tailwind class swap whose behavior is fully determined by the parent layout (components/header.tsx's w-full wrapper). Maintainer should still browser-check before merge — labeled draft for that reason.

Note re: PR #334

PR #334 ("Fix: Align Hero Section and Navbar Widths") is open and also touches FloatingNavbar.tsx, but it pursues a different alignment goal (capping at 1200px and adding hero/testimonials padding). The change here is independent of that work and addresses issue #3428 specifically (full-width expanded navbar). Happy to rebase if #334 lands first.

Closes keploy/keploy#3428

The expanded (non-scrolled) blog navbar was capped at `w-[96%] md:max-w-6xl`,
which on >=1280px viewports rendered as ~80% of the header — out of step
with keploy.io's landing-page navbar that spans the full header.

Changing the expanded width classes to `w-full md:max-w-none` lets the
navbar fill its parent (the `Header` wrapper at `components/header.tsx`
line 33 is `fixed left-0 right-0 z-30 w-full ...`, so this resolves to
100% of the viewport on desktop). The scrolled state is unchanged —
`w-[82%] md:max-w-5xl` still applies, and the existing scroll-shrink
animation is preserved verbatim.

Single-line diff in the `navWidthClasses` ternary; no other components
or styles touched.

Signed-off-by: Matt Van Horn <455140+mvanhorn@users.noreply.github.com>
@mvanhorn mvanhorn force-pushed the fix/issue-3428-navbar-full-width branch from 42caa09 to 60b0c60 Compare May 5, 2026 10:06
@nehagup nehagup requested a review from Copilot May 5, 2026 13:33
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Adjusts the blog’s floating navbar expanded (non-scrolled) desktop layout to span the full header width, aligning with the desired visual parity for the blog landing page.

Changes:

  • Updated the non-scrolled navWidthClasses from a capped desktop max-width (md:max-w-6xl) to an uncapped full-width configuration (w-full md:max-w-none).
  • Left the scrolled/shrunken navbar width branch unchanged (w-[82%] md:max-w-5xl).

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

Comment thread components/navbar/FloatingNavbar.tsx Outdated
Comment on lines +45 to +47
const navWidthClasses = isScrolled
? "w-[82%] md:max-w-5xl"
: "w-[96%] md:max-w-6xl";
: "w-full md:max-w-none";
Per Copilot review feedback: w-full applied at every breakpoint and lost
the previous mobile gutter. Restore w-[96%] on mobile, lift to full-width
at md: so the desktop intent is preserved without edge-to-edge mobile.
@mvanhorn mvanhorn marked this pull request as ready for review May 5, 2026 16:27
@mvanhorn
Copy link
Copy Markdown
Author

mvanhorn commented May 5, 2026

Fixed in 2f9caab -- restored w-[96%] on mobile and scoped the full-width to md: so the desktop change is preserved without making the mobile navbar edge-to-edge. Thanks for catching that.

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.

[blog-website]: Fix blog navbar alignment on desktop

2 participants