From 06cb4141e1ad19a74a8b09fc91cb5bb6bdc88ad6 Mon Sep 17 00:00:00 2001 From: SandObserver <260779319+SandObserver@users.noreply.github.com> Date: Tue, 20 Oct 2026 17:37:07 -0400 Subject: [PATCH] Add the keyboard resize setting only where it is supported Safari does not know the interactive-widget viewport key and logs an error for it on every dashboard load. The dashboard now adds it only on engines without GestureEvent, so other browsers keep the search sheet above the on-screen keyboard. --- ui/index.html | 4 ++-- ui/js/dashboard.js | 6 ++++++ ui/test/spotlight-dismiss.test.mjs | 6 ++++-- 3 files changed, 12 insertions(+), 4 deletions(-) diff --git a/ui/index.html b/ui/index.html index 95e7fbfb..37c48821 100644 --- a/ui/index.html +++ b/ui/index.html @@ -5,7 +5,7 @@ - + @@ -56,5 +56,5 @@ - + diff --git a/ui/js/dashboard.js b/ui/js/dashboard.js index 97fba979..75a1d939 100644 --- a/ui/js/dashboard.js +++ b/ui/js/dashboard.js @@ -70,6 +70,12 @@ import { THEME_KEY, applyTheme, prefersDark, readMode, resolveTheme } from '/js/ ensureSprite(); +if (!('GestureEvent' in window)) { + const viewport = document.querySelector('meta[name="viewport"]'); + if (viewport) + viewport.setAttribute('content', `${viewport.getAttribute('content')},interactive-widget=resizes-content`); +} + /* Recomputed, never stored: the window can cross the breakpoint after load. */ let MOB = isMobileLayout(); diff --git a/ui/test/spotlight-dismiss.test.mjs b/ui/test/spotlight-dismiss.test.mjs index 505e001d..a0c6e60e 100644 --- a/ui/test/spotlight-dismiss.test.mjs +++ b/ui/test/spotlight-dismiss.test.mjs @@ -100,8 +100,10 @@ test('closing puts both edges back', () => { assert.match(fn[1], /classList\.remove\('kb'\)/); }); -test('the browser is asked to resize the page for the keyboard', () => { - assert.match(html, /name="viewport"[^>]*interactive-widget=resizes-content/); +test('the browser is asked to resize the page for the keyboard, except where the key is unknown', () => { + assert.doesNotMatch(html, /interactive-widget/, 'Safari logs an error for the key in the page'); + const dash = read('js/dashboard.js'); + assert.match(dash, /if \(!\('GestureEvent' in window\)\) \{[\s\S]{0,200}interactive-widget=resizes-content/); }); test('the list drops the status-bar inset once the keyboard has moved it', () => {