Skip to content

fix(transcript): make a skipped word's restore control reachable - #1035

Merged
EtienneLescot merged 2 commits into
mainfrom
fix/1012-transcript-restore-control
Oct 6, 2026
Merged

EtienneLescot merged 2 commits into
mainfrom
fix/1012-transcript-restore-control

Conversation

@EtienneLescot

@EtienneLescot EtienneLescot commented Oct 6, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

  • The transcript's hover chips (restore a cut word, revert a correction, delete an inserted word) are laid over the text just past the word instead of inserted into it. In the flow, the chip of a word ending its line wrapped to the next line: reaching it meant leaving the word, which removed it.
  • Ctrl/Cmd+Z with focus in the transcript now runs the document undo. The transcript is contentEditable, so the shortcut went to the browser's text undo, which never sees a cut.

Related issue

Closes #1012

Type of change

  • Bug fix

Release impact

  • Patch

Desktop impact

  • Not platform-specific

Testing

  • New TranscriptPane.restore.test.tsx: hover, the move onto the chip, the restore, and Ctrl+Z by keydown and by the Edit menu. 3 of 4 fail on main.
  • Headless Chrome with real pointer input, mid-line and line-final words, at DPR 1 and 2.
  • Not done: a real OS pointer on macOS.

🤖 Generated with Claude Code

The hover chips of the word stream (restore a cut word, revert a
correction, delete an inserted word) were inserted into the text flow
while the word was hovered. After a word ending its line the chip did
not fit and wrapped to the start of the next line, so the pointer could
only reach it by leaving the word, which took it away. It also reflowed
the paragraph on every hover.

The chip is now laid over the stream just past the word, with the gap
as its own padding so the way onto it never leaves the word. The cut
word's restore button now goes through WordChipButton instead of a copy
of it.

Refs #1012
The undo shortcut treated every contentEditable as a text field and left
it to the browser's text undo. The transcript is contentEditable only to
carry a caret: its edits are document writes (Backspace is a trim) that
the browser's history never sees, so Ctrl+Z there, and Cmd+Z through the
Edit menu on macOS, did nothing at all.

A block marked data-document-undo now gets the document undo. The word
editor and other fields inside it keep the browser's text undo.

Refs #1012
@coderabbitai

coderabbitai Bot commented Oct 6, 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: b8dfcdfb-2c1b-43ad-a5ea-9b83714d01a2
📥 Commits

Reviewing files that changed from the base of the PR and between 8f3046c and 0b57a13.

📒 Files selected for processing (3)
  • src/components/ai-edition/RightPanes.tsx
  • src/components/ai-edition/TranscriptPane.restore.test.tsx
  • src/lib/ai-edition/store/undo.ts

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


📝 Walkthrough

Walkthrough

The transcript editor now shows a reachable restore control when hovering over a skipped word. Ctrl+Z and the exposed undo handler can remove the word’s skip marker through document-level undo.

Changes

Transcript word restoration

Layer / File(s) Summary
Restore control placement
src/components/ai-edition/RightPanes.tsx, src/components/ai-edition/TranscriptPane.restore.test.tsx
Transcript word spans position themselves relatively on hover. The restore control uses WordChipButton and appears beside its host word. Tests cover hover visibility, pointer movement, clicking, and dismissal.
Transcript document undo
src/components/ai-edition/RightPanes.tsx, src/lib/ai-edition/store/undo.ts, src/components/ai-edition/TranscriptPane.restore.test.tsx
The transcript editor is marked for document-level undo. Content-editable elements inside that region are not treated as text-editing targets. Tests cover Ctrl+Z and the undo handler removing the word’s skip marker.

Priority: ➖ Normal

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

Change: Bug fix · Severity of issue fixed: Medium

Merge Risk: ⚪ Minimal · up to 0b57a

This change makes the restore control for skipped transcript words reachable and routes Ctrl/Cmd+Z in the transcript to document undo. No actionable merge-blocking risk was found. Testing with a real OS pointer on macOS has not been done.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 50.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 8 functions across 3 files. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly identifies the transcript restore control as the main change and is concise.
Description check ✅ Passed The description includes a change summary, related issue, change type, release and desktop impact, and specific testing details. It omits the Screenshots / video section, which is a minor gap for a UI…
Linked Issues check ✅ Passed Issue #1012 requires the skipped-word restore control to remain reachable and Ctrl/Cmd+Z to restore the word. In RightPanes.tsx, the hovered word becomes the positioning anchor and WordChipButton …
Out of Scope Changes check ✅ Passed The changed transcript chip positioning and shared button markup support the reachable restore control in issue #1012. The undo-target handling and tests support the issue's Ctrl/Cmd+Z requirement. Th…
  • Fix all pre-merge checks with AI
✨ Finishing Touches 💡 1
📝 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 ef014f7 into main Oct 6, 2026
19 checks passed
@EtienneLescot
EtienneLescot deleted the fix/1012-transcript-restore-control branch October 6, 2026 15:32
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]: Restore control of a skipped transcript word cannot be clicked (regression of #745)

1 participant