From 095d17c66cb64f0bbd9afdeeb8dbb853a9a1ae2a Mon Sep 17 00:00:00 2001 From: Derek Lewis Date: Tue, 25 Aug 2026 18:13:32 +0000 Subject: [PATCH 1/3] =?UTF-8?q?=E2=99=BF=F0=9F=94=A7=EF=BC=9Alet=20a=20tap?= =?UTF-8?q?=20on=20the=20menu=20button=20land?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Safari holds a tap for about a third of a second to see whether a second one follows and it should zoom instead, and a tap inside that wait reads as the double-tap and cancels both. Only touch-action turns that off; iOS ignores the scale limits in the viewport, so those never did, and asking for them took pinch-zoom from anyone who needs it on the browsers that do listen. That is why the menu took several goes. The button was also 34px tall, under the 48px recommended for a tap target. Its reach grows to 48 and the button itself is left alone, so nothing on the page moves. Signed-off-by: Derek Lewis Assisted-by: Claude-Code:claude-opus-5 Refs: https://github.com/OpenINF/openinf.github.io/pull/1856 --- _assets/styles/_nav.scss | 20 ++++++++++++++++++++ _includes/head.liquid | 9 +++++---- 2 files changed, 25 insertions(+), 4 deletions(-) diff --git a/_assets/styles/_nav.scss b/_assets/styles/_nav.scss index 9815609c2..22e3a4ddd 100644 --- a/_assets/styles/_nav.scss +++ b/_assets/styles/_nav.scss @@ -1,3 +1,23 @@ +// Without `manipulation`, Safari holds a tap for a third of a second in +// case a double-tap to zoom follows, and a second tap inside that wait +// cancels both. iOS ignores the viewport's scale limits, so nothing else +// turns it off. +.navbar-toggler { + position: relative; + touch-action: manipulation; +} + +// 48px is the smallest tap target recommended. The reach grows past the +// button, so nothing drawn changes. +.navbar-toggler::after { + position: absolute; + inset: 50% auto auto 50%; + width: 48px; + height: 48px; + content: ''; + transform: translate(-50%, -50%); +} + .navbar-toggler svg { height: 24px; } diff --git a/_includes/head.liquid b/_includes/head.liquid index 95756fbbe..f4515cfc6 100644 --- a/_includes/head.liquid +++ b/_includes/head.liquid @@ -1,9 +1,10 @@ - + {%- comment -%} + No scale limits: iOS ignores them, and elsewhere they take pinch-zoom + from anyone who needs it. + {%- endcomment -%} + Date: Tue, 25 Aug 2026 18:13:33 +0000 Subject: [PATCH 2/3] =?UTF-8?q?=F0=9F=92=84=F0=9F=9A=AE=EF=BC=9Abuild=20th?= =?UTF-8?q?e=20sidebar=20out=20of=20markup=20and=20CSS?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit bento-sidebar cost three requests to a CDN we do not control, one of them a render-blocking stylesheet, and gave back a drawer we could not steer: an invisible full-height host that took taps meant for the brand, a panel that slid across the button that opened it, and a second copy of that button riding in on the panel. A drawer is a fixed panel, a transform, and a backdrop. That is what this is now. The header's button is the only control and never moves, so nothing crosses it while it slides and there is no second one to land under a finger. Nothing is fetched, so it works from the moment the page is parsed rather than once a runtime has come down the wire. The page no longer waits on cdn.ampproject.org to paint. The drawer it replaces reports aria-expanded, is inert while closed so nothing tabs into an off-screen menu, and takes focus and hands it back. Escape and the backdrop close it, and the ring a returning focus leaves is shown to a keyboard and not to a finger. Signed-off-by: Derek Lewis Assisted-by: Claude-Code:claude-opus-5 --- _assets/styles/_nav.scss | 79 ++++++++++++++++--- .../img/sublime-theme/hamburger-primary.svg | 3 - _includes/footer.liquid | 58 +++++++++++--- _includes/head.liquid | 25 ------ _includes/header.liquid | 24 +++--- project-terms.txt | 5 +- 6 files changed, 124 insertions(+), 70 deletions(-) delete mode 100644 _includes/assets/img/sublime-theme/hamburger-primary.svg diff --git a/_assets/styles/_nav.scss b/_assets/styles/_nav.scss index 22e3a4ddd..298a79d00 100644 --- a/_assets/styles/_nav.scss +++ b/_assets/styles/_nav.scss @@ -22,23 +22,78 @@ height: 24px; } -.navbar-toggler-wrapper { - display: flex; - flex-direction: row-reverse; - height: $navbar-height; +// Focus lands on both of these without a press. Only a keyboard needs the +// ring. +.navbar-toggler:focus:not(:focus-visible) { + box-shadow: none; } -bento-sidebar { +.sidebar:focus:not(:focus-visible) { + outline: none; +} + +// Under the navbar, so the button keeps its place and the panel never +// crosses it. +.sidebar { + position: fixed; + inset-block: 0; + inset-inline-end: 0; + z-index: $zindex-fixed - 5; + visibility: hidden; + width: min(15rem, 70vw); + padding-top: $navbar-height; + overflow-y: auto; + overscroll-behavior: contain; background-color: $secondary; + transform: translateX(100%); + transition: + transform 0.3s ease, + visibility 0s linear 0.3s; +} - .nav-link { - padding-left: 2rem; - line-height: 32px; - border-left: 2px solid transparent; - } +.sidebar.is-open { + visibility: visible; + transform: none; + transition: transform 0.3s ease; +} + +.sidebar .nav-link { + padding-left: 2rem; + line-height: 32px; + border-left: 2px solid transparent; +} + +.sidebar .nav-link.active { + border-left-color: $primary; +} + +.sidebar-backdrop { + position: fixed; + inset: 0; + z-index: $zindex-fixed - 10; + visibility: hidden; + background-color: rgb(0 0 0 / 50%); + opacity: 0; + transition: + opacity 0.3s ease, + visibility 0s linear 0.3s; +} + +.sidebar-backdrop.is-open { + visibility: visible; + opacity: 1; + transition: opacity 0.3s ease; +} + +// The drawer scrolls itself, so the page behind it should not. +body.sidebar-open { + overflow: hidden; +} - .nav-link.active { - border-left-color: $primary; +@media (prefers-reduced-motion: reduce) { + .sidebar, + .sidebar-backdrop { + transition: none; } } diff --git a/_includes/assets/img/sublime-theme/hamburger-primary.svg b/_includes/assets/img/sublime-theme/hamburger-primary.svg deleted file mode 100644 index fb219ad19..000000000 --- a/_includes/assets/img/sublime-theme/hamburger-primary.svg +++ /dev/null @@ -1,3 +0,0 @@ - - - diff --git a/_includes/footer.liquid b/_includes/footer.liquid index f325beeec..4939d3cd3 100644 --- a/_includes/footer.liquid +++ b/_includes/footer.liquid @@ -5,16 +5,50 @@ diff --git a/_includes/head.liquid b/_includes/head.liquid index f4515cfc6..3dc66394a 100644 --- a/_includes/head.liquid +++ b/_includes/head.liquid @@ -39,31 +39,6 @@ src='/assets/js/vendor/count.js' > {%- endif -%} - - - - - @@ -36,21 +39,12 @@ - +{%- comment -%} + The header's button is the only control, so nothing moves under a finger. +{%- endcomment -%} + + diff --git a/project-terms.txt b/project-terms.txt index 2a8fe1d8e..c34a65728 100644 --- a/project-terms.txt +++ b/project-terms.txt @@ -2,7 +2,6 @@ Aftertabs Anson autolinks backref -bento bibtex biomejs blockified @@ -46,9 +45,7 @@ Kosic lede middot noarchive -nodisplay noindex -nomodule nonoptional noopener noreferrer @@ -77,9 +74,11 @@ sitewide skipcq stylesheet Sysnative +tabindex tamasfe trixie unconfigured unentitled unifiedjs windir +zindex From f53671c5bea623bc4f39a47ecadcd9378ef249e0 Mon Sep 17 00:00:00 2001 From: Derek Lewis Date: Tue, 25 Aug 2026 18:13:33 +0000 Subject: [PATCH 3/3] =?UTF-8?q?=F0=9F=92=84=F0=9F=94=A7=EF=BC=9Akeep=20wha?= =?UTF-8?q?t=20the=20old=20sidebar=20got=20right?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Read against bento-sidebar's own source rather than trusting that a drawer is a drawer. Four things it did that this had dropped: The panel hangs off the trailing edge, so in a page that reads right to left it has to leave to the left. It was leaving to the right whatever the direction, which parked the closed panel in the middle of the viewport. No page sets `lang: ar` yet, but the layout emits `dir='rtl'` for one that does. `overflow-y: auto` alone makes the other axis scrollable too, so a long entry would have given the drawer a horizontal scrollbar. The old one pinned `overflow-x: hidden` on purpose. A drag on the backdrop scrolled the page behind it. The old one made the backdrop swallow the gesture; `touch-action` says the same thing without the two hacks it needed to do it. Escape closed the drawer and carried on to whatever else was listening. The slide is the old one's again as well, a sharp decelerate over 350ms, so the motion is the one the site had rather than a new one. Left behind deliberately: `role="menu"` on a list of links, which wants `menuitem` children to mean anything and reads worse than the labelled `nav` around it. The toolbar attribute, the `open` attribute as an API, and pausing media on close were never used here. History integration — the back button closing the drawer — belonged to `amp-sidebar`, not to the component this site loaded, so it was never ours to lose. Signed-off-by: Derek Lewis Assisted-by: Claude-Code:claude-opus-5 --- _assets/styles/_nav.scss | 28 +++++++++++++++++++++------- _includes/footer.liquid | 6 +++++- project-terms.txt | 1 + 3 files changed, 27 insertions(+), 8 deletions(-) diff --git a/_assets/styles/_nav.scss b/_assets/styles/_nav.scss index 298a79d00..1874efcdc 100644 --- a/_assets/styles/_nav.scss +++ b/_assets/styles/_nav.scss @@ -1,3 +1,7 @@ +// A sharp decelerate: the panel arrives, then settles. +$sidebar-slide-time: 350ms; +$sidebar-slide: $sidebar-slide-time cubic-bezier(0, 0, 0.21, 1); + // Without `manipulation`, Safari holds a tap for a third of a second in // case a double-tap to zoom follows, and a second tap inside that wait // cancels both. iOS ignores the viewport's scale limits, so nothing else @@ -42,19 +46,25 @@ visibility: hidden; width: min(15rem, 70vw); padding-top: $navbar-height; - overflow-y: auto; + overflow: hidden auto; overscroll-behavior: contain; background-color: $secondary; transform: translateX(100%); transition: - transform 0.3s ease, - visibility 0s linear 0.3s; + transform $sidebar-slide, + visibility 0s linear $sidebar-slide-time; +} + +// The trailing edge is the left one in a page that reads right to left, so +// the panel leaves that way. +[dir='rtl'] .sidebar { + transform: translateX(-100%); } .sidebar.is-open { visibility: visible; transform: none; - transition: transform 0.3s ease; + transition: transform $sidebar-slide; } .sidebar .nav-link { @@ -72,17 +82,21 @@ inset: 0; z-index: $zindex-fixed - 10; visibility: hidden; + + // A drag here scrolls nothing: `overflow: hidden` on the body does not + // hold on iOS. + touch-action: none; background-color: rgb(0 0 0 / 50%); opacity: 0; transition: - opacity 0.3s ease, - visibility 0s linear 0.3s; + opacity $sidebar-slide, + visibility 0s linear $sidebar-slide-time; } .sidebar-backdrop.is-open { visibility: visible; opacity: 1; - transition: opacity 0.3s ease; + transition: opacity $sidebar-slide; } // The drawer scrolls itself, so the page behind it should not. diff --git a/_includes/footer.liquid b/_includes/footer.liquid index 4939d3cd3..ab93e2a39 100644 --- a/_includes/footer.liquid +++ b/_includes/footer.liquid @@ -49,6 +49,10 @@ backdrop.addEventListener('click', close); document.addEventListener('keydown', (event) => { - if (event.key === 'Escape') close(); + if (!open || event.key !== 'Escape') return; + // The press is spent on the drawer; nothing else acts on it. + event.preventDefault(); + event.stopImmediatePropagation(); + close(); }); diff --git a/project-terms.txt b/project-terms.txt index c34a65728..70623ac52 100644 --- a/project-terms.txt +++ b/project-terms.txt @@ -2,6 +2,7 @@ Aftertabs Anson autolinks backref +bento bibtex biomejs blockified