From 5f8e3b1a34a5a00729c3f2990e83fb23f59e021c Mon Sep 17 00:00:00 2001 From: Ethan J Lewis Date: Sat, 9 May 2026 15:06:37 -0500 Subject: [PATCH] fix(ui): keep input typable post-end so player can type restart/undo Disabling the input via the disabled attribute blocks keydown events entirely, so players couldn't type 'restart' or 'undo' after reaching an ending. Switch to a CSS class for the faded visual state; the keydown handler already restricts post-end input to those two commands. Co-Authored-By: Claude Opus 4.7 --- src/ui/crt.css | 5 ++--- src/ui/terminal.ts | 6 +++++- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/src/ui/crt.css b/src/ui/crt.css index 4c06e91..9cd9b28 100644 --- a/src/ui/crt.css +++ b/src/ui/crt.css @@ -179,7 +179,6 @@ white-space: pre-wrap; } -[data-mystery-input]:disabled { - opacity: 0.4; - cursor: not-allowed; +[data-mystery-input].ended { + opacity: 0.55; } diff --git a/src/ui/terminal.ts b/src/ui/terminal.ts index 349828a..6ea55ee 100644 --- a/src/ui/terminal.ts +++ b/src/ui/terminal.ts @@ -34,7 +34,11 @@ if (!transcriptEl || !inputEl) { } const syncEndedUI = (): void => { - inputEl!.disabled = state.endedWith !== null + // Don't disable the input — the player still needs to type `restart` or + // `undo`. A `disabled` input rejects keydown events entirely. Use a class + // for visual styling instead; the keydown handler enforces the input + // restriction. + inputEl!.classList.toggle('ended', state.endedWith !== null) } const buildParserContext = (s: GameState): ParserContext => {