Skip to content

Worktrunk is a CLI for Git worktree management, designed for parallel AI agent workflows

Fix TOC and hero max-height to use JS-set viewport height

Maximilian Roos08ff8efd4d31
diff --git a/docs/sass/custom.scss b/docs/sass/custom.scss
index 28d68b216..092067392 100644
--- a/docs/sass/custom.scss
+++ b/docs/sass/custom.scss
@@ -521,7 +521,8 @@ table {
border: 1px solid var(--wt-color-border-subtle);
border-top: 3px solid var(--wt-color-accent);
padding: 0.75rem 0 1rem;
- max-height: calc(100svh - var(--wt-header-height) - var(--wt-main-padding-top) - 20px); // Fill viewport minus sticky offset and bottom margin
+ // Use --vh-full (JS-set) with svh fallback for Firefox/Chrome iOS fix
+ max-height: calc(var(--vh-full, 100svh) - var(--wt-header-height) - var(--wt-main-padding-top) - 20px);
overflow-y: auto;
overscroll-behavior: contain; // Trap scroll events within TOC
}
@@ -682,7 +683,8 @@ footer {
}
.hero-image {
- max-height: 55svh;
+ // Use --vh-full (JS-set) with svh fallback for Firefox/Chrome iOS fix
+ max-height: calc(var(--vh-full, 100svh) * 0.55);
width: auto;
aspect-ratio: 1;
object-fit: contain;
diff --git a/docs/templates/base.html b/docs/templates/base.html
index 40da44768..9ac7cee68 100644
--- a/docs/templates/base.html
+++ b/docs/templates/base.html
@@ -22,11 +22,25 @@
// https://github.com/mozilla-mobile/firefox-ios/issues/11574
(function() {
var ua = navigator.userAgent;
- if (/FxiOS/.test(ua) || /CriOS/.test(ua)) {
- // Capture initial viewport height (with browser chrome visible)
- // and use it as a stable value instead of broken svh
- document.documentElement.style.setProperty('--vh-full', window.innerHeight + 'px');
+ // DEBUG: Apply to all iOS devices to test if fix works at all
+ // TODO: Restore FxiOS/CriOS detection after confirming fix works
+ if (!/iPhone|iPad|iPod/.test(ua)) return;
+
+ var root = document.documentElement;
+ root.classList.add('ios-vh-lock'); // Debug: visible indicator
+
+ function setLockedVH() {
+ // visualViewport.height is more accurate on some devices
+ var h = (window.visualViewport && window.visualViewport.height) || window.innerHeight;
+ root.style.setProperty('--vh-full', Math.round(h) + 'px');
+ console.log('[vh-lock] Set --vh-full to ' + h + 'px');
}
+
+ // Set immediately
+ setLockedVH();
+ // Re-set on bfcache restore and orientation change
+ window.addEventListener('pageshow', setLockedVH, { passive: true });
+ window.addEventListener('orientationchange', setLockedVH, { passive: true });
})();
</script>
<meta name="view-transition" content="same-origin">