forked from microsoft/FluidFramework
-
Notifications
You must be signed in to change notification settings - Fork 0
Constrainted reverts #1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Closed
yann-achard-MS
wants to merge
5
commits into
agarwal-navin:inverseConstraint
from
yann-achard-MS:constrainted-reverts
Closed
Constrainted reverts #1
yann-achard-MS
wants to merge
5
commits into
agarwal-navin:inverseConstraint
from
yann-achard-MS:constrainted-reverts
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
8d29250
to
704e854
Compare
agarwal-navin
pushed a commit
that referenced
this pull request
Jun 3, 2025
…pes into a consumable version for UI visualizations (microsoft#24482) ## Description Currently, the only way to get a set of objects for visualizing each change an LLM makes to your tree using the aiCollab library is for users to use the `sharedTreeDiff` utility that was created for the implicit strategy separately. This utility is not perfect, likely does not cover many edge cases and is fickle. However, when using the explicit strategy we maintain an edit log internally that is the source truth. Currently, we don't return the editLog because the `TreeEdit` type of the edit log is not simple for users the consume and visualize changes on their UI. The purpose of this ticket is to update the explicit strategy's entry point function `generateTreeEdits` by taking the editLog, which is an array of `TreeEdit`, and transforming it into a new set of objects "diffs" that can be easily used for UI visualizations and return it along with the success/fail response. ## Test Mapping the edit log diff to the front-end task card diff objects: ~~~ Front-end Diff: Insert [ { "type": "INSERT", "path": [ "tasks", 3 ], "value": { "title": "Task microsoft#4", "id": "2756a2e9-237d-487e-b75a-4ab7dd5e4a0d", "description": "This is the fourth task.", "priority": "Medium", "complexity": 2, "status": "To Do", "assignee": "Bob" } } ] ~~~ ~~~ Edit Log: Insert [ { "edit": { "type": "insert", "explanation": "Insert a new task titled 'Task microsoft#4' with description 'This is the fourth task.', priority 'Medium', complexity 2, and status 'To Do'. Assign the task to Bob and add it to the end of the tasks array.", "content": { "__fluid_objectId": "Task4", "title": "Task microsoft#4", "id": "2756a2e9-237d-487e-b75a-4ab7dd5e4a0d", "description": "This is the fourth task.", "priority": "Medium", "complexity": 2, "status": "To Do", "assignee": "Bob" }, "destination": { "type": "arrayPlace", "parentId": "TaskGroup1", "field": "tasks", "location": "end" } } } ] ~~~ ~~~ Front-end Diff: Change [ { "path": [ "tasks", 0, "status" ], "type": "CHANGE", "value": "Done", "oldValue": "To Do", "objectId": "09138b2d-a75e-4376-be83-2be153c18ba6" } ] ~~~ ~~~ Edit log: Change [ { "edit": { "type": "modify", "explanation": "Change the status of Task #1 from 'To Do' to 'Done'", "target": { "target": "Task1" }, "field": "status", "modification": "Done" } } ] ~~~ ~~~ Front-end Diff: Remove [ { "type": "REMOVE", "path": [ "tasks", 0 ], "oldValue": { "title": "Task #1", "id": "09138b2d-a75e-4376-be83-2be153c18ba6", "description": "This is the first task. Blah Blah blah Blah Blah blahBlah Blah blahBlah Blah blahBlah Blah blah", "priority": "Low", "complexity": 1, "status": "To Do", "assignee": "Alice" }, "objectId": "09138b2d-a75e-4376-be83-2be153c18ba6" }, { "type": "MOVE", "path": [ "tasks", 1 ], "newIndex": 0, "value": { "title": "Task microsoft#2", "id": "09138b2d-a75e-4376-be83-2be153c18ba7", "description": "This is the second task. Blah Blah blah Blah Blah blahBlah Blah blahBlah Blah blahBlah Blah blah", "priority": "Medium", "complexity": 2, "status": "In Progress", "assignee": "Bob" }, "objectId": "09138b2d-a75e-4376-be83-2be153c18ba7" }, { "type": "MOVE", "path": [ "tasks", 2 ], "newIndex": 1, "value": { "title": "Task microsoft#3", "id": "09138b2d-a75e-4376-be83-2be153c18ba8", "description": "This is the third task! Blah Blah blah Blah Blah blahBlah Blah blahBlah Blah blahBlah Blah blah", "priority": "High", "complexity": 3, "status": "Done", "assignee": "Charlie" }, "objectId": "09138b2d-a75e-4376-be83-2be153c18ba8" }, { "type": "MOVE", "path": [ "tasks", 3 ], "newIndex": 2, "value": { "title": "Task microsoft#4", "id": "2756a2e9-237d-487e-b75a-4ab7dd5e4a0d", "description": "This is the fourth task.", "priority": "Medium", "complexity": 2, "status": "To Do", "assignee": "Bob" }, "objectId": "2756a2e9-237d-487e-b75a-4ab7dd5e4a0d" } ] ~~~ ~~~ Edit log: Remove { "type": "remove", "explanation": "Remove Task#1 from the tasks array.", "source": { "target": "Task1" } } ~~~ ~~~ Front-end Diff: Move [ { "type": "MOVE", "path": [ "tasks", 0 ], "newIndex": 3, "value": { "title": "Task #1", "id": "09138b2d-a75e-4376-be83-2be153c18ba6", "description": "This is the first task. Blah Blah blah Blah Blah blahBlah Blah blahBlah Blah blahBlah Blah blah", "priority": "Low", "complexity": 1, "status": "To Do", "assignee": "Alice" }, "objectId": "09138b2d-a75e-4376-be83-2be153c18ba6" }, { "type": "MOVE", "path": [ "tasks", 1 ], "newIndex": 0, "value": { "title": "Task microsoft#2", "id": "09138b2d-a75e-4376-be83-2be153c18ba7", "description": "This is the second task. Blah Blah blah Blah Blah blahBlah Blah blahBlah Blah blahBlah Blah blah", "priority": "Medium", "complexity": 2, "status": "In Progress", "assignee": "Bob" }, "objectId": "09138b2d-a75e-4376-be83-2be153c18ba7" }, { "type": "MOVE", "path": [ "tasks", 2 ], "newIndex": 1, "value": { "title": "Task microsoft#3", "id": "09138b2d-a75e-4376-be83-2be153c18ba8", "description": "This is the third task! Blah Blah blah Blah Blah blahBlah Blah blahBlah Blah blahBlah Blah blah", "priority": "High", "complexity": 3, "status": "Done", "assignee": "Charlie" }, "objectId": "09138b2d-a75e-4376-be83-2be153c18ba8" }, { "type": "MOVE", "path": [ "tasks", 3 ], "newIndex": 2, "value": { "title": "Task microsoft#4", "id": "2756a2e9-237d-487e-b75a-4ab7dd5e4a0d", "description": "This is the fourth task.", "priority": "Medium", "complexity": 2, "status": "To Do", "assignee": "Bob" }, "objectId": "2756a2e9-237d-487e-b75a-4ab7dd5e4a0d" } ] ~~~ ~~~ Edit log: Move [ { "edit": { "type": "move", "explanation": "Move Task #1 to the end of the tasks array.", "source": { "target": "Task1" }, "destination": { "type": "arrayPlace", "parentId": "TaskGroup1", "field": "tasks", "location": "end" } } } ] ~~~ AB#[21569](https://dev.azure.com/fluidframework/internal/_workitems/edit/21569) --------- Co-authored-by: Joshua Smithrud <54606601+Josmithr@users.noreply.github.com>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
No description provided.