Skip to content

Keep episode-readiness edits live without dropping focus [#1131]#1353

Open
claytonlin1110 wants to merge 1 commit into
e35dev:mainfrom
claytonlin1110:fix/episode-readiness-focus
Open

Keep episode-readiness edits live without dropping focus [#1131]#1353
claytonlin1110 wants to merge 1 commit into
e35dev:mainfrom
claytonlin1110:fix/episode-readiness-focus

Conversation

@claytonlin1110

Copy link
Copy Markdown
Contributor

Summary

  • prototype/episode-readiness.html's render() rebuilt every track row on every keystroke via tracksElement.replaceChildren(...tracks.map(renderTrack)). Typing a bucket name or speaker name in a connected field destroyed and recreated the focused <input> mid-edit, making continuous typing impossible in a real browser.
  • Split render() into renderTracks() (rebuilds the row DOM) and renderSummary(readiness) (status badge, issues list, Continue link only).
  • updateTrack() now calls renderSummary(evaluateReadiness()) alone for name/speakerName/hasVideo/duration/transcript edits — these only change creator-facing summary copy — and only falls through to the full render() for an audioKey change, since reassigning the recording can alter the "Current speaker recording" <select> option elsewhere on that same row.

Why this is useful

This exact fix (same root cause, same split, same audioKey exception) was already independently submitted and validated as technically correct in PR #1328 — "the sandbox evidence says this change works" per the maintainer's own review — but closed solely for not targeting the (now-superseded) active step at the time. The bug is real and still present in main. It's the same focus-preservation pattern already merged for speaker-role-mapping.html (#1324) and still open for source-media-health.html (#1315, also closed off-target).

Verification

  • npm test — 105/105 smoke test files pass (up from 104 with the new test)
  • Added prototype/episode-readiness-edit-focus.test.js: typing a bucket name or speaker name doesn't rebuild track rows (replaceChildren call count unchanged) while still updating readiness copy and unlocking Continue; an audioKey change still rebuilds rows and refreshes duplicate-audio detection
  • Re-ran the existing episode-readiness-layout-handoff.test.js and episode-readiness-fix-routing.test.js to confirm no regression

Conflict avoidance

  • Single-file behavior change to prototype/episode-readiness.html (one function split into two, one new conditional in updateTrack) plus one new, additive test file. No nav, shell, or other screen files touched.

render() rebuilt every track row on every keystroke (replaceChildren
over the full track list), so typing a bucket name or speaker name in
a connected episode-readiness field destroyed and recreated the
focused input mid-edit.

Split render() into renderTracks() (rebuilds rows) and renderSummary()
(status/issues/Continue only). updateTrack() now calls renderSummary()
alone for name/speakerName/hasVideo/duration/transcript edits, and only
falls through to the full render() for an audioKey change, since that
can alter the "Current speaker recording" select option elsewhere on
the row.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant