mirror of
https://github.com/warpdotdev/warp.git
synced 2026-05-06 15:22:21 +08:00
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:
@@ -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);
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user