mirror of
https://github.com/zed-industries/zed.git
synced 2026-11-20 15:40:29 +01:00
f8b74acc0f
Follow-up to the terminal permission params refactor, addressing @benbrandt's [review feedback](https://github.com/zed-industries/zed/pull/51782#pullrequestreview-2926899804) about string formatting leaking into the UI layer. ## Changes ### Outcome construction moved to acp_thread - Added `PermissionOptionChoice::build_outcome(is_allow)` — builds a `SelectedPermissionOutcome` from a choice, attaching `SelectedPermissionParams::Terminal` when the choice carries `sub_patterns`. - Added `PermissionOptions::build_outcome_for_checked_patterns(checked_indices, is_allow)` — handles the `DropdownWithPatterns` per-command checklist flow, returning `None` when zero patterns are checked (degrading to once). The UI's `authorize_with_granularity` no longer does any `format!("always_allow:{}",...)` string formatting or `SelectedPermissionParams` construction. ### `option_kind` folded into `SelectedPermissionOutcome` `SelectedPermissionOutcome` now carries `option_kind: acp::PermissionOptionKind`, eliminating the separate parameter that was threaded through the entire `authorize_tool_call` chain: ``` ThreadView::authorize_tool_call → Conversation::authorize_tool_call → AcpThread::authorize_tool_call ``` Every signature in this chain dropped one parameter. ### `SelectedPermissionParams` removed from UI imports The type is now only referenced by `acp_thread` (construction) and `agent` (consumption). The UI passes `SelectedPermissionOutcome` opaquely. Release Notes: - N/A