[INF-529] Fix ruby tags keyboard navigation. - #72
Conversation
Preserve inline markup when unwrapping ruby, document path setup before sync, and harden status when ckeditor.js is missing.
… missing Parse all rb child nodes when unwrapping ruby, and make link-to-tao status exit non-zero when ckeditor.js is absent.
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
WalkthroughThe PR refines CKEditor furigana caret, deletion, unwrapping, ZWS cleanup, and toolbar state behavior. It also adds a CKEditor-to-TAO synchronization script and documents furigana and qtiCreator testing workflows. ChangesFurigana editing and testing
Estimated code review effort: 4 (Complex) | ~45 minutes Sequence Diagram(s)sequenceDiagram
participant CKEditorSelection
participant taofurigana
participant RubyDOM
CKEditorSelection->>taofurigana: caret or deletion event
taofurigana->>RubyDOM: normalize ruby caret and inspect rt/rb
taofurigana->>RubyDOM: unwrap ruby or clean orphan ZWS
taofurigana->>CKEditorSelection: place caret after update
Possibly related PRs
Suggested reviewers: 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🧹 Nitpick comments (1)
plugins/taofurigana/plugin.js (1)
664-671: 🚀 Performance & Scalability | 🔵 Trivial | ⚡ Quick winRedundant
changeevent fired for the empty-rtunwrap path.
guardEmptyRtUnwrapfireseditor.fire('change')here, and it is invoked inside thecontentChangedgroup of thekeydownhandler (directly at Line 1709 and indirectly viaguardRtLeadingDeleteat Line 703). That group re-fireschangeat Line 1724, so each empty-rtBackspace/Delete triggerschangetwice, runningensureZwsAnchorsAfterRuby/refreshHasRubyFlagredundantly. Drop the internal fire so the outer handler owns it, or drop the guard from thecontentChangedgroup. Note thatguardBackspaceAfterRuby(Line 1029) legitimately fireschangeinternally because it is in thecaretOnlygroup where the outer handler does not.Proposed change
editor.fire('saveSnapshot'); editor.fire('lockSnapshot'); try { unwrapRubyToBaseText(rubyElement, selection); - editor.fire('change'); } finally { editor.fire('unlockSnapshot'); }🤖 Prompt for 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. In `@plugins/taofurigana/plugin.js` around lines 664 - 671, Remove the internal editor.fire('change') call from the empty-rt unwrap flow in guardEmptyRtUnwrap, while preserving the snapshot locking and unlock behavior. Keep the outer contentChanged group in the keydown handler responsible for firing change; do not alter guardBackspaceAfterRuby, which still needs its internal change event.
🤖 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 `@scripts/link-to-tao.sh`:
- Around line 186-187: Update cmd_restore to validate only the TAO target and
backup requirements, removing its dependency on require_shared_path and
CKEDITOR_DEV. Split source-checkout/build validation into a separate helper or
path used exclusively by sync, and ensure sync still performs that validation
before copying.
---
Nitpick comments:
In `@plugins/taofurigana/plugin.js`:
- Around line 664-671: Remove the internal editor.fire('change') call from the
empty-rt unwrap flow in guardEmptyRtUnwrap, while preserving the snapshot
locking and unlock behavior. Keep the outer contentChanged group in the keydown
handler responsible for firing change; do not alter guardBackspaceAfterRuby,
which still needs its internal change event.
🪄 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: c0fcc6d5-3f58-46da-a853-356f27a40873
📒 Files selected for processing (4)
README.mdplugins/taofurigana/lang/en.jsplugins/taofurigana/plugin.jsscripts/link-to-tao.sh
When caret is on the next line after ruby, find the ruby across the break and move caret back after it instead of letting Chrome delete the whole previous line.
Depends from #71, need to be merged after.
Ticket: https://oat-sa.atlassian.net/browse/INF-529
Extended key navigation control, changed navigation order.
Summary by CodeRabbit