Repository navigation
Conversation
Caption timing relied on source assertions that could miss runtime regressions. Add behavioral coverage to preserve candidate captions, placeholder expiry, and pacing when interviewer retention changes.
Completed interviewer captions lost their opening sentences and expired while candidates were still considering a hint. Keep the complete turn visible until transcribed speech or a code text change so candidates can reread it without leaving the problem.
fdbe3a5 to
14b0c14
Compare
| } | ||
|
|
||
| /// Candidate edits must also prevent delayed Jim streams from restoring the bar. | ||
| export function dismissCaptions() { |
There was a problem hiding this comment.
dismissCaptions retires whatever interviewer caption is current, including one still arriving. A candidate who types while Jim is reading out a long hint adds that segment to retiredInterviewerIds, so every later chunk and the final copy of the turn are dropped and the caption never comes back for it; before this change typing left the live caption alone. Dismiss only a completed turn:
| export function dismissCaptions() { | |
| export function dismissCaptions() { | |
| if (!interviewerCaption.final) return; |
| if (interviewerCaption.id !== id) { | ||
| clearTimeout(interviewerCaption.timer); | ||
| interviewerCaption = { id, text: "", shown: 0, timer: null }; | ||
| retireInterviewerCaption(); |
There was a problem hiding this comment.
.captions-bar scrolls (overflow-y: auto under max-height), and replacing textContent keeps its scrollTop. After the candidate scrolls down through one long completed turn, the next long turn opens partway through its text, which is the opening-sentences loss #223 is about. Reset the scroll when a new segment takes over:
| retireInterviewerCaption(); | |
| retireInterviewerCaption(); | |
| if (nodes.captionsBar) nodes.captionsBar.scrollTop = 0; |
jserv
left a comment
There was a problem hiding this comment.
Rebase latest main branch and resolve conflicts.
Completed Jim captions lose the opening sentences of long turns and disappear after 12 seconds while the candidate is still thinking. Keep the full completed turn visible until the candidate's next transcribed speech or an edit that changes the code text. Clicking or focusing the editor and switching languages preserve the caption, while candidate captions retain their existing 12-second timeout.
Mark a turn complete only after successfully reading its final transcription stream. Ignore late updates for retired Jim segment IDs and final replays of known, earlier candidate turns. Add behavioral regression tests, update the affected avatar assertions, and document the new caption rule in
docs/avatar-contract.md.Validation:
./scripts/test.shexited with status 0; all 1033 browser tests passed.Closes #223
Summary by cubic
Keeps completed interviewer captions visible in full until the candidate's next transcribed speech or a code text change. Previously, completed Jim turns were truncated to 160 characters and hid after 12 seconds while the candidate was still thinking. Late updates for retired Jim segments and final replays of known candidate turns are now ignored, and a turn is only marked complete after its final transcription stream is read successfully. Editor clicks, focus, and language switches no longer dismiss the caption; only changed code text or new speech does. Adds behavioral regression tests and updates the avatar contract docs.
Written for commit 14b0c14. Summary will update on new commits.