Skip to content

fix: responsive layout bugs - tooltip overflow, mobile gap, branding#1077

Merged
BenjaminMichaelis merged 3 commits intomainfrom
agents/playwright-header-bar-inspection
May 9, 2026
Merged

fix: responsive layout bugs - tooltip overflow, mobile gap, branding#1077
BenjaminMichaelis merged 3 commits intomainfrom
agents/playwright-header-bar-inspection

Conversation

@BenjaminMichaelis
Copy link
Copy Markdown
Member

@BenjaminMichaelis BenjaminMichaelis commented May 9, 2026

Summary

Fixes several header layout bugs discovered via Playwright visual inspection at multiple viewport sizes (1440px → 375px). Issues were identified.

Files Changed

  • EssentialCSharp.Web/Views/Shared/_Layout.cshtml — moved brand link, removed flex-grow-1 from status host, removed redundant d-md-block
  • EssentialCSharp.Web/wwwroot/css/styles.css — tooltip positioning fix, status host flex, nav overflow/alignment, header-brand styles, menu-btn positioning context
  • .gitignore — added .playwright-mcp/ to prevent Playwright debug artifacts from being committed

Testing

Inspected with Playwright at 1440×900, 1200×800, 992×768, 768×1024, 480×800, and 375×667.

- Fix #1 (HIGH): Remove flex-grow-1 from #header-status-host in HTML;
  add CSS that sets flex:0 below 992px and flex:1 at >=992px so the
  empty host no longer creates a massive invisible gap on mobile.

- Fix #2: Add flex-wrap:nowrap and max-height to .banner ul.nav to
  prevent the 1px overflow at the 992px breakpoint.

- Fix #3: Move 'Essential C#' branding outside the d-none d-lg-block
  wrapper so it remains visible on mobile (hidden only below 576px
  via d-none d-sm-block to save space on very small screens).

- Fix #4: Remove redundant d-md-block class (was on a <li> inside a
  d-none d-lg-block parent, so it could never take effect). Resolved
  automatically by the Issue 3 restructure.
- Fix #header-status-host mobile gap: flex: 0 1 auto -> flex: 0 0 0% so
  the empty host takes zero layout space regardless of content, preventing
  justify-content:space-between from creating invisible gaps on mobile

- Fix .banner ul.nav: add overflow:hidden + align-items:center so nav
  items cannot paint outside the 50px header boundary

- Fix sidebar tooltip position: relative -> position: absolute on
  .sidebar-tooltip-text, with position:relative on .menu-btn as anchor.
  The relative positioning put the hidden span in document flow, making
  the hamburger button ~56px tall and overflowing the 50px header.
  Tooltip now appears correctly to the right of the button on hover.

- Remove .playwright-mcp/ debug artifacts and header-*.png screenshots
  committed in the previous pass; add .playwright-mcp/ to .gitignore
@BenjaminMichaelis BenjaminMichaelis changed the title header: fix responsive layout bugs — tooltip overflow, mobile gap, branding fix: responsive layout bugs - tooltip overflow, mobile gap, branding May 9, 2026
@BenjaminMichaelis BenjaminMichaelis marked this pull request as ready for review May 9, 2026 01:55
Copilot AI review requested due to automatic review settings May 9, 2026 01:55
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

This PR addresses responsive header/layout issues identified during Playwright visual inspection across common viewport sizes, focusing on preventing overflow and improving alignment/branding in the site header.

Changes:

  • Adjusts header flex behavior and introduces a dedicated .header-brand style for consistent branding placement.
  • Updates tooltip positioning to avoid overflow and improves nav/header overflow handling.
  • Ignores Playwright MCP debug artifacts by adding .playwright-mcp/ to .gitignore.

Reviewed changes

Copilot reviewed 2 out of 3 changed files in this pull request and generated 3 comments.

File Description
EssentialCSharp.Web/wwwroot/css/styles.css Updates header/nav flex + overflow behavior and fixes tooltip positioning/styling for responsive layouts.
EssentialCSharp.Web/Views/Shared/_Layout.cshtml Repositions the brand link in the header and tweaks header structure to reduce responsive layout issues.
.gitignore Prevents committing Playwright MCP debug artifacts.

Comment thread EssentialCSharp.Web/wwwroot/css/styles.css
Comment thread EssentialCSharp.Web/wwwroot/css/styles.css Outdated
Comment thread EssentialCSharp.Web/wwwroot/css/styles.css
- #header-status-host: flex: 0 0 0% -> flex: 0 1 auto so the teleported
  HeaderStatus (chapter title + % complete) is visible on all viewports,
  not just >=992px. Auto basis sizes to content; shrink=1 tolerates tight
  layouts; grow=0 still prevents gap when element has no content.

- .banner ul.nav: overflow: hidden -> overflow: clip. Clips paint without
  creating a scroll container, preserving focus rings on child elements
  (overflow:hidden clips child outlines; overflow:clip does not).

- .sidebar-tooltip-text: add margin-left: 0 to reset the -60px inherited
  from .has-tooltip .tooltip-text. Without this, left: calc(100% + 4px)
  was offset 60px left, placing the tooltip over the trigger element.
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

Copilot reviewed 2 out of 3 changed files in this pull request and generated 1 comment.

Comment thread EssentialCSharp.Web/wwwroot/css/styles.css
@BenjaminMichaelis BenjaminMichaelis merged commit bc6948e into main May 9, 2026
11 checks passed
@BenjaminMichaelis BenjaminMichaelis deleted the agents/playwright-header-bar-inspection branch May 9, 2026 02:42
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