git: Change merge conflict button labels (#34297)

Following feedback that "Take Ours" and "Take Theirs" was confusing,
leading to users not knowing what exactly happened with each of these
buttons. It's now "Use HEAD" and "Use Origin", which also match what is
written in Git markers, helping parse them out more easily. Future
improvement is to have the actual branch target name in the "Use Origin"
button.

Release Notes:

- git: Improved merge conflict buttons clarity by changing labels to
"Use HEAD" and "Use Origin".
This commit is contained in:
Danilo Leal
2025-07-11 13:15:06 -03:00
committed by GitHub
parent 70351360d7
commit d65855c4a1
+12 -32
View File
@@ -11,10 +11,7 @@ use gpui::{
use language::{Anchor, Buffer, BufferId};
use project::{ConflictRegion, ConflictSet, ConflictSetUpdate, ProjectItem as _};
use std::{ops::Range, sync::Arc};
use ui::{
ActiveTheme, AnyElement, Element as _, StatefulInteractiveElement, Styled,
StyledTypography as _, Window, div, h_flex, rems,
};
use ui::{ActiveTheme, Element as _, Styled, Window, prelude::*};
use util::{ResultExt as _, debug_panic, maybe};
pub(crate) struct ConflictAddon {
@@ -391,20 +388,15 @@ fn render_conflict_buttons(
cx: &mut BlockContext,
) -> AnyElement {
h_flex()
.h(cx.line_height)
.items_end()
.ml(cx.margins.gutter.width)
.id(cx.block_id)
.gap_0p5()
.h(cx.line_height)
.ml(cx.margins.gutter.width)
.items_end()
.gap_1()
.bg(cx.theme().colors().editor_background)
.child(
div()
.id("ours")
.px_1()
.child("Take Ours")
.rounded_t(rems(0.2))
.text_ui_sm(cx)
.hover(|this| this.bg(cx.theme().colors().element_background))
.cursor_pointer()
Button::new("head", "Use HEAD")
.label_size(LabelSize::Small)
.on_click({
let editor = editor.clone();
let conflict = conflict.clone();
@@ -423,14 +415,8 @@ fn render_conflict_buttons(
}),
)
.child(
div()
.id("theirs")
.px_1()
.child("Take Theirs")
.rounded_t(rems(0.2))
.text_ui_sm(cx)
.hover(|this| this.bg(cx.theme().colors().element_background))
.cursor_pointer()
Button::new("origin", "Use Origin")
.label_size(LabelSize::Small)
.on_click({
let editor = editor.clone();
let conflict = conflict.clone();
@@ -449,14 +435,8 @@ fn render_conflict_buttons(
}),
)
.child(
div()
.id("both")
.px_1()
.child("Take Both")
.rounded_t(rems(0.2))
.text_ui_sm(cx)
.hover(|this| this.bg(cx.theme().colors().element_background))
.cursor_pointer()
Button::new("both", "Use Both")
.label_size(LabelSize::Small)
.on_click({
let editor = editor.clone();
let conflict = conflict.clone();