Skip to content

Keep completed interviewer captions readable - #271

Open
chenyu50 wants to merge 2 commits into
sysprog21:mainfrom
chenyu50:keep-interviewer-captions
Open

chenyu50 wants to merge 2 commits into
sysprog21:mainfrom
chenyu50:keep-interviewer-captions

Conversation

@chenyu50

@chenyu50 chenyu50 commented Oct 10, 2026 •

Copy link
Copy Markdown

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.sh exited with status 0; all 1033 browser tests passed.
  • In a local live interview, verified that a long Jim turn remained fully readable by scrolling, stayed visible beyond 13 seconds, and survived editor focus and caret movement.
  • Verified that candidate speech replaced Jim's caption, a new Jim turn replaced the previous turn and remained visible, and a code text edit hid the caption.
  • Added real-browser regression coverage for editor focus, clicks, caret movement, and language switches while a completed Jim caption is visible. Verified that a code text edit dismisses it.

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.

View guided diff

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.
cubic-dev-ai[bot]

This comment was marked as resolved.

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.
@chenyu50
chenyu50 force-pushed the keep-interviewer-captions branch from fdbe3a5 to 14b0c14 Compare October 10, 2026 08:02
Comment thread web/captions.js
}

/// Candidate edits must also prevent delayed Jim streams from restoring the bar.
export function dismissCaptions() {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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:

Suggested change
export function dismissCaptions() {
export function dismissCaptions() {
if (!interviewerCaption.final) return;

Comment thread web/captions.js
if (interviewerCaption.id !== id) {
clearTimeout(interviewerCaption.timer);
interviewerCaption = { id, text: "", shown: 0, timer: null };
retireInterviewerCaption();

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

.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:

Suggested change
retireInterviewerCaption();
retireInterviewerCaption();
if (nodes.captionsBar) nodes.captionsBar.scrollTop = 0;

@jserv jserv left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Rebase latest main branch and resolve conflicts.

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.

Keep Jim's last turn on screen until the candidate answers

2 participants