From 01704078331b6791efa6ad3cc303daf02453b818 Mon Sep 17 00:00:00 2001 From: Freeplay Date: Wed, 24 May 2023 13:22:53 -0400 Subject: [PATCH 1/6] Fix 'noteOf' text in post title --- packages/client/src/pages/note.vue | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/client/src/pages/note.vue b/packages/client/src/pages/note.vue index 5b408bdaf..8e710de47 100644 --- a/packages/client/src/pages/note.vue +++ b/packages/client/src/pages/note.vue @@ -162,12 +162,12 @@ definePageMetadata( computed(() => note ? { - title: i18n.t("noteOf", { user: note.user.name }), + title: i18n.t("noteOf", { user: note.user.name || note.user.username }), subtitle: new Date(note.createdAt).toLocaleString(), avatar: note.user, path: `/notes/${note.id}`, share: { - title: i18n.t("noteOf", { user: note.user.name }), + title: i18n.t("noteOf", { user: note.user.name || note.user.username }), text: note.text, }, } From 0fc9ddfe0c0005d3774cd03b31271a31d4a8b737 Mon Sep 17 00:00:00 2001 From: Freeplay Date: Wed, 24 May 2023 14:00:18 -0400 Subject: [PATCH 2/6] Add 'View on remote server' to right click menu --- packages/client/src/components/MkNote.vue | 17 ++++++++++++----- packages/client/src/components/MkNoteSub.vue | 19 +++++++++++++------ 2 files changed, 25 insertions(+), 11 deletions(-) diff --git a/packages/client/src/components/MkNote.vue b/packages/client/src/components/MkNote.vue index 7d7f0e71e..99c3fe018 100644 --- a/packages/client/src/components/MkNote.vue +++ b/packages/client/src/components/MkNote.vue @@ -401,20 +401,20 @@ function onContextmenu(ev: MouseEvent): void { os.pageWindow(notePage(appearNote)); }, }, - { + notePage(appearNote) != location.pathname ? { icon: "ph-arrows-out-simple ph-bold ph-lg", text: i18n.ts.showInPage, action: () => { router.push(notePage(appearNote), "forcePage"); }, - }, + } : undefined, null, { + type: "a", icon: "ph-arrow-square-out ph-bold ph-lg", text: i18n.ts.openInNewTab, - action: () => { - window.open(notePage(appearNote), "_blank"); - }, + href: notePage(appearNote), + target: "_blank", }, { icon: "ph-link-simple ph-bold ph-lg", @@ -423,6 +423,13 @@ function onContextmenu(ev: MouseEvent): void { copyToClipboard(`${url}${notePage(appearNote)}`); }, }, + note.user.host != null ? { + type: "a", + icon: "ph-arrow-square-up-right ph-bold ph-lg", + text: i18n.ts.showOnRemote, + href: note.url ?? note.uri ?? "", + target: "_blank", + } : undefined, ], ev ); diff --git a/packages/client/src/components/MkNoteSub.vue b/packages/client/src/components/MkNoteSub.vue index 77046dcba..72f6473e7 100644 --- a/packages/client/src/components/MkNoteSub.vue +++ b/packages/client/src/components/MkNoteSub.vue @@ -337,7 +337,7 @@ function onContextmenu(ev: MouseEvent): void { } else { os.contextMenu( [ - { + { type: "label", text: notePage(appearNote), }, @@ -348,20 +348,20 @@ function onContextmenu(ev: MouseEvent): void { os.pageWindow(notePage(appearNote)); }, }, - { + notePage(appearNote) != location.pathname ? { icon: "ph-arrows-out-simple ph-bold ph-lg", text: i18n.ts.showInPage, action: () => { router.push(notePage(appearNote), "forcePage"); }, - }, + } : undefined, null, { + type: "a", icon: "ph-arrow-square-out ph-bold ph-lg", text: i18n.ts.openInNewTab, - action: () => { - window.open(notePage(appearNote), "_blank"); - }, + href: notePage(appearNote), + target: "_blank", }, { icon: "ph-link-simple ph-bold ph-lg", @@ -370,6 +370,13 @@ function onContextmenu(ev: MouseEvent): void { copyToClipboard(`${url}${notePage(appearNote)}`); }, }, + note.user.host != null ? { + type: "a", + icon: "ph-arrow-square-up-right ph-bold ph-lg", + text: i18n.ts.showOnRemote, + href: note.url ?? note.uri ?? "", + target: "_blank", + } : undefined, ], ev ); From 8cd812db83199c40b6427cd68c2ce66ce66ed087 Mon Sep 17 00:00:00 2001 From: Freeplay Date: Wed, 24 May 2023 17:40:16 -0400 Subject: [PATCH 3/6] Display replies by same author first --- packages/client/src/components/MkNoteDetailed.vue | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/packages/client/src/components/MkNoteDetailed.vue b/packages/client/src/components/MkNoteDetailed.vue index 774a10fc6..b3d22d7ac 100644 --- a/packages/client/src/components/MkNoteDetailed.vue +++ b/packages/client/src/components/MkNoteDetailed.vue @@ -82,7 +82,7 @@ :key="note.id" :note="note" class="reply" - :conversation="directQuotes" + :conversation="replies" :detailedView="true" /> @@ -357,6 +357,12 @@ os.api("notes/children", { limit: 30, depth: 12, }).then((res) => { + res = res.reduce((acc, note) => { + if (note.userId == appearNote.userId) { + return [...acc, note]; + } + return [note, ...acc]; + }, []); replies.value = res; directReplies = res .filter((note) => note.replyId === appearNote.id) From 75cb5e18c6f6a487c0ec288c403bfca09f8a56f0 Mon Sep 17 00:00:00 2001 From: Freeplay Date: Wed, 24 May 2023 19:33:59 -0400 Subject: [PATCH 4/6] little refactor --- .../backend/src/server/web/views/base.pug | 2 +- packages/client/src/init.ts | 16 +------- packages/client/src/ui/universal.vue | 37 +++++++++---------- 3 files changed, 20 insertions(+), 35 deletions(-) diff --git a/packages/backend/src/server/web/views/base.pug b/packages/backend/src/server/web/views/base.pug index b5841883b..91f4d6606 100644 --- a/packages/backend/src/server/web/views/base.pug +++ b/packages/backend/src/server/web/views/base.pug @@ -31,7 +31,7 @@ html meta(name='theme-color-orig' content= themeColor || '#31748f') meta(property='twitter:card' content='summary') meta(property='og:site_name' content= instanceName || 'Calckey') - meta(name='viewport' content='width=device-width, initial-scale=1') + meta(name='viewport' content='width=device-width, initial-scale=1, minimum-scale=1, maximum-scale=1, user-scalable=no') link(rel='icon' href= icon || `/favicon.ico?${ timestamp }`) link(rel='apple-touch-icon' href= icon || `/apple-touch-icon.png?${ timestamp }`) link(rel='manifest' href='/manifest.json') diff --git a/packages/client/src/init.ts b/packages/client/src/init.ts index 43a92a316..7a004688d 100644 --- a/packages/client/src/init.ts +++ b/packages/client/src/init.ts @@ -104,17 +104,6 @@ import { getAccountFromId } from "@/scripts/get-account-from-id"; }); //#endregion - // If mobile, insert the viewport meta tag - if (["smartphone", "tablet"].includes(deviceKind)) { - const viewport = document.getElementsByName("viewport").item(0); - viewport.setAttribute( - "content", - `${viewport.getAttribute( - "content", - )}, minimum-scale=1, maximum-scale=1, user-scalable=no, viewport-fit=cover`, - ); - } - //#region Set lang attr const html = document.documentElement; html.setAttribute("lang", lang); @@ -311,12 +300,11 @@ import { getAccountFromId } from "@/scripts/get-account-from-id"; if (ColdDeviceStorage.get("syncDeviceDarkMode")) { defaultStore.set("darkMode", isDeviceDarkmode()); } - - window.matchMedia("(prefers-color-scheme: dark)").addListener((mql) => { + window.matchMedia("(prefers-color-scheme: dark)").onchange = (mql) => { if (ColdDeviceStorage.get("syncDeviceDarkMode")) { defaultStore.set("darkMode", mql.matches); } - }); + }; //#endregion fetchInstanceMetaPromise.then(() => { diff --git a/packages/client/src/ui/universal.vue b/packages/client/src/ui/universal.vue index 5b61c1b2c..3784ef8af 100644 --- a/packages/client/src/ui/universal.vue +++ b/packages/client/src/ui/universal.vue @@ -15,10 +15,7 @@ :style="{ background: pageMetadata?.value?.bg }" @contextmenu.stop="onContextmenu" > -
- -
-
+ @@ -173,6 +170,7 @@ import type { PageMetadata } from "@/scripts/page-metadata"; import { instanceName, ui } from "@/config"; import { StickySidebar } from "@/scripts/sticky-sidebar"; import XDrawerMenu from "@/ui/_common_/navbar-for-mobile.vue"; +import XSidebar from "@/ui/_common_/navbar.vue"; import * as os from "@/os"; import { defaultStore } from "@/store"; import { navbarItemDef } from "@/navbar"; @@ -186,7 +184,6 @@ import { import { deviceKind } from "@/scripts/device-kind"; const XWidgets = defineAsyncComponent(() => import("./universal.widgets.vue")); -const XSidebar = defineAsyncComponent(() => import("@/ui/_common_/navbar.vue")); const XStatusBars = defineAsyncComponent( () => import("@/ui/_common_/statusbars.vue") ); @@ -462,6 +459,11 @@ console.log(mainRouter.currentRoute.value.name); &.isMobile { --stickyBottom: 6rem; } + &:not(.isMobile) { + > .contents { + border-right: .5px solid var(--divider); + } + } &.wallpaper { background: var(--wallpaperOverlay); } @@ -470,6 +472,10 @@ console.log(mainRouter.currentRoute.value.name); justify-content: center; &:not(.isMobile) { --navBg: transparent; + > .contents { + border-inline: .5px solid var(--divider); + margin-inline: -1px; + } } > :deep(.sidebar:not(.iconOnly)) { @@ -545,18 +551,19 @@ console.log(mainRouter.currentRoute.value.name); } } - > .sidebar { - border-right: solid 0.5px var(--divider); - } - > .contents { width: 100%; min-width: 0; + $widgets-hide-threshold: 1090px; + @media (max-width: $widgets-hide-threshold) { + padding-bottom: calc(env(safe-area-inset-bottom, 0px) + 96px); + } } > .widgets { padding: 0 var(--margin); - border-left: solid 0.5px var(--divider); + width: 300px; + box-sizing: content-box; @media (max-width: $widgets-hide-threshold) { display: none; @@ -732,14 +739,4 @@ console.log(mainRouter.currentRoute.value.name); top: 0; left: 0; } - -.spacer { - $widgets-hide-threshold: 1090px; - - height: calc(env(safe-area-inset-bottom, 0px) + 96px); - - @media (min-width: ($widgets-hide-threshold + 1px)) { - display: none; - } -} From aa8affb2ad165d5dd508ef76bf57ee21b16c2525 Mon Sep 17 00:00:00 2001 From: Freeplay Date: Wed, 24 May 2023 21:33:49 -0400 Subject: [PATCH 5/6] a --- packages/client/src/components/MkNoteDetailed.vue | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/packages/client/src/components/MkNoteDetailed.vue b/packages/client/src/components/MkNoteDetailed.vue index b3d22d7ac..0e1780b95 100644 --- a/packages/client/src/components/MkNoteDetailed.vue +++ b/packages/client/src/components/MkNoteDetailed.vue @@ -625,10 +625,7 @@ onUnmounted(() => { opacity: 1; } } - - &.max-width_500px { - font-size: 0.9em; - } + &.max-width_450px { > .reply-to:first-child { padding-top: 14px; From 8a218caec9d7d0aba2c54c6ae088e9f9de0f5456 Mon Sep 17 00:00:00 2001 From: Freeplay Date: Wed, 24 May 2023 21:41:28 -0400 Subject: [PATCH 6/6] hide follow-button label on mobile --- packages/client/src/components/global/MkPageHeader.vue | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/packages/client/src/components/global/MkPageHeader.vue b/packages/client/src/components/global/MkPageHeader.vue index 484060795..67549a654 100644 --- a/packages/client/src/components/global/MkPageHeader.vue +++ b/packages/client/src/components/global/MkPageHeader.vue @@ -305,7 +305,10 @@ onUnmounted(() => { box-sizing: border-box; overflow: hidden; @media (max-width: 500px) { - padding-inline: 12p; + padding-inline: 16px; + &.tabs > .buttons > :deep(.follow-button > span) { + display: none; + } } @media (max-width: 700px) { > .left { @@ -432,8 +435,6 @@ onUnmounted(() => { text-align: left; font-weight: bold; flex-shrink: 0; - margin-right: 1rem; - > .avatar { $size: 32px; display: inline-block;