mirror of
https://github.com/zed-industries/zed.git
synced 2026-11-19 06:59:22 +01:00
4191aeaf50
Closes #55523 When the agent proposes a [chained command](https://github.com/zed-industries/zed/issues/55523) like `ls && git status && git log`, the permission dropdown lists an "Always for `X` commands" checkbox per sub-command. Clicking one checkbox activates pattern mode with *all* patterns pre-checked, so the user appeared to be approving every command in the pipeline even though they had only clicked one. Pressing Allow then allow-listed every sub-command. Fix: the first click activates pattern mode with only the clicked pattern checked. Additional patterns require explicit checks. **Note**: I've rebased onto `main` after #65039, which moved the dropdown's selection state into `Conversation`. The dropdown's click handler and the `ToggleCommandPattern` action handler now both call `Conversation::toggle_permission_pattern`, so the fix lives in one place. The duplicated fix and the one-click-behind workaround from the previous version of this PR are gone. **Self-Review Checklist** - [x] I've reviewed my own diff for quality, security, and reliability - [x] Unsafe blocks (if any) have justifying comments - [x] The content is consistent with the [UI/UX checklist](https://github.com/zed-industries/zed/blob/main/CONTRIBUTING.md#uiux-checklist) - [x] Tests cover the new/changed behavior - [x] Performance impact has been considered and is acceptable Release Notes: - Fixed the agent's permission dropdown for chained terminal commands checking every command when you clicked only one. --------- Co-authored-by: Smit Barmase <heysmitbarmase@gmail.com>