Repository navigation
Keep lineup drafts away from the agent they came from - #425
Merged
Merged
Conversation
A draft from Create Lineup was the placed agent itself: same object, same id. The delete shortcut or a drop on the trash deleted the placed agent, and dragging the draft moved it with no undo step or cloud op. The draft is now a copy with the same id, and nothing deletes a placed agent while a lineup mode has the page out of reach. Lineup ids and the saved format don't change.
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 27 minutes. View limit details
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. |
This was referenced Nov 1, 2026
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
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.
A user building a lineup from a placed agent could lose that agent without seeing it happen. Right-click an agent, choose Create Lineup, hover the draft and press E, and the placed agent is deleted. The screen doesn't change, because the draft is drawn in the same spot, so you find out when you press Cancel and the agent isn't there.
ci: test analyze
What was wrong
The draft was the placed agent: same object, same id. I reproduced all of this on main in a Windows release build:
Undo brought the agent back after both deletes, if you noticed. It did nothing for the move, and a cloud strategy kept showing synced with the old position on the server.
The Delete key was never affected. It only acts on a selection and is ignored in lineup mode. E is the shortcut for the hovered item, and it's the key printed on the trash tile.
The fix
Two small changes, and both are needed:
setDraftAgentstores a copy with the same id, so moving a draft moves only the draft._removePlacedAgentindelete_helpers.dartrefuses while a lineup mode is on. Both delete paths use it. A lineup mode keeps the page out of reach, so an agent acted on there is a draft.I started with the second change only. The running build then showed the trash drop leaving the agent alive but dragged under the tile, with no undo and the server out of date. That's worse than the delete it replaced, hence the copy.
E on a draft now does nothing, the same as E on a draft dragged from the sidebar. Cancel is still how you drop a draft.
Lineup ids and the saved format don't change. The draft keeps the agent's id, which is why a saved lineup's origin agent still does too.
agent_widget.dartis untouched, to keep the rebase of #417 small.Ground truth
Windows release driver builds against the dev deployment, new script
tool/drive/scripts/lineup-draft-delete.json. It first deletes a plain hovered agent with E, which proves keys are landing, then runs the draft steps. Both modes finished CLEAN on the fixed build:test/lineup_draft_delete_test.darthas the shortcut and off-map drop cases. Both failed before the fix, with the agent gone. 145 tests across the lineup, selection and delete files pass.Not covered


Confidence Score: 5/5
The PR appears safe to merge; no actionable issues were found.Summary
The PR separates lineup drafts from their source agents and prevents draft delete gestures from deleting those agents.
No actionable issues found. Source checks support both parts of the fix; tests and Windows builds were not rerun during this review.
SunkenInTime explicitly acknowledged that trash drops leave the draft at the drop spot, web was not tested, and driver runs may need retries when focus changes. These are not reported as findings.
Reviews (1) · Last reviewed commit: "Keep lineup drafts away from the agent t..." · Reviewed by Greptile