Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions .changes/planning/fix-surface-journey-radio-focus-7d2e4b91.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
bump: patch
---

### Fixed

- The interview page keeps keyboard focus on a choice when a state push redraws the choices. Before, focus fell back to the page whenever Claude's next update arrived while a choice had focus, for example right after Answer again, so the arrow keys stopped moving between the choices.
4 changes: 2 additions & 2 deletions plugins/planning/surface/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -1700,10 +1700,10 @@ <h1 id="title">Interview</h1>
setHtml($("sumRest"), h);
restoreFocus(f);
}
function focusKey(){ // the focused control, by id or by its data attributes within the nearest region with an id
function focusKey(){ // the focused control, by id or by its data attributes (a radio by name and value) within the nearest region with an id
const a = document.activeElement; if (!a || a === document.body || !a.closest) return null;
if (a.id) return {s: "#" + CSS.escape(a.id), start: a.selectionStart, end: a.selectionEnd};
const attrs = [...a.attributes].filter(x => x.name.startsWith("data-")).map(x => "[" + x.name + '="' + CSS.escape(x.value) + '"]').join(""), box = a.closest("[id]");
const attrs = [...a.attributes].filter(x => x.name.startsWith("data-") || (a.type === "radio" && (x.name === "name" || x.name === "value"))).map(x => "[" + x.name + '="' + CSS.escape(x.value) + '"]').join(""), box = a.closest("[id]");
return attrs && box ? {s: "#" + CSS.escape(box.id) + " " + a.tagName.toLowerCase() + attrs, pin: !!a.closest(".sec.pin")} : null;
}
function restoreFocus(f){
Expand Down
4 changes: 3 additions & 1 deletion plugins/planning/surface/tests/ui_journey.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading