Fix issue on dev with agent history menu not working. (#9656)

## Description
<!-- Please remember to add your design buddy onto the PR for review, if
it contains any UI changes! -->

Fixes https://warpdev.slack.com/archives/C08KTPNQN65/p1777573039998779.

The issue was that there were two views subscribing the up arrow event
and both would handle it. Both the normal history menu and the cloud
mode-only history menu would emit events in rapid succession. We now
make sure that only one of the views ever fires off events, since only
one history menu should be active at a time.

## 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?
-->

Before, hitting the up arrow in the agent conversation view would cause
the buggy behavior Roland described: the first query would get inserted
into the buffer and the history menu would appear to never open. Now, it
WAI.

## Agent Mode
- [x] Warp Agent Mode - This PR was created via Warp's AI Agent Mode
This commit is contained in:
Abhishek Pandya
2026-04-30 15:14:19 -05:00
committed by GitHub
parent f61ef1dcd9
commit 85ebd33bf5

View File

@@ -2631,6 +2631,9 @@ impl Input {
});
if FeatureFlag::InlineHistoryMenu.is_enabled() {
ctx.subscribe_to_view(&inline_history_menu_view, |me, _, event, ctx| {
if me.is_cloud_mode_input_v2_composing(ctx) {
return;
}
me.handle_inline_history_menu_event(event, ctx);
});
}
@@ -2655,6 +2658,9 @@ impl Input {
});
if FeatureFlag::InlineHistoryMenu.is_enabled() {
ctx.subscribe_to_view(&view, |me, _, event, ctx| {
if !me.is_cloud_mode_input_v2_composing(ctx) {
return;
}
me.handle_inline_history_menu_event(event, ctx);
});
}