From 76735f0552fd5a7888f505955997779da5b5045b Mon Sep 17 00:00:00 2001 From: Adam French Date: Thu, 1 Oct 2026 15:15:10 +0100 Subject: [PATCH] Improve /stp layout on small screens - Listening and Steam: fit the artwork to the cell instead of scrolling. The image is now a flexible item that takes the height left over after the text, so a wide/short cell or a wrapped title can no longer overflow. - Below 1360px the two sidebars collapse into one tabbed panel (Chat, Bookmarks, Commits, Steam) under the sheet instead of a long stack of individually scrolling boxes. CSS-only: widgets stay mounted once. - Phone: clamp song/artist to one line and give the grid a minimum height so album art stays visible on short screens. Co-Authored-By: Claude Opus 5.5 --- vue/src/views/home/Home.vue | 117 ++++++++++++++++++++++++++----- vue/src/views/home/Listening.vue | 39 +++++++++-- vue/src/views/home/Steam.vue | 26 ++++--- 3 files changed, 148 insertions(+), 34 deletions(-) diff --git a/vue/src/views/home/Home.vue b/vue/src/views/home/Home.vue index 3e129d4..a84e18a 100644 --- a/vue/src/views/home/Home.vue +++ b/vue/src/views/home/Home.vue @@ -7,6 +7,13 @@ * class and the three breakpoints below (desktop / <=1360px tablet / <=700px * phone) re-draw the whole area map rather than moving elements around. * + * Below 1360px there is no room for the sidebars, so their widgets collapse + * into a single tabbed panel under the sheet. That is done purely in CSS — the + * tab bar only sets `data-tab` on the wrapper and the media query hides the + * other widgets — so every widget stays mounted exactly once at every width + * (Chat holds a WebSocket, Steam a rotation timer) and resizing across the + * breakpoint loses no state. + * * The widgets do not fetch individually — they all read stores/homeData.js, which * issues one GraphQL query for the whole page. * @@ -30,11 +37,36 @@ import Gym2 from "./Gym2.vue"; import Consumption from "./Consumption.vue"; import Steam from "./Steam.vue"; import Bookmarks from "./Bookmarks.vue"; + +import { ref } from "vue"; + +// Small-screen tab bar. `id` matches the [data-tab] selectors in the tablet +// media query below. +const TABS = [ + { id: "chat", label: "Chat" }, + { id: "bookmarks", label: "Bookmarks" }, + { id: "commits", label: "Commits" }, + { id: "steam", label: "Steam" }, +]; +const activeTab = ref("chat");