feat(word-addin): Direct/Review toggle chooses whether edits need approval
WHY THIS MATTERS
Until now every model edit landed as a pending tracked change that the
user had to accept card by card. That is the right default for careful
legal review, but when a user just wants the fix ("correct my typos"),
the approval step is friction. This adds the explicitly requested
header toggle: apply edits directly, or route them through approval.
HOW IT WORKS
- A Direct/Review segmented control (the web app's glass TabPillButton
style) sits at the top of the chat header. The choice persists in
OfficeRuntime.storage under mike_word_edit_apply_mode; the safe
default is Review (approval).
- Review mode is the existing behavior: streamed edits apply as tracked
changes, and their cards stay linked for Accept/Reject/View.
- Direct mode reuses the same apply pipeline (search validation,
ambiguity guards, TrackAll authoring) and then immediately accepts
the revision, so the document shows final text with no review step.
Reusing accept-after-apply rather than writing untracked text means
every safety check and failure path stays identical in both modes.
- The mode is captured per edit at scheduling time, so flipping the
toggle mid-stream can never split one edit's lifecycle.
- Cards report the outcome with a new "applied" status ("Applied to the
document."), and the activity strip says "Applied change to the
document"; review controls are simply absent in Direct mode.
- If the auto-accept cannot complete, the card degrades honestly to the
unmanaged state pointing at Word's Review tab instead of pretending
the edit was finalized.
Covered by e2e/edit-apply-mode.spec.ts: default state, direct apply
with immediate acceptance and no leftover pending revisions, approval
flow unchanged, persistence across task-pane reloads, and mid-stream
toggle isolation.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
| Repository | open-legal-products/mike |
|---|---|
| Author | Amal <mamalanand3@gmail.com> |
| Authored | |
| Committed | |
| Parents | 26e91dba |
| Stats | 10 files changed , +338 , -20 |
| Part of | Make Word edit approval reliable across hosts |
Capture this commit into my fork
Download a Markdown prompt that tells Claude how to port this
exact commit into your working tree. Run it via
claude -p < capture-commit-f84ffd22.md
from inside the repo you want the change in.