feat(editor): expose imperative undo/redo history control - #149
feat(editor): expose imperative undo/redo history control#149seonghobae wants to merge 31 commits into
Conversation
|
Important Draft PR not reviewedDraft PRs are not automatically reviewed by default.
To automatically review draft PRs, update your CodeRabbit configuration: reviews:
auto_review:
drafts: true📝 WalkthroughWalkthrough
ChangesUndo/Redo Handle API
Estimated code review effort: 3 (보통) | ~20분 Possibly related issues
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
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. Comment |
|
@coderabbitai review |
|
Signed-off-by: Seongho Bae <me@seonghobae.me>
Signed-off-by: Seongho Bae <me@seonghobae.me>
|
Restacked onto protected Fresh verification:
This remains draft and dependency-gated by #118. @codex review |
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
Remove the duplicated Python support contract changes from this imperative-history branch. PR #405 remains the single writer while this branch keeps its editor history API and package delta. Signed-off-by: Seongho Bae <seonghobae@users.noreply.github.com> Commit-Message-Assisted-by: Claude (via Claude Code)
|
Office Python 지원 계약의 single-writer를 #405로 복원했습니다. imperative undo/redo API와 package 델타는 유지하고 공유 계약 파일만 additive revert로 제거했습니다. 현재 head: 1b0d3d4. 검증: 관련 13/13, 전체 build, packed package verification 통과. |
Closes #148.
Purpose
Implement #148 as a bounded host-control surface for the same undo/redo commands already owned by Inkspan's toolbar/editor history extensions, while making retained host handles consistently fail closed once the underlying TipTap editor has been destroyed, keeping user-facing history commands inert while the editor is read-only, and enforcing the public runtime string contract on active-editor imperative text mutation.
Implemented boundary
canUndo,undo,canRedo, andredodelegate to the currently registered history implementation;falsewhile the editor is read-only and do not consume history;setValue()andinsertValue()reject non-string JavaScript/untyped values on an active editor with stable payload-redactedTypeError('editor value must be a string.')before parser/editor access;No release workflow, release identity, persistence, transport, credential, model, provider, room, database, tenancy or durable-audit authority is added.
Test-first lineage
1d08f70210e5abdd68e2d83f4096117eab389973proved the stable handle lackedcanUndo/undo/canRedo/redowhile the editor already owned history commands.2fc4d9f83c1405697b23402689546d4a48e880c2, CI31414556067, proved a retained destroyed-editor handle still returned stale document state.554140d40035d5af4f006ad123d3bcdb5b55d261, CI31415215254, proved revision/evidence/restore paths still retained stale editor authority after destruction.836a72220ca66f390f660fb3eb71eebfaa84b621, CI31418632930, proved packed strict-TypeScript consumers did not exercise the new public history operations.d7ead2540d91cfbb0b64319946e554eab1119b44, CI31422150835, proved history remained actionable aftereditable={false}.e752891647cfd2341f362a70dcfbc029f8294e4fgates only the four user-facing history operations through an active-and-editable editor; explicit host-control mutators retain their existing programmatic authority.e6278289c47a54f97d450e7dad857f1397ebbe7badditionally proves read-only mode does not consume history and the same undo becomes available after editability returns.829c4097c8b86df01f32f04d10149ccf82acceb9non-destructively synchronized the branch with exact protected main; predecessor workflow/review evidence does not transfer.9388ac4faa0c96df8c0a4ccd81905becbef591d8, CI32242747975, build job96036683192: immutable install and typecheck succeeded, then the exact 100%-coverage suite failed exactly the new hostile-Proxy regression (1 failed / 844 passed) because the caller-controlled sentinel reached Marked instead of a stable Inkspan boundary failure.df91ce76ee1adef586040b7cf2bf2f8deb8f5f3avalidates active-editor imperative text before parser/editor access while preserving no-editor/destroyed-handle no-op semantics.8e0ab3832460d83b7ae0e664bf697bc2d53f19b4adds the matching active-PR contract documentation. Predecessor workflow/review evidence does not transfer to it.Current protected-main synchronization
Protected shipped truth is independently resolved as exact
main@3b38ead2d00f44eb578d0689087b9293b3dabe1e. Current exact Draft head is8e0ab3832460d83b7ae0e664bf697bc2d53f19b4.The branch remains Draft and GitHub reports it mechanically mergeable. The intended source/document delta remains confined to the canonical imperative-history handle lane; the runtime-input repair changes only that handle boundary and its regression/contract evidence.
Exact-current-head evidence
For unchanged exact head
8e0ab3832460d83b7ae0e664bf697bc2d53f19b4at the latest fresh refetch:32243336207: completed / success, including exactTypecheck,Test with 100% coverage, library build, packed package consumers, demo build, Office Python 3.11–3.14, and Playwright 1.62.0 cross-engine clipboard evidence;32243336423: completed / success;32243336185: completed / success;Pending/in-progress/queued/skipped/cancelled/absent/stale/predecessor/status-only/model-only evidence is non-passing. Repository technical results do not independently establish separately applicable central OpenCode/Noema/Strix/coverage/review generations, and automated/model/status evidence is not qualifying independent approval.
Integration dependency
Keep this PR Draft and unmerged while #118 owns the protected
v0.6.0release/publication boundary and while qualifying independent approval/live governance remain incomplete. Before any future lifecycle transition, refetch the unchanged exact head, live protected base, ancestry/mergeability, live rules/permissions, formal reviews/threads, and every applicable repository/central workflow. Require qualifying independent latest-push approval under live governance. No self-approval, force push, destructive rebase, gate weakening, predecessor-evidence transfer or fabricated release identity.