Keep episode-readiness edits live without dropping focus [#1131]#1353
Open
claytonlin1110 wants to merge 1 commit into
Open
Keep episode-readiness edits live without dropping focus [#1131]#1353claytonlin1110 wants to merge 1 commit into
claytonlin1110 wants to merge 1 commit into
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
prototype/episode-readiness.html'srender()rebuilt every track row on every keystroke viatracksElement.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.render()intorenderTracks()(rebuilds the row DOM) andrenderSummary(readiness)(status badge, issues list, Continue link only).updateTrack()now callsrenderSummary(evaluateReadiness())alone forname/speakerName/hasVideo/duration/transcriptedits — these only change creator-facing summary copy — and only falls through to the fullrender()for anaudioKeychange, 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
audioKeyexception) 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 inmain. It's the same focus-preservation pattern already merged forspeaker-role-mapping.html(#1324) and still open forsource-media-health.html(#1315, also closed off-target).Verification
npm test— 105/105 smoke test files pass (up from 104 with the new test)prototype/episode-readiness-edit-focus.test.js: typing a bucket name or speaker name doesn't rebuild track rows (replaceChildrencall count unchanged) while still updating readiness copy and unlocking Continue; anaudioKeychange still rebuilds rows and refreshes duplicate-audio detectionepisode-readiness-layout-handoff.test.jsandepisode-readiness-fix-routing.test.jsto confirm no regressionConflict avoidance
prototype/episode-readiness.html(one function split into two, one new conditional inupdateTrack) plus one new, additive test file. No nav, shell, or other screen files touched.