From c5df7a31f0069a9bcb84077a8755ee308ae40045 Mon Sep 17 00:00:00 2001 From: Mollusk Date: Mon, 15 Jun 2026 05:08:25 -0400 Subject: [PATCH] fix(ui): compact, left-aligned friends rows Per design feedback: put Remove directly to the right of the name box (was separated by the id column), and shrink the oversized add-friend inputs to fixed half-widths (node id 340px, name 170px) instead of stretching across the panel. A trailing horizontal_space absorbs the rest so rows are left-aligned and nothing reaches the scrollbar edge. Co-Authored-By: Claude Opus 4.8 --- src/app/mod.rs | 20 +++++++++----------- 1 file changed, 9 insertions(+), 11 deletions(-) diff --git a/src/app/mod.rs b/src/app/mod.rs index 805c123..1931ec4 100644 --- a/src/app/mod.rs +++ b/src/app/mod.rs @@ -1632,18 +1632,15 @@ fn view(state: &AppState) -> Element<'_, AppMessage> { .on_input(move |v| AppMessage::RenameFriend(fid, v)) .style(t_style) .padding(6) - .width(iced::Length::FillPortion(2)), - text(id_short) - .size(11) - .color(color_subtext) - .width(iced::Length::FillPortion(2)), + .width(iced::Length::Fixed(240.0)), button(text("Remove").size(12)) .on_press(AppMessage::RemoveFriend(fid)) .style(b_style(color_surface, color_maroon, color_text, 6.0)) .padding(6), - // Reserve clearance so the button doesn't sit under the - // scrollbar gutter at the right edge. - horizontal_space().width(iced::Length::Fixed(12.0)), + text(id_short).size(11).color(color_subtext), + // Absorb the remaining width so the row is left-aligned and + // nothing stretches to / under the scrollbar edge. + horizontal_space(), ] .spacing(8) .align_y(iced::alignment::Vertical::Center), @@ -1665,17 +1662,18 @@ fn view(state: &AppState) -> Element<'_, AppMessage> { .on_input(AppMessage::FriendAddIdChanged) .style(t_style) .padding(6) - .width(iced::Length::FillPortion(3)), + .width(iced::Length::Fixed(340.0)), text_input("Name (optional)", &state.friend_add_name) .on_input(AppMessage::FriendAddNameChanged) .style(t_style) .padding(6) - .width(iced::Length::FillPortion(2)), + .width(iced::Length::Fixed(170.0)), button(text("Add").size(13)) .on_press(AppMessage::AddFriend) .style(b_style(color_surface, color_blue, color_text, 6.0)) .padding(8), - horizontal_space().width(iced::Length::Fixed(12.0)), + // Left-align the compact inputs; absorb the rest of the row. + horizontal_space(), ] .spacing(8) .align_y(iced::alignment::Vertical::Center),