mirror of
https://github.com/l0ng-ai/tty7.git
synced 2026-11-06 00:15:06 +00:00
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:
@@ -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
@@ -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))
|
||||
|
||||
Reference in New Issue
Block a user