fix(theme): shell fills the dynamic viewport — drop calc(100vh - 3.3rem) (scadaproj#10)
.app-shell min-height is now 100vh with a 100dvh override (the 3.3rem was a donor-app top-bar leftover; ThemeShell has no top bar) and the lg+ sticky rail is 100vh/100dvh. Source bumped to 0.5.3, UNPUBLISHED. Adds a static regression test and fixes the CS8602 in NavStateScriptTests (0 warnings). Browser-checked via Overview on local 0.5.2 vs 0.5.3 packages: at 390x844 a short page went from a 791px shell (53px gap) to 844px, no extra scroll; 1440x900 rail stays sticky full-height. Claude-Session: https://claude.ai/code/session_01GT67AEHd2Acv1YPwGfXEoV
This commit is contained in:
@@ -2,7 +2,22 @@
|
||||
|
||||
Shared UI kit (Razor Class Library — Technical-Light tokens, IBM Plex, side-rail shell, widgets) for the **ZB.MOM.WW SCADA family**; five consumers. Build/test from this directory: `dotnet test`. Component spec + gaps: `../components/ui-theme/`.
|
||||
|
||||
**Backlog / open work:** lives in Gitea issues on `dohertj2/scadaproj` (`tea issues list --repo dohertj2/scadaproj`) — currently #9 (roll `0.5.0` to the other consumers), #10 (`layout.css` `calc(100vh - 3.3rem)` review). The history below is a record, not a status tracker; file new follow-ups as issues.
|
||||
**Backlog / open work:** lives in Gitea issues on `dohertj2/scadaproj` (`tea issues list --repo dohertj2/scadaproj`) — currently #9 (roll `0.5.0` to the other consumers); #10 (`calc(100vh - 3.3rem)`) is fixed in 0.5.3 source. The history below is a record, not a status tracker; file new follow-ups as issues.
|
||||
|
||||
## 0.5.3 (2026-11-09, UNPUBLISHED)
|
||||
|
||||
Fixes scadaproj#10. `.app-shell` was `min-height: calc(100vh - 3.3rem)` — the 3.3rem is a donor-app top-bar
|
||||
leftover (ThemeShell renders no top bar), so below lg a short page stopped 53 px short of the viewport, and plain
|
||||
`100vh` overshoots on mobile browsers with collapsing toolbars. Now `min-height: 100vh; min-height: 100dvh;`
|
||||
(100vh = fallback), and the lg+ sticky `#theme-rail` is `height: 100vh; height: 100dvh;`. The column layout's
|
||||
`flex: 1` on the page was already supplied by `.app-shell .page`, so the page takes the height left under the
|
||||
hamburger row. Static test `Shell_fills_the_dynamic_viewport_with_no_topbar_offset`; also fixed the CS8602 in
|
||||
`NavStateScriptTests` (0 warnings). Browser check (Overview on local 0.5.2 vs 0.5.3 packages, iframe viewports):
|
||||
390x844 short page — before shell 791 px tall with a 53 px gap under the page, after shell/page reach 844,
|
||||
`scrollHeight == innerHeight` both times (no extra scroll); 1440x900 — rail sticky at 0–900 after scrolling a
|
||||
1133 px page, short page fills 900, before and after. Consumers: mxgw's `body.dashboard-body { min-height: 100vh }`
|
||||
and ScadaBridge's lg+ `#theme-rail > .side-rail { height: 100% }` don't conflict; neither app still has an inline
|
||||
`min-height:100vh` shell wrapper on its default branch. Version bumped in `Directory.Build.props`, not packed or pushed.
|
||||
|
||||
## 0.5.2 (2026-11-09, UNPUBLISHED)
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<Nullable>enable</Nullable>
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
<LangVersion>latest</LangVersion>
|
||||
<Version>0.5.2</Version>
|
||||
<Version>0.5.3</Version>
|
||||
<ManagePackageVersionsCentrally>true</ManagePackageVersionsCentrally>
|
||||
</PropertyGroup>
|
||||
</Project>
|
||||
|
||||
@@ -59,7 +59,7 @@ server-side** before redirecting (open-redirect risk):
|
||||
| Component | Parameters (key) | Notes |
|
||||
|---|---|---|
|
||||
| `ThemeHead` | — | Emits `<link>` tags for `theme.css` and `layout.css`. Place in `<head>` after Bootstrap. |
|
||||
| `ThemeShell` | `Product`*, `Accent`, `Logo`, `Nav`, `RailFooter`, `ChildContent`, `ScrollNav` | Side-rail chassis. Not a layout — delegated to from `MainLayout`. `Accent` overrides `--accent` token. `ScrollNav` (opt-in, default false; 0.5.2) wraps `Nav` in a `.rail-scroll` pane and fills the rail height on lg+ so a long nav scrolls while `RailFooter` stays pinned. |
|
||||
| `ThemeShell` | `Product`*, `Accent`, `Logo`, `Nav`, `RailFooter`, `ChildContent`, `ScrollNav` | Side-rail chassis. Not a layout — delegated to from `MainLayout`. The shell fills the viewport (`min-height: 100dvh`, `100vh` fallback; 0.5.3) and the lg+ sticky rail is `100dvh` tall, so no consumer needs its own `min-height: 100vh` wrapper. `Accent` overrides `--accent` token. `ScrollNav` (opt-in, default false; 0.5.2) wraps `Nav` in a `.rail-scroll` pane and fills the rail height on lg+ so a long nav scrolls while `RailFooter` stays pinned. |
|
||||
| `BrandBar` | `Product`*, `Logo` | Brand glyph + product name; rendered inside `ThemeShell`'s rail header. |
|
||||
| `NavRailItem` | `Href`*, `Text`*, `Icon`, `Match` | Wraps `<NavLink class="rail-link">`. |
|
||||
| `NavRailSection` | `Title`*, `Expanded` (default `true`), `ChildContent` | CSS-only collapsible `<details>` group; no JS, works in static SSR. |
|
||||
|
||||
@@ -60,9 +60,17 @@
|
||||
direction is supplied by Bootstrap utilities on the wrapper
|
||||
(`d-flex flex-column flex-lg-row`) so the hamburger row stacks above the rail
|
||||
on <lg viewports and the rail sits beside the page on lg+. */
|
||||
/* Fill the viewport exactly: ThemeShell renders no top bar, so the old
|
||||
`calc(100vh - 3.3rem)` (a donor-app leftover) under-filled short pages. `dvh`
|
||||
tracks the visible viewport on mobile browsers with collapsing toolbars, where
|
||||
plain `100vh` overshoots and forces a scroll; `100vh` is the fallback for
|
||||
browsers without `dvh`. Below lg the shell is a column (hamburger row + page)
|
||||
and `.app-shell .page { flex: 1 }` lets the page take the remaining height
|
||||
(scadaproj#10). */
|
||||
.app-shell {
|
||||
align-items: stretch;
|
||||
min-height: calc(100vh - 3.3rem);
|
||||
min-height: 100vh;
|
||||
min-height: 100dvh;
|
||||
}
|
||||
|
||||
/* A closed shell must hide navigation only, never the page. Modern Chromium
|
||||
@@ -117,13 +125,14 @@
|
||||
position: sticky;
|
||||
top: 0;
|
||||
height: 100vh;
|
||||
height: 100dvh;
|
||||
align-self: flex-start;
|
||||
z-index: 1020;
|
||||
}
|
||||
}
|
||||
|
||||
/* Opt-in rail nav scroll pane (ThemeShell ScrollNav="true"; ScadaBridge#61).
|
||||
The sticky #theme-rail is 100vh on lg+ but .side-rail never filled it, so a
|
||||
The sticky #theme-rail is 100dvh on lg+ but .side-rail never filled it, so a
|
||||
long nav grew past the viewport and carried .rail-foot off-screen. With the
|
||||
opt-in class the rail fills the rail and only .rail-scroll scrolls; the brand
|
||||
bar and .rail-foot stay put. Below lg the rail is inline and scrolls with
|
||||
|
||||
@@ -32,7 +32,8 @@ public class NavStateScriptTests
|
||||
return; // Node not available on this machine.
|
||||
}
|
||||
|
||||
using (node!)
|
||||
Assert.NotNull(node);
|
||||
using (node)
|
||||
{
|
||||
var output = node.StandardOutput.ReadToEnd() + node.StandardError.ReadToEnd();
|
||||
node.WaitForExit();
|
||||
|
||||
@@ -53,6 +53,19 @@ public class StaticAssetsTests
|
||||
Assert.Matches(@"\.tt-leaf\s*\{\s*visibility:\s*hidden", css);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void Shell_fills_the_dynamic_viewport_with_no_topbar_offset()
|
||||
{
|
||||
// scadaproj#10: ThemeShell has no top bar, so the donor-app `calc(100vh - 3.3rem)` under-filled short pages,
|
||||
// and plain 100vh overshoots on mobile browsers with collapsing toolbars. 100vh stays as the fallback.
|
||||
var css = File.ReadAllText(Path.Combine(Wwwroot, "css", "layout.css"));
|
||||
css = Regex.Replace(css, @"/\*.*?\*/", "", RegexOptions.Singleline);
|
||||
Assert.DoesNotContain("3.3rem", css);
|
||||
Assert.Matches(@"\.app-shell\s*\{[^}]*min-height:\s*100vh;\s*min-height:\s*100dvh;", css);
|
||||
Assert.Matches(@"\.app-shell \.page\s*\{[^}]*flex:\s*1;", css);
|
||||
Assert.Matches(@"#theme-rail\s*\{[^}]*height:\s*100vh;\s*height:\s*100dvh;", css);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void Closed_mobile_shell_hides_only_the_rail_and_keeps_main_content_visible()
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user