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:
parent
70351360d7
commit
d65855c4a1
1 changed files with 12 additions and 32 deletions
|
@ -11,10 +11,7 @@ use gpui::{
|
||||||
use language::{Anchor, Buffer, BufferId};
|
use language::{Anchor, Buffer, BufferId};
|
||||||
use project::{ConflictRegion, ConflictSet, ConflictSetUpdate, ProjectItem as _};
|
use project::{ConflictRegion, ConflictSet, ConflictSetUpdate, ProjectItem as _};
|
||||||
use std::{ops::Range, sync::Arc};
|
use std::{ops::Range, sync::Arc};
|
||||||
use ui::{
|
use ui::{ActiveTheme, Element as _, Styled, Window, prelude::*};
|
||||||
ActiveTheme, AnyElement, Element as _, StatefulInteractiveElement, Styled,
|
|
||||||
StyledTypography as _, Window, div, h_flex, rems,
|
|
||||||
};
|
|
||||||
use util::{ResultExt as _, debug_panic, maybe};
|
use util::{ResultExt as _, debug_panic, maybe};
|
||||||
|
|
||||||
pub(crate) struct ConflictAddon {
|
pub(crate) struct ConflictAddon {
|
||||||
|
@ -391,20 +388,15 @@ fn render_conflict_buttons(
|
||||||
cx: &mut BlockContext,
|
cx: &mut BlockContext,
|
||||||
) -> AnyElement {
|
) -> AnyElement {
|
||||||
h_flex()
|
h_flex()
|
||||||
.h(cx.line_height)
|
|
||||||
.items_end()
|
|
||||||
.ml(cx.margins.gutter.width)
|
|
||||||
.id(cx.block_id)
|
.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(
|
.child(
|
||||||
div()
|
Button::new("head", "Use HEAD")
|
||||||
.id("ours")
|
.label_size(LabelSize::Small)
|
||||||
.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()
|
|
||||||
.on_click({
|
.on_click({
|
||||||
let editor = editor.clone();
|
let editor = editor.clone();
|
||||||
let conflict = conflict.clone();
|
let conflict = conflict.clone();
|
||||||
|
@ -423,14 +415,8 @@ fn render_conflict_buttons(
|
||||||
}),
|
}),
|
||||||
)
|
)
|
||||||
.child(
|
.child(
|
||||||
div()
|
Button::new("origin", "Use Origin")
|
||||||
.id("theirs")
|
.label_size(LabelSize::Small)
|
||||||
.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()
|
|
||||||
.on_click({
|
.on_click({
|
||||||
let editor = editor.clone();
|
let editor = editor.clone();
|
||||||
let conflict = conflict.clone();
|
let conflict = conflict.clone();
|
||||||
|
@ -449,14 +435,8 @@ fn render_conflict_buttons(
|
||||||
}),
|
}),
|
||||||
)
|
)
|
||||||
.child(
|
.child(
|
||||||
div()
|
Button::new("both", "Use Both")
|
||||||
.id("both")
|
.label_size(LabelSize::Small)
|
||||||
.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()
|
|
||||||
.on_click({
|
.on_click({
|
||||||
let editor = editor.clone();
|
let editor = editor.clone();
|
||||||
let conflict = conflict.clone();
|
let conflict = conflict.clone();
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue