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
This commit is contained in:
l0ng-ai
2026-09-25 01:32:24 +08:00
parent 5ba12a9b02
commit faadc8528c
2 changed files with 12 additions and 3 deletions
+8 -2
View File
@@ -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
+4 -1
View File
@@ -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))