commit d70a0c7bcf8571138db1736d60ffccf716e83568
parent ab0be1392109e1a449ef58da6877d4e72dab4672
Author: I Mean I'm Just Saying <imeanimjustsaying@kiwifarms.st>
Date: Sun, 8 Nov 2026 04:19:19 -0500
umtool: present mode's keys leave the settings' controls theirs; a section's date in words
Escape closes the settings from any control (a checkbox had it swallowed);
Space and Enter on a focused setting work that control, not the deck. The
section divider says "from Oct 30", and the spec counts one redacted name.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Diffstat:
2 files changed, 18 insertions(+), 6 deletions(-)
diff --git a/umtool/components/projects/present/PresentView.tsx b/umtool/components/projects/present/PresentView.tsx
@@ -226,10 +226,16 @@ export default function PresentView({ payload, back, playHref }: { payload: Pres
useEffect(() => {
const onKey = (e: KeyboardEvent) => {
const t = e.target as HTMLElement | null;
- if (t && (t.tagName === "INPUT" || t.tagName === "TEXTAREA" || t.isContentEditable)) {
- if (e.key === "Escape") t.blur();
+ // Typing in a field (the linger) is not a move; a checkbox is not typing.
+ const typing = !!t && ((t.tagName === "INPUT" && !["checkbox", "radio", "button"].includes((t as HTMLInputElement).type)) || t.tagName === "TEXTAREA" || t.isContentEditable);
+ if (e.key === "Escape") {
+ if (t && t !== document.body) t.blur();
+ setDrawer(false);
return;
}
+ if (typing) return;
+ // In the settings, Space and Enter work the control that has the focus.
+ if ((e.key === " " || e.key === "Enter") && t?.closest?.("[data-present-settings]")) return;
if (e.metaKey || e.ctrlKey || e.altKey) return;
const k = e.key;
let done = true;
@@ -238,7 +244,6 @@ export default function PresentView({ payload, back, playHref }: { payload: Pres
else if (k === "Home") go(0);
else if (k === "End") go(n - 1);
else if (k === "s" || k === "S") setDrawer((d) => !d);
- else if (k === "Escape") setDrawer(false);
else if (k === "p" || k === "k") setPaused((p) => !p);
else done = false;
if (done) e.preventDefault();
@@ -514,7 +519,7 @@ function ClipView({ slide, project, take, playing, sound, censor, onDone }: { sl
</div>
<div data-present-clip-band="" className="flex shrink-0 items-center gap-[2cqh] bg-neutral-950/95 px-[3cqh] py-[1.6cqh]">
<div className="min-w-0 flex-1">
- <div data-present-clip-title="" className="truncate text-[3.4cqh] font-semibold leading-tight">{slide.title}</div>
+ <div data-present-clip-title="" className="truncate font-display text-[3.4cqh] font-semibold leading-tight">{slide.title}</div>
{slide.subtitle && <div data-present-clip-subtitle="" className="truncate text-[2.4cqh] text-white/65">{slide.subtitle}</div>}
</div>
</div>
@@ -569,7 +574,7 @@ function TextView({ slide, section, sections, slides }: { slide: TextSlide; sect
</div>
<div className="font-mono text-[2.4cqh] text-white/50">
{count} slide{count === 1 ? "" : "s"}
- {section?.date ? ` · from ${section.date}` : ""}
+ {section?.date ? ` · from ${shortDay(section.date)}` : ""}
</div>
</>
)}
@@ -594,6 +599,13 @@ function TextView({ slide, section, sections, slides }: { slide: TextSlide; sect
);
}
+const MON = ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"];
+/** "Oct 30" for `YYYY-MM-DD` (present.mjs dayLabel's words). */
+const shortDay = (day: string) => {
+ const m = /^(\d{4})-(\d{2})-(\d{2})$/.exec(day);
+ return m ? `${MON[Number(m[2]) - 1] ?? m[2]} ${Number(m[3])}` : day;
+};
+
const weekday = (day: string | null) => {
const d = day ? new Date(`${day}T12:00:00Z`) : null;
return d && !Number.isNaN(d.getTime()) ? d.toLocaleDateString("en-US", { weekday: "long", timeZone: "UTC" }) : "";
diff --git a/umtool/e2e/present.spec.ts b/umtool/e2e/present.spec.ts
@@ -129,7 +129,7 @@ test("the settings persist across a reload; narration off silences the take; a c
const drawer = page.locator("[data-present-settings]");
await expect(drawer).toBeVisible();
// The kinds this slide carries, counted.
- await expect(drawer.locator('[data-present-censor-count="names"]')).toHaveText("2 here");
+ await expect(drawer.locator('[data-present-censor-count="names"]')).toHaveText("1 here");
await expect(drawer.locator('[data-present-censor-count="authors"]')).toHaveText("1 here");
await expect(drawer.locator('[data-present-censor-count="pictures"]')).toHaveText("1 here");