Skip to content

Commit d09a90e

Browse files
authored
Add editable keybinding for toggling the conversation details panel. (#9837)
## Description <!-- Please remember to add your design buddy onto the PR for review, if it contains any UI changes! --> WISOTT. Follows precedent for defining keys in the keymap context and uses existing function for determining whether this keybinding should be active. Defaults to unset - I wasn't sure of a good keybind for this and don't think it warrants a default. ## Testing <!-- How did you test this change? What automated tests did you add? If you didn't add any new tests, what's your justification for not adding any? --> Ran locally, set a keybinding (cmd + alt + I), and then observed toggle behavior. ## Agent Mode - [x] Warp Agent Mode - This PR was created via Warp's AI Agent Mode ## Changelog Entries for Stable <!-- The entries below will be used when constructing a soft-copy of the stable release changelog. Leave blank or remove the lines if no entry in the stable changelog is needed. Entries should be on the same line, without the `{{` `}}` brackets. You can use multiple lines, even of the same type. The valid suffixes are: * NEW-FEATURE: for new, relatively sizable features. Features listed here will likely have docs / social media posts / marketing launches associated with them, so use sparingly. * IMPROVEMENT: for new functionality of existing features. * BUG-FIX: for fixes related to known bugs or regressions. * IMAGE: the image specified by the URL (hosted on GCP) will be added to Dev & Preview releases. For Stable releases, see the pinned doc in the #release Slack channel. * OZ: Oz-related updates. Use `CHANGELOG-OZ`. At most 4 Oz updates are shown in-app per release. CHANGELOG-NEW-FEATURE: {{text goes here...}} CHANGELOG-IMPROVEMENT: {{text goes here...}} CHANGELOG-BUG-FIX: {{text goes here...}} CHANGELOG-BUG-FIX: {{more text goes here...}} CHANGELOG-IMAGE: {{GCP-hosted URL goes here...}} CHANGELOG-OZ: {{text goes here...}} --> CHANGELOG-IMPROVEMENT: The conversation details panelcan now be opened and closed with a configurable keyboard shortcut.
1 parent eed7e64 commit d09a90e

2 files changed

Lines changed: 15 additions & 0 deletions

File tree

app/src/terminal/view.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26467,6 +26467,11 @@ impl View for TerminalView {
2646726467
context.set.insert("InsideRepository");
2646826468
}
2646926469

26470+
#[cfg(not(target_arch = "wasm32"))]
26471+
if self.can_show_conversation_details_ui_from_model(&model_lock, app) {
26472+
context.set.insert(init::CAN_SHOW_CONVERSATION_DETAILS_KEY);
26473+
}
26474+
2647026475
let active_conversation = if FeatureFlag::AgentView.is_enabled() {
2647126476
self.agent_view_controller
2647226477
.as_ref(app)

app/src/terminal/view/init.rs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@ pub const INPUT_BOX_VISIBLE_KEY: &str = "InputVisible";
6060
pub const KEYBOARD_PROTOCOL_ENABLED_KEY: &str = "KeyboardProtocolEnabled";
6161
pub const CLI_AGENT_SESSION_ACTIVE_KEY: &str = "CLIAgentSessionActive";
6262
pub const ROOT_CLOUD_MODE_PANE_KEY: &str = "RootCloudModePane";
63+
pub const CAN_SHOW_CONVERSATION_DETAILS_KEY: &str = "CanShowConversationDetails";
6364

6465
/// Some keybindings will do different things in different contexts. We break
6566
/// these into their own function to ensure we pay special attention to
@@ -1086,6 +1087,15 @@ pub fn init(app: &mut AppContext) {
10861087
.with_enabled(|| FeatureFlag::Projects.is_enabled())
10871088
.with_context_predicate(id!("Workspace") & id!(flags::IS_ANY_AI_ENABLED))]);
10881089

1090+
#[cfg(not(target_arch = "wasm32"))]
1091+
app.register_editable_bindings([EditableBinding::new(
1092+
"terminal:toggle_conversation_details_panel",
1093+
"Toggle Conversation Details Panel",
1094+
TerminalAction::ToggleConversationDetailsPanel,
1095+
)
1096+
.with_group(bindings::BindingGroup::WarpAi.as_str())
1097+
.with_context_predicate(id!("Terminal") & id!(CAN_SHOW_CONVERSATION_DETAILS_KEY))]);
1098+
10891099
// Register bindings for starting a new cloud agent conversation.
10901100
{
10911101
app.register_fixed_bindings([FixedBinding::new_per_platform(

0 commit comments

Comments
 (0)