Skip to content

Allow includeTranscript in all modes#5

Merged
skuzi merged 2 commits into
mainfrom
feat/include-transcript-all-modes
Jul 21, 2026
Merged

Allow includeTranscript in all modes#5
skuzi merged 2 commits into
mainfrom
feat/include-transcript-all-modes

Conversation

@skuzi

@skuzi skuzi commented Jul 21, 2026

Copy link
Copy Markdown
Collaborator

Summary

Makes the includeTranscript config flag work in any mode, not just audio.

Previously the expected/submitted transcript was written only in audio mode (in AudioGame.submit()). This moves the logic into the shared completion flow so a classic task (e.g. the Long Form email) can also opt in and give the grader the real transcription to compare.

  • completion.js: new saveCompletionStats() saves the numeric stats and, when config.includeTranscript is set, appends the Expected (reference) and Submitted (typed) transcriptions to stats.txt. It's layered on top of the shared serializer (read-back + re-post), so stats.js stays untouched.
  • audio-game.js: reverts to simply triggering showCompletionScreen() — no audio-specific transcript save.
  • Transcript = state.originalText (expected) + state.typedText (submitted), both mode-agnostic.

The transcripts are inserted before the Generated: line in stats.txt; the base task's extract_solution.py surfaces them in STDOUT for the grader.

Testing

  • npm run build passes.
  • Classic mode (allowMistakes + includeTranscript): typed "The quick brown fix." vs "The quick brown fox." → stats.txt contains the stats and both transcriptions. Audio mode uses the same shared path. No new console errors.

🤖 Generated with Claude Code

…ion.js)

Previously the expected/submitted transcript was only written in audio mode
(AudioGame.submit). Move it into the shared completion flow so any mode can opt in
via config.includeTranscript. completion.js now saves the stats and, when the flag
is set, appends both transcripts to stats.txt (layered on the shared serializer so
stats.js stays untouched); audio-game.js reverts to just triggering completion.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Jul 21, 2026

Copy link
Copy Markdown

Review Change Stack

Warning

Review limit reached

@skuzi, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 50 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: e0fcae37-ef45-4530-af44-0045c48f7b08

📥 Commits

Reviewing files that changed from the base of the PR and between a3aa18b and 42ef352.

📒 Files selected for processing (1)
  • client/completion.js
📝 Walkthrough

Walkthrough

The completion flow now saves statistics through saveCompletionStats, optionally appends expected and submitted transcriptions to stats.txt, and persists the updated text. showCompletionScreen waits for this saving flow before continuing. AudioGame.submit() no longer performs mode-specific transcript handling and directly invokes the completion screen. Documentation now describes includeTranscript as applying to all game modes.

Possibly related PRs

Suggested reviewers: diegochine

🚥 Pre-merge checks | ✅ 4
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly captures the main change: enabling includeTranscript across all modes.
Description check ✅ Passed The description is directly related to the changeset and accurately describes the transcript-saving refactor.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@client/completion.js`:
- Around line 21-23: Update the fetch flow in the completion logic before
reading the response body to validate the returned response’s ok status. If the
request for stats.txt is unsuccessful, handle it as an error and do not append
transcripts or write the resulting content back to the stats file; preserve the
existing processing for successful responses.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 2be949fe-86ab-463b-85d2-4d4aecba0095

📥 Commits

Reviewing files that changed from the base of the PR and between 3c49ae1 and a3aa18b.

📒 Files selected for processing (4)
  • AGENTS.md
  • README.md
  • client/completion.js
  • client/games/audio-game.js

Comment thread client/completion.js
fetch doesn't reject on HTTP errors, so a missing/errored stats.txt would append
transcripts to an error page and save it back. Check response.ok and bail out; the
base stats were already saved by saveStatistics, so the file stays intact.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@skuzi
skuzi merged commit 6e58006 into main Jul 21, 2026
1 check failed
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