Skip to content

Commit bc6948e

Browse files
fix: responsive layout bugs - tooltip overflow, mobile gap, branding (#1077)
## 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.
1 parent e369a78 commit bc6948e

3 files changed

Lines changed: 38 additions & 8 deletions

File tree

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ TestResults/
1010
~$*.do[ct]x
1111
~*.tmp
1212
~$*.dotm
13+
.playwright-mcp/
1314

1415
# Files to keep (primarily book content)
1516
!.gitignore

EssentialCSharp.Web/Views/Shared/_Layout.cshtml

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -100,13 +100,11 @@
100100
<b>Ctrl + M</b>
101101
</span>
102102
</button>
103+
<a class="nav-link header-brand d-none d-sm-block @(string.IsNullOrEmpty(ViewBag.PageTitle) ? "active" : "")" href="/home">
104+
Essential C#
105+
</a>
103106
<div class="d-none d-lg-block">
104107
<ul class="nav align-items-center">
105-
<li class="nav-item d-none d-md-block">
106-
<a class="@(string.IsNullOrEmpty(ViewBag.PageTitle) ? "active nav-link fs-4" : "nav-link fs-4")" href="/home">
107-
Essential C#
108-
</a>
109-
</li>
110108
<li class="nav-item">
111109
<a class="@(ViewBag.PageTitle == "About" ? "active nav-link" : "nav-link")" href="/about">About</a>
112110
</li>
@@ -123,7 +121,7 @@
123121
</div>
124122
</div>
125123

126-
<div id="header-status-host" class="d-flex align-items-center justify-content-center flex-grow-1 overflow-hidden"></div>
124+
<div id="header-status-host" class="d-flex align-items-center justify-content-center overflow-hidden"></div>
127125

128126
<div class="d-flex align-items-center">
129127
<div class="border-end pe-3 d-none d-md-block">

EssentialCSharp.Web/wwwroot/css/styles.css

Lines changed: 33 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -206,9 +206,36 @@ a:hover {
206206
display: flex;
207207
justify-content: flex-start;
208208
align-items: center;
209+
min-width: 0;
210+
}
211+
212+
.header-brand {
213+
font-size: 1.25rem;
214+
font-weight: 400;
215+
white-space: nowrap;
216+
text-decoration: none;
217+
}
218+
219+
#header-status-host {
220+
flex: 0 1 auto;
221+
min-width: 0;
222+
}
223+
224+
@media (min-width: 992px) {
225+
#header-status-host {
226+
flex: 1 1 0;
227+
}
228+
}
229+
230+
.banner ul.nav {
231+
flex-wrap: nowrap;
232+
max-height: var(--toolbar-height);
233+
overflow: clip;
234+
align-items: center;
209235
}
210236

211237
.menu-btn {
238+
position: relative;
212239
margin: 0 5px 0 5px;
213240
display: inline-block;
214241
outline: none;
@@ -295,11 +322,15 @@ a:hover {
295322

296323
.has-tooltip .sidebar-tooltip-text {
297324
width: 90px;
298-
position: relative;
299-
left: 5rem;
325+
position: absolute;
326+
top: 50%;
327+
left: calc(100% + 4px);
328+
margin-left: 0;
329+
transform: translateY(-50%);
300330
border-radius: 10px;
301331
padding: 10px;
302332
white-space: normal;
333+
z-index: 10;
303334
}
304335

305336
.has-tooltip .sidebar-tooltip-text:after {

0 commit comments

Comments
 (0)