Skip to content

fix(transcript): refuse every native edit the block does not handle - #1049

Merged
EtienneLescot merged 1 commit into
mainfrom
fix/1038-transcript-format-keys
Oct 7, 2026
Merged

EtienneLescot merged 1 commit into
mainfrom
fix/1038-transcript-format-keys

Conversation

@EtienneLescot

@EtienneLescot EtienneLescot commented Oct 7, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

  • The transcript block is contentEditable only to carry a caret. Its native beforeinput guard prevented delete* and insert* and let the rest through, so Ctrl/Cmd+B, I and U styled the words in the DOM while transcript.words stayed unchanged.
  • The guard now refuses every input type, then still routes delete* to the cut and insert* to the insertion field. A future input type is covered too.
  • Undo is unaffected: Ctrl/Cmd+Z goes to the document undo (keydown, or the Edit menu on macOS). Paste is still handled in handlePaste.

Related issue

Closes #1038

Type of change

  • Bug fix

Release impact

  • Patch

Desktop impact

  • Not platform-specific

Testing

  • New tests in TranscriptPane.wordInsert.test.tsx: formatBold, formatItalic, formatUnderline, historyUndo and historyRedo are blocked; delete still cuts; insert still opens the field. The blocking tests fail without the fix.
  • Targeted vitest (transcript pane, store): 303 passed. Both tsc configs and Biome.
  • Not done: a real OS keyboard.

🤖 Generated with Claude Code

Summary by CodeRabbit

  • Bug Fixes
    • The transcript editor now prevents unsupported formatting and browser undo/redo actions from changing transcript content without updating the transcript data.
    • Deletion continues to trim the transcript, and text insertion continues to open the insertion field.

…1038)

The transcript's beforeinput guard prevented only delete* and insert*, so Ctrl/Cmd+B, I and U (formatBold/Italic/Underline) styled the words in the DOM behind transcript.words. The guard now prevents every input type, then routes delete* to the cut and insert* to the insertion field as before.
@coderabbitai

coderabbitai Bot commented Oct 7, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 1e67f99f-9c8e-4274-a6a6-e0474ff9e4be
📥 Commits

Reviewing files that changed from the base of the PR and between c3b2cad and ec3de6d.

📒 Files selected for processing (2)
  • src/components/ai-edition/RightPanes.tsx
  • src/components/ai-edition/TranscriptPane.wordInsert.test.tsx

Included review availability: This review used your included allowance. Your plan provides up to 8 included reviews per hour; 6 remain after this review.


📝 Walkthrough

Walkthrough

The transcript editor now prevents native beforeinput edits before handling input types. Tests cover formatting, undo and redo, backward deletion, and text insertion.

Changes

Transcript input handling

Layer / File(s) Summary
Guard native transcript edits
src/components/ai-edition/RightPanes.tsx, src/components/ai-edition/TranscriptPane.wordInsert.test.tsx
The handler prevents default before dispatching input types. Tests check that formatting and history events are blocked, while deletion triggers trimming and text insertion opens the insertion field.

Priority: ⬇️ Low

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Bug fix · Severity of issue fixed: Low

Suggested reviewers: beetix

Merge Risk: ⚪ Minimal · up to ec3de

Formatting shortcuts such as bold, italic and underline no longer alter the transcript DOM, which keeps it in sync with the transcript data. Delete and insert behavior is preserved. The change looks safe to merge.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly describes the main change: the transcript block now refuses native edits it does not handle.
Description check ✅ Passed The description covers the change, linked issue, bug-fix type, release and desktop impact, and testing. It also notes that real OS keyboard testing was not done. The omitted screenshots section is not…
Linked Issues check ✅ Passed Issue #1038 requires formatting shortcuts in the transcript to leave the DOM unchanged. RightPanes.tsx now calls preventDefault() for every non-input beforeinput event before handling delete and…
Out of Scope Changes check ✅ Passed All changes support issue #1038. The additional history-event tests and default-deny behavior cover other native edits that the transcript block does not handle. The delete and insert tests verify tha…
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 1 functions across 2 files.
✨ Finishing Touches
📝 Generate docstrings
  • Commit to this branch
  • Create a new PR
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR
  • Autopilot · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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.

@EtienneLescot
EtienneLescot merged commit 08604ab into main Oct 7, 2026
19 checks passed
@EtienneLescot
EtienneLescot deleted the fix/1038-transcript-format-keys branch October 7, 2026 10:08
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.

[Bug]: Ctrl+B / Ctrl+I / Ctrl+U format the words of the transcript

1 participant