refactor(w7): place Recent Rooms left of the Connect card
Lay the home screen out as three side-by-side cards — Recents | Connect | Friends — instead of stacking Recents under Connect. Three 380-460px cards need ~1280px to fit in a row, so the responsive threshold rises to 1280px; below that they stack in a column (Connect first). Screenshot-verified at 1920px: Recents left, Connect center, Friends right, top-aligned. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
+7
-10
@@ -2303,22 +2303,19 @@ fn view(state: &AppState) -> Element<'_, AppMessage> {
|
||||
// fixed-width Connect card would otherwise squeeze it until its node-ID
|
||||
// field and remove button clip away. `responsive` measures the available
|
||||
// width each layout pass and picks the orientation accordingly.
|
||||
// The Recent-rooms card lives in the LEFT column under the Connect card
|
||||
// (both are about getting into a room), so it has its own card and a
|
||||
// growing history can't reflow the Create/Join controls. Friends stays on
|
||||
// the right. Always shown (empty-state hint when no history) for parity
|
||||
// with the Friends card and so the feature is discoverable.
|
||||
// Three cards: Recents | Connect | Friends, side-by-side when there's room.
|
||||
// Three 380–460px cards need ~1280px to fit in a row, so below that the
|
||||
// `responsive` measure stacks them in a column (Connect first — the primary
|
||||
// action) rather than letting the row clip. Recents always shows (empty-
|
||||
// state hint when no history) for parity with the Friends card.
|
||||
let body = responsive(move |size| {
|
||||
let cards: Element<AppMessage> = if size.width < 900.0 {
|
||||
let cards: Element<AppMessage> = if size.width < 1280.0 {
|
||||
column![connect_card(state), recents_card(state), friends_panel(state)]
|
||||
.spacing(20)
|
||||
.align_x(iced::alignment::Horizontal::Center)
|
||||
.into()
|
||||
} else {
|
||||
let left = column![connect_card(state), recents_card(state)]
|
||||
.spacing(20)
|
||||
.align_x(iced::alignment::Horizontal::Center);
|
||||
row![left, friends_panel(state)]
|
||||
row![recents_card(state), connect_card(state), friends_panel(state)]
|
||||
.spacing(20)
|
||||
.align_y(iced::alignment::Vertical::Top)
|
||||
.into()
|
||||
|
||||
Reference in New Issue
Block a user