git_ui: New panel design (#25821)
This PR updates the ui of the git panel. It removes the header from the panel and unifies the repository, branch and commit controls in the bottom section. It also adds a secondary menu to the primary button giving access to a variety of actions for managing local and remote changes:  Known issues (will be fixed in a later pr) - Spinner showing git operation progress was removed, will be re-added - Clicking expand with the panel editor focused will commit (due to shared action name. Already tracked) Before | After  (Also adds `component`, `linkme` to cargo-machete ignore as they are used in the `IntoComponent` proc-macro and will always be incorrectly flagged as unused) Release Notes: - N/A --------- Co-authored-by: Cole Miller <m@cole-miller.net> Co-authored-by: Cole Miller <53574922+cole-miller@users.noreply.github.com> Co-authored-by: Cole Miller <cole@zed.dev>
This commit is contained in:
parent
8a22a07d14
commit
9d8a163f5b
26 changed files with 832 additions and 372 deletions
|
@ -220,7 +220,7 @@ impl RenderOnce for AvatarAvailabilityIndicator {
|
|||
|
||||
// View this component preview using `workspace: open component-preview`
|
||||
impl ComponentPreview for Avatar {
|
||||
fn preview(_window: &mut Window, cx: &App) -> AnyElement {
|
||||
fn preview(_window: &mut Window, cx: &mut App) -> AnyElement {
|
||||
let example_avatar = "https://avatars.githubusercontent.com/u/1714999?v=4";
|
||||
|
||||
v_flex()
|
||||
|
|
|
@ -458,7 +458,7 @@ impl RenderOnce for Button {
|
|||
|
||||
// View this component preview using `workspace: open component-preview`
|
||||
impl ComponentPreview for Button {
|
||||
fn preview(_window: &mut Window, _cx: &App) -> AnyElement {
|
||||
fn preview(_window: &mut Window, _cx: &mut App) -> AnyElement {
|
||||
v_flex()
|
||||
.gap_6()
|
||||
.children(vec![
|
||||
|
|
|
@ -202,7 +202,7 @@ impl RenderOnce for IconButton {
|
|||
}
|
||||
|
||||
impl ComponentPreview for IconButton {
|
||||
fn preview(_window: &mut Window, _cx: &App) -> AnyElement {
|
||||
fn preview(_window: &mut Window, _cx: &mut App) -> AnyElement {
|
||||
v_flex()
|
||||
.gap_6()
|
||||
.children(vec![
|
||||
|
|
|
@ -144,7 +144,7 @@ impl RenderOnce for ToggleButton {
|
|||
}
|
||||
|
||||
impl ComponentPreview for ToggleButton {
|
||||
fn preview(_window: &mut Window, _cx: &App) -> AnyElement {
|
||||
fn preview(_window: &mut Window, _cx: &mut App) -> AnyElement {
|
||||
v_flex()
|
||||
.gap_6()
|
||||
.children(vec![
|
||||
|
|
|
@ -90,7 +90,7 @@ impl RenderOnce for ContentGroup {
|
|||
|
||||
// View this component preview using `workspace: open component-preview`
|
||||
impl ComponentPreview for ContentGroup {
|
||||
fn preview(_window: &mut Window, _cx: &App) -> AnyElement {
|
||||
fn preview(_window: &mut Window, _cx: &mut App) -> AnyElement {
|
||||
example_group(vec![
|
||||
single_example(
|
||||
"Default",
|
||||
|
|
|
@ -61,7 +61,7 @@ impl RenderOnce for Facepile {
|
|||
}
|
||||
|
||||
impl ComponentPreview for Facepile {
|
||||
fn preview(_window: &mut Window, _cx: &App) -> AnyElement {
|
||||
fn preview(_window: &mut Window, _cx: &mut App) -> AnyElement {
|
||||
let faces: [&'static str; 6] = [
|
||||
"https://avatars.githubusercontent.com/u/326587?s=60&v=4",
|
||||
"https://avatars.githubusercontent.com/u/2280405?s=60&v=4",
|
||||
|
|
|
@ -218,6 +218,7 @@ pub enum IconName {
|
|||
Github,
|
||||
Globe,
|
||||
GitBranch,
|
||||
GitBranchSmall,
|
||||
Hash,
|
||||
HistoryRerun,
|
||||
Indicator,
|
||||
|
@ -492,7 +493,7 @@ impl RenderOnce for IconWithIndicator {
|
|||
|
||||
// View this component preview using `workspace: open component-preview`
|
||||
impl ComponentPreview for Icon {
|
||||
fn preview(_window: &mut Window, _cx: &App) -> AnyElement {
|
||||
fn preview(_window: &mut Window, _cx: &mut App) -> AnyElement {
|
||||
v_flex()
|
||||
.gap_6()
|
||||
.children(vec![
|
||||
|
|
|
@ -26,7 +26,7 @@ impl RenderOnce for DecoratedIcon {
|
|||
|
||||
// View this component preview using `workspace: open component-preview`
|
||||
impl ComponentPreview for DecoratedIcon {
|
||||
fn preview(_window: &mut Window, cx: &App) -> AnyElement {
|
||||
fn preview(_window: &mut Window, cx: &mut App) -> AnyElement {
|
||||
let decoration_x = IconDecoration::new(
|
||||
IconDecorationKind::X,
|
||||
cx.theme().colors().surface_background,
|
||||
|
|
|
@ -207,7 +207,7 @@ impl RenderOnce for KeybindingHint {
|
|||
|
||||
// View this component preview using `workspace: open component-preview`
|
||||
impl ComponentPreview for KeybindingHint {
|
||||
fn preview(window: &mut Window, cx: &App) -> AnyElement {
|
||||
fn preview(window: &mut Window, cx: &mut App) -> AnyElement {
|
||||
let enter_fallback = gpui::KeyBinding::new("enter", menu::Confirm, None);
|
||||
let enter = KeyBinding::for_action(&menu::Confirm, window, cx)
|
||||
.unwrap_or(KeyBinding::new(enter_fallback, cx));
|
||||
|
|
|
@ -199,7 +199,7 @@ mod label_preview {
|
|||
|
||||
// View this component preview using `workspace: open component-preview`
|
||||
impl ComponentPreview for Label {
|
||||
fn preview(_window: &mut Window, _cx: &App) -> AnyElement {
|
||||
fn preview(_window: &mut Window, _cx: &mut App) -> AnyElement {
|
||||
v_flex()
|
||||
.gap_6()
|
||||
.children(vec![
|
||||
|
|
|
@ -173,7 +173,7 @@ impl RenderOnce for Tab {
|
|||
|
||||
// View this component preview using `workspace: open component-preview`
|
||||
impl ComponentPreview for Tab {
|
||||
fn preview(_window: &mut Window, _cx: &App) -> AnyElement {
|
||||
fn preview(_window: &mut Window, _cx: &mut App) -> AnyElement {
|
||||
v_flex()
|
||||
.gap_6()
|
||||
.children(vec![example_group_with_title(
|
||||
|
|
|
@ -153,7 +153,7 @@ where
|
|||
|
||||
// View this component preview using `workspace: open component-preview`
|
||||
impl ComponentPreview for Table {
|
||||
fn preview(_window: &mut Window, _cx: &App) -> AnyElement {
|
||||
fn preview(_window: &mut Window, _cx: &mut App) -> AnyElement {
|
||||
v_flex()
|
||||
.gap_6()
|
||||
.children(vec![
|
||||
|
|
|
@ -510,7 +510,7 @@ impl RenderOnce for SwitchWithLabel {
|
|||
|
||||
// View this component preview using `workspace: open component-preview`
|
||||
impl ComponentPreview for Checkbox {
|
||||
fn preview(_window: &mut Window, _cx: &App) -> AnyElement {
|
||||
fn preview(_window: &mut Window, _cx: &mut App) -> AnyElement {
|
||||
v_flex()
|
||||
.gap_6()
|
||||
.children(vec![
|
||||
|
@ -595,7 +595,7 @@ impl ComponentPreview for Checkbox {
|
|||
|
||||
// View this component preview using `workspace: open component-preview`
|
||||
impl ComponentPreview for Switch {
|
||||
fn preview(_window: &mut Window, _cx: &App) -> AnyElement {
|
||||
fn preview(_window: &mut Window, _cx: &mut App) -> AnyElement {
|
||||
v_flex()
|
||||
.gap_6()
|
||||
.children(vec![
|
||||
|
@ -658,7 +658,7 @@ impl ComponentPreview for Switch {
|
|||
|
||||
// View this component preview using `workspace: open component-preview`
|
||||
impl ComponentPreview for CheckboxWithLabel {
|
||||
fn preview(_window: &mut Window, _cx: &App) -> AnyElement {
|
||||
fn preview(_window: &mut Window, _cx: &mut App) -> AnyElement {
|
||||
v_flex()
|
||||
.gap_6()
|
||||
.children(vec![example_group_with_title(
|
||||
|
|
|
@ -224,7 +224,7 @@ impl Render for LinkPreview {
|
|||
|
||||
// View this component preview using `workspace: open component-preview`
|
||||
impl ComponentPreview for Tooltip {
|
||||
fn preview(_window: &mut Window, _cx: &App) -> AnyElement {
|
||||
fn preview(_window: &mut Window, _cx: &mut App) -> AnyElement {
|
||||
example_group(vec![single_example(
|
||||
"Text only",
|
||||
Button::new("delete-example", "Delete")
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue