From faadc8528ca59be88cfdef7e5301de8e2152eb47 Mon Sep 17 00:00:00 2001 From: l0ng-ai <24760907+l0ng-ai@users.noreply.github.com> Date: Fri, 25 Sep 2026 01:32:24 +0800 Subject: [PATCH] fix(ui): keep a tab's name in place when an inline rename starts gpui-component's Input keeps 12px of inner padding even with appearance(false), so the name jumped sideways as the rail row, the group header and the top-strip chip swapped their label for the field. Claude-Session: https://claude.ai/code/session_01Q9vsQSxAZjkwT7nRAiFF1J --- src/ui/tab_sidebar.rs | 10 ++++++++-- src/ui/tab_strip.rs | 5 ++++- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/src/ui/tab_sidebar.rs b/src/ui/tab_sidebar.rs index fb6bf358..70846272 100644 --- a/src/ui/tab_sidebar.rs +++ b/src/ui/tab_sidebar.rs @@ -742,7 +742,10 @@ impl Tty7App { // and switch away from the name being typed, taking // the focus with it. .on_click(|_, _, cx| cx.stop_propagation()) - .child(Input::new(&input).appearance(false)) + // No inset of its own: the label it replaces starts + // flush, and the field's 12px padding jumped the name + // sideways the moment rename began. + .child(Input::new(&input).appearance(false).px_0()) .into_any_element(), None => v_flex() .id(("sidebar-label", i)) @@ -1205,7 +1208,10 @@ impl Tty7App { // with it. .on_mouse_down(MouseButton::Left, |_, _, cx| cx.stop_propagation()) .on_click(|_, _, cx| cx.stop_propagation()) - .child(Input::new(&input).appearance(false)) + // No inset of its own: the label it replaces starts + // flush, and the field's 12px padding jumped the name + // sideways the moment rename began. + .child(Input::new(&input).appearance(false).px_0()) .into_any_element(), // Elided above, so the truncation here is only the // backstop for a face that measures wider than it diff --git a/src/ui/tab_strip.rs b/src/ui/tab_strip.rs index 5723ed83..364b244f 100644 --- a/src/ui/tab_strip.rs +++ b/src/ui/tab_strip.rs @@ -2153,7 +2153,10 @@ impl Tty7App { // the field would reach the chip behind it and switch away // from the name being typed, taking the focus with it. .on_click(|_, _, cx| cx.stop_propagation()) - .child(Input::new(&input).appearance(false)) + // No inset of its own: the label it replaces starts + // flush, and the field's 12px padding jumped the name + // sideways the moment rename began. + .child(Input::new(&input).appearance(false).px_0()) .into_any_element(), None => div() .id(("tab-label", i))