Skip to content

Fix header logomark collapsing on desktop - #115

Merged
porunov merged 3 commits into
masterfrom
fix/header-logo-collapse
Sep 16, 2026
Merged

porunov merged 3 commits into
masterfrom
fix/header-logo-collapse

Conversation

@porunov

@porunov porunov commented Sep 16, 2026

Copy link
Copy Markdown
Member

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

  • Pin .brand and the logomark with flex: none, so the logo can never collapse again. A too-wide header now overflows visibly instead, which a check can catch.
  • Move the star count out of the nav button into a hero chip ("5.8k stars on GitHub"). The nav button is a fixed-width "GitHub", so header width no longer depends on an API response.
  • 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 is used. This also removes a 138px header overflow that existed at 1024px.

Screenshots

Before (live site, 1440px): the logomark is missing.

Header before the fix: logomark missing

After, 1440px and 1200px: logomark intact, everything fits.

Header after the fix at 1440px

Header after the fix at 1200px

After, 1100px: hamburger menu below 1200px.

Header at 1100px with hamburger menu

Star count in its new place (hero chip row):

Hero chips including 5.8k stars on GitHub

Verification

  • A Playwright check at 1024, 1100, 1200, 1280, 1366, 1440 and 1920px with the star count stubbed to a five-digit value: the logomark stays 34×34, the brand name never overlaps it, and neither the header nor the page overflows. This check fails 14 times against the current live site and passes on this branch.
  • Theme menu and keyboard tests, the device screenshot regression pass, and axe-core (0 violations) all still pass.

🤖 Generated with Claude Code

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>
@porunov
porunov requested a balanced review from Copilot September 16, 2026 13:38

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

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.

Comment thread js/main.js Resolved
Comment thread js/main.js Resolved
…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>
@porunov
porunov requested a balanced review from Copilot September 16, 2026 14:13

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

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.

Comment thread js/main.js Resolved
Comment thread js/main.js Resolved
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>
@porunov
porunov merged commit 857012c into master Sep 16, 2026
3 checks passed
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.

2 participants