fix(ui): panels stay above the keyboard, the day two offers share is listed once

The date field would not open at all on some days: on a Friday "Friday" and
"In a week" resolve to the same day, and the option list was keyed by the day
it writes, so Svelte tore it down with each_key_duplicate. On a desktop this
took the whole view with it - the same bug, not two. Duplicate offers are
dropped (the more specific name wins) and the list is keyed by position, so
no caller can tear it down that way again.

Panels are placed against the visual viewport rather than the window, which
a phone's keyboard shrinks without resizing anything: they scroll inside what
is left, re-place as the keyboard animates in, and come back into view when
the keyboard covers the very row they hang off - visible beats staying next
to the anchor. The quick look centres the same way.

Its actions are thumb-sized where the pointer is coarse, with the keycaps
hidden - there is no keyboard to press them on - and it gains "no date" and a
close button, since a phone has no Escape. Both menus gain a plain "Edit"
beside "Edit in Tasks"; it was only ever reachable by pressing e.
This commit is contained in:
hh committed 2026-09-05 00:22:07 +02:00
1 parent 9c0e57e29b
commit b70331f7bd
8 files changed
+208 -26

No files matched your search

+28
View File
@@ -661,6 +661,34 @@ for (const [name, init] of [
store.tick();
}
// On a Friday "Friday" and "In a week" are the same day. The date field used
// to be keyed by that day and tore itself down, so the picker never opened.
{
store.today = "2026-09-04";
store.leaveToMain();
flushSync();
key(viewRoot, { key: "n", code: "KeyN" });
flushSync();
store.today = "2026-09-04";
flushSync();
const panel = panelOf();
for (let i = 0; i < 3; i += 1) {
(dom.window.document.activeElement ?? panel).dispatchEvent(
new dom.window.KeyboardEvent("keydown", { bubbles: true, key: "Tab", code: "Tab" }),
);
flushSync();
}
check("the date field opens on a friday", panelOf() !== null && store.editing !== null);
check(
"the day two offers share is listed once",
(panel.textContent.match(/Sep 11/gu) ?? []).length === 1,
panel.textContent.slice(0, 200),
);
panel.dispatchEvent(new dom.window.KeyboardEvent("keydown", { bubbles: true, key: "Escape", code: "Escape" }));
flushSync();
store.tick();
}
// A request whose task vanished must not leave the view deaf.
store.request = "priority";
store.cursorTask = "nothing/at/all#0";