Skip to content

Accept tracked changes; list a whole project's tracked changes - #14

Merged
lonetis merged 2 commits into
lonetis:mainfrom
JohannKaspar:wt/accept-changes
Nov 19, 2026
Merged

lonetis merged 2 commits into
lonetis:mainfrom
JohannKaspar:wt/accept-changes

Conversation

@JohannKaspar

Copy link
Copy Markdown
Contributor

Builds on #13. This branch contains #13's commit (af3a9df) plus one new commit (993cbf3). Please merge #13 first; after that, this PR's diff shrinks to just the new commit.

Changes

  • Accept tracked changes. acceptTrackedChanges(path, ids) (SDK) calls Overleaf's POST /project/:id/doc/:docId/changes/accept {change_ids}, the same request the review panel's Accept sends. Before sending, the ids are checked against freshly read ranges; if any id is not pending in that doc, nothing is accepted. Returns the accepted changes.
  • MCP: new tool overleaf_accept_tracked_changes {project, path, changeIds}. It is marked destructiveHint: true, because an accepted suggestion can no longer be rejected. Its description limits it to changes the user explicitly said to accept.
  • CLI: accept <project> <path> <id>... | --all [--before ISO-DATE].
  • Whole-project listing: listTrackedChanges (and overleaf_list_tracked_changes, claudeleaf changes) now lists every doc's changes when path is omitted. Each change carries its path.
  • Rejecting is not included: the editor rejects by applying the inverse op on the client side, which would be a separate change.

Verified live

On a test project: accepting returns 204. Text and version are unchanged; the ranges drop the changes; the server broadcasts accept-changes [docId, ids] to the project. I also used it on a real project to accept 463 changes across 24 docs in one pass.

Tests

  • Unit tests: accept by id (duplicate ids are collapsed, the text stays unchanged), an unknown id accepts nothing, an empty list does nothing, and listing with no path covers the whole project.
  • Live test: make a tracked insert, edit inside it, accept it; afterwards no changes are left and the text is kept.
  • The full suite passes against a dedicated test project. The two reconnect/remote-op tests failed once while another session was busy on the same account, and passed when re-run on their own.

…ckedChanges in MCP

The suggestion guard refused any edit touching a pending tracked change, including the
signed-in user's own, so follow-up edits inside one's own unaccepted suggestions were
impossible. Now only other authors' changes are protected: the user id comes from the
project page's ol-user_id and changes with that user_id pass. Verified live that a tracked
insert inside one's own tracked insertion extends it and a tracked delete shrinks it.
Unknown user id or authorless changes stay protected.

The MCP write tools take overwriteTrackedChanges, described as only for when the user
explicitly said to override a co-author's suggestion.
acceptTrackedChanges(path, ids) calls Overleaf's POST /project/:id/doc/:docId/changes/accept
(verified live: text and version unchanged, ranges drop the changes, accept-changes is
broadcast). Ids are checked against fresh ranges; if any is not pending, nothing is accepted.
Exposed as MCP overleaf_accept_tracked_changes (destructive, only for changes the user said to
accept) and CLI accept (ids, --all, --before). listTrackedChanges without a path walks every
doc, and each change now carries its path.
@lonetis
lonetis merged commit 2131d17 into lonetis:main Nov 19, 2026
1 check passed
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.

2 participants