[WAR-7381] Move "Discard all" to end of code review overflow menu (#9236)

## Description

Moves the "Discard all" menu item to the last position in
`header_menu_items_new`, so it appears after the AI context and comment
items. This matches the intended UX ordering from
[WAR-7381](https://linear.app/warpdotdev/issue/WAR-7381/discard-all-should-be-the-last-item-in-the-list).

## Testing

Manually verified the ordering logic. No new tests needed — this is a
pure reordering of existing menu items with no behavioral changes.

## Agent Mode
- [x] Warp Agent Mode - This PR was created via Warp's AI Agent Mode

Co-Authored-By: Oz <oz-agent@warp.dev>

Co-authored-by: Oz <oz-agent@warp.dev>
This commit is contained in:
Edward Shao
2026-04-28 12:13:46 -04:00
committed by GitHub
co-authored by Oz
parent 7104a12fcf
commit 3f120e438d
+9 -9
View File
@@ -7025,15 +7025,6 @@ impl CodeReviewView {
let has_changes = matches!(self.state(), CodeReviewViewState::Loaded(loaded) if !loaded.to_diff_stats().has_no_changes());
if FeatureFlag::DiscardPerFileAndAllChanges.is_enabled() && has_changes {
items.push(
MenuItemFields::new("Discard all")
.with_icon(Icon::ReverseLeft)
.with_on_select_action(CodeReviewAction::ShowDiscardConfirmDialog(None))
.into_item(),
);
}
let is_ai_enabled = AISettings::as_ref(ctx).is_any_ai_enabled(ctx);
if is_ai_enabled && FeatureFlag::DiffSetAsContext.is_enabled() && has_changes {
items.push(
@@ -7060,6 +7051,15 @@ impl CodeReviewView {
);
}
if FeatureFlag::DiscardPerFileAndAllChanges.is_enabled() && has_changes {
items.push(
MenuItemFields::new("Discard all")
.with_icon(Icon::ReverseLeft)
.with_on_select_action(CodeReviewAction::ShowDiscardConfirmDialog(None))
.into_item(),
);
}
items
}