Repository navigation
Fix header logomark collapsing on desktop - #115
Conversation
The header content (brand, seven links, Donate, GitHub button with the
live star count, theme button) needed about 1186px but the 1160px
container only offers 1096px. Every other header item has a fixed
minimum width, so flex shrinking fell entirely on the brand, and inside
it on the inline SVG logomark, whose min-content contribution is 0. The
logomark rendered 0px wide, leaving the "JanusGraph" text where the logo
should be. Because the star count arrives asynchronously from the GitHub
API, the logo appeared at first and vanished once the count rendered.
- Pin the brand and the logomark with `flex: none` so the header can
never collapse the logo again (it would overflow visibly instead)
- Move the star count out of the nav button into a hero chip
("5.8k stars on GitHub"), so header width no longer depends on an API
response; the nav button is now a fixed-width "GitHub"
- Tighten nav link padding and gaps
- Show the full nav only from 1200px, where it provably fits with room
to spare; below that the hamburger menu is used (this also fixes a
138px header overflow that existed at 1024px)
Verified with a Playwright check at 1024-1920px that the logomark keeps
its 34px size, the brand name never overlaps it, and the header content
fits, with the star count stubbed to the widest realistic value.
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Signed-off-by: Oleksandr Porunov <alexandr.porunov@gmail.com>
There was a problem hiding this comment.
Warning
Copilot couldn't run its full agentic review because it didn't start before the timeout. Make sure your repository has a runner available, or add a copilot-code-review.yml file specifying one with the runs-on attribute. See the docs for more details.
Pull request overview
This PR fixes the desktop header logo collapsing by preventing the brand from flex-shrinking, moving the GitHub star count out of the header (to avoid async width changes), and adjusting the responsive breakpoint so the full nav only renders when it fits.
Changes:
- Prevent
.brand/ logomark from shrinking so the logo can’t collapse to 0px width. - Relocate GitHub star count to a hero “chip” and adjust JS to unhide the new container.
- Tighten header spacing and raise the full-nav breakpoint to 1200px (hamburger below).
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| js/main.js | Updates desktop breakpoint logic and adjusts star-count reveal behavior for the new hero chip. |
| css/main.css | Pins brand/logomark flex behavior, tightens header spacing, updates responsive breakpoint, and hides hidden hero-meta items. |
| _includes/nav.html | Removes the async star-count element from the header GitHub button to stabilize header width. |
| _includes/hero.html | Adds a new star-count hero chip container that starts hidden and is revealed by JS. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
…eveal - Drop the duplicated 1200px breakpoint from main.js. The desktop state is now read from CSS (the nav toggle is hidden at the full-nav breakpoint), so the pixel value lives only in the stylesheet. - Also unhide the [data-stars] element itself when the count arrives, so the reveal does not depend on the wrapper pattern. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Signed-off-by: Oleksandr Porunov <alexandr.porunov@gmail.com>
There was a problem hiding this comment.
Warning
Copilot couldn't run its full agentic review because it didn't start before the timeout. Make sure your repository has a runner available, or add a copilot-code-review.yml file specifying one with the runs-on attribute. See the docs for more details.
Pull request overview
Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.
Turn isDesktopNav into a function expression inside the `if (toggle)` block and document that the toggle is non-null there and that the resize handler only reads a computed style while the mobile panel is open. No behaviour change. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Signed-off-by: Oleksandr Porunov <alexandr.porunov@gmail.com>
Summary
Fixes the header logomark disappearing on desktop after the redesign (#114). On the live site the logo next to "JanusGraph" rendered 0px wide at every desktop width, so the word sat where the logo should be, and the logo visibly vanished a moment after load.
Root cause
The header content (brand, seven links, Donate, the GitHub button with the live star count, and the theme button) needs about 1186px, but the 1160px container only offers 1096px of inner width. Every other header item has a fixed minimum width, so all flex shrinking landed on the brand, and inside it on the inline SVG logomark, whose min-content contribution is 0. Result: a 34px-tall, 0px-wide logo.
The star count arrives asynchronously from the GitHub API, which is why the logo appeared at first and then disappeared: the header was just wide enough until "5.8k" rendered. My earlier screenshots missed this because the API was rate-limited during testing, so the count never showed, and the theme-button screenshots were cropped to the right half of the header.
Fix
.brandand the logomark withflex: none, so the logo can never collapse again. A too-wide header now overflows visibly instead, which a check can catch.Screenshots
Before (live site, 1440px): the logomark is missing.
After, 1440px and 1200px: logomark intact, everything fits.
After, 1100px: hamburger menu below 1200px.
Star count in its new place (hero chip row):
Verification
🤖 Generated with Claude Code