From 34ba3774a6fe6427c0c335e5ca7ef89f140f241e Mon Sep 17 00:00:00 2001 From: tajniak81 <13187254+tajniak81@users.noreply.github.com> Date: Tue, 17 Nov 2026 13:38:24 +0100 Subject: [PATCH] Fit the page header on phones At 375 px the header's buttons ran past the screen and the page scrolled sideways. Below the sm breakpoint, favourite, attach, history and info now sit at the top of the More menu instead; comments, share and the menu stay in the header. Co-Authored-By: Claude Opus 5.5 --- Web-App/frontend/src/views/page/PageView.vue | 33 +++++++++++++++++++- 1 file changed, 32 insertions(+), 1 deletion(-) diff --git a/Web-App/frontend/src/views/page/PageView.vue b/Web-App/frontend/src/views/page/PageView.vue index 133771e..eca9a06 100644 --- a/Web-App/frontend/src/views/page/PageView.vue +++ b/Web-App/frontend/src/views/page/PageView.vue @@ -584,7 +584,35 @@ const suggestAs = computed(() => suggesting.value && editable.value && auth.user ? { id: auth.user.id, name: me.value.name } : null, ); +// On phones the header has room for the main buttons only; favourite, +// attach, history and info move to the top of the More menu (below sm, +// where those buttons are hidden with max-sm:hidden). +const phoneQuery = typeof window !== "undefined" ? window.matchMedia("(width < 40rem)") : null; +const phone = ref(phoneQuery?.matches ?? false); +const onPhoneChange = (e: MediaQueryListEvent) => (phone.value = e.matches); +phoneQuery?.addEventListener("change", onPhoneChange); +onBeforeUnmount(() => phoneQuery?.removeEventListener("change", onPhoneChange)); +const phoneItems = computed(() => { + if (!phone.value || !page.value) return []; + const items: MenuItem[] = [ + { + label: t(page.value.favorite ? "page.unfavorite" : "page.favorite"), + icon: "star", + onSelect: () => void toggleFavorite(), + }, + ]; + if (editable.value && main.value && mode.value === "page") { + items.push({ label: t("page.attach"), icon: "paperclip", onSelect: () => filePicker.value?.click() }); + } + items.push( + { label: t("page.history.title"), icon: "restore", onSelect: () => (historyOpen.value = !historyOpen.value) }, + { label: t("properties.info"), icon: "info", onSelect: () => (infoOpen.value = !infoOpen.value) }, + ); + return items; +}); + const menu = computed(() => [ + ...phoneItems.value, ...(mode.value === "page" ? [{ label: t("page.find"), icon: "search" as const, onSelect: () => editorRef.value?.openFind() }] : []), @@ -760,7 +788,7 @@ const purge = () =>