Skip to content

Self-hosted, Self-Improving, Federated Everything App — dev management, agent orchestration, persistent mind, digital twin, second brain, and creative pipeline from a single dashboard over Tailscale to port the user into the OS

fix: keep full-width pages from shifting up after an anchor jump (#10592)

[._.]/5c795ba48553
diff --git a/client/src/components/Layout.jsx b/client/src/components/Layout.jsx
index 797c882336..699e21b63d 100644
--- a/client/src/components/Layout.jsx
+++ b/client/src/components/Layout.jsx
@@ -1095,7 +1095,7 @@ export default function Layout() {
{(() => {
const isFullWidth = isFullWidthRoute(location.pathname);
return (
- <main ref={mainRef} id="main-content" tabIndex={-1} className={`focus:outline-none flex-1 min-h-0 print:overflow-visible print:min-h-0 ${isFullWidth ? 'relative overflow-hidden' : 'overflow-auto p-4 md:p-6'}`}>
+ <main ref={mainRef} id="main-content" tabIndex={-1} className={`focus:outline-none flex-1 min-h-0 print:overflow-visible print:min-h-0 ${isFullWidth ? 'relative overflow-clip-safe' : 'overflow-auto p-4 md:p-6'}`}>
<Outlet />
</main>
);
diff --git a/client/src/components/Layout.test.jsx b/client/src/components/Layout.test.jsx
index 3ca2520339..6e1e0afaff 100644
--- a/client/src/components/Layout.test.jsx
+++ b/client/src/components/Layout.test.jsx
@@ -516,7 +516,7 @@ describe('Layout — nav footer', () => {
describe('Layout — Game workspace scroll mode', () => {
it('makes only the Game detail route full-bleed', async () => {
const detail = await renderLayout('/game/example-game');
- expect(detail.container.querySelector('#main-content')?.className).toContain('overflow-hidden');
+ expect(detail.container.querySelector('#main-content')?.className).toContain('overflow-clip-safe');
detail.unmount();
const index = await renderLayout('/game');
@@ -540,7 +540,7 @@ describe('Layout — Data Manager scroll mode', () => {
it('gives /data the bare full-width main, and leaves /devtools/datadog padded', async () => {
const dataManager = await renderLayout('/data');
const dataMain = dataManager.container.querySelector('#main-content');
- expect(dataMain?.className).toContain('overflow-hidden');
+ expect(dataMain?.className).toContain('overflow-clip-safe');
expect(dataMain?.className).not.toContain('overflow-auto');
expect(dataMain?.className).not.toContain('p-4');
dataManager.unmount();
diff --git a/client/src/index.css b/client/src/index.css
index 1b707f80e5..1154a3bf6f 100644
--- a/client/src/index.css
+++ b/client/src/index.css
@@ -304,6 +304,28 @@ body {
height: 100dvh;
}
+/* The full-width route's <main> clips its page without being a scroll box.
+ `overflow: hidden` still scrolls programmatically: an absolutely positioned
+ descendant (an `sr-only` label) inside the page's own scroller takes <main>
+ as its containing block, so it widens <main>'s scroll range, and any
+ scrollIntoView() or focus() past the page scroller's end then scrolls <main>
+ itself, shifting the whole page up with no way for the user to scroll it
+ back (the Music Video "Verify lyric timing" link). `clip` can't scroll;
+ `hidden` stays as the fallback for engines without it. */
+.overflow-clip-safe {
+ overflow: hidden;
+ overflow: clip;
+}
+
+/* Both classes above are unlayered, so they beat every `@layer utilities`
+ rule whatever its specificity, including the `print:h-auto` and
+ `print:overflow-visible` beside them in Layout.jsx. Restate the print
+ values here so a printed page still grows to its content. */
+@media print {
+ .h-dvh-screen { height: auto; }
+ .overflow-clip-safe { overflow: visible; }
+}
+
/* dvh-aware sizing utilities. iOS Safari's retractable browser chrome makes
100vh taller than the visible viewport, so surfaces sized to 100vh spill
*under* the chrome. These size to 100dvh — the visible dynamic viewport —