From 60ec877d3cf81b7fe2326edfea414e7fc427ddf8 Mon Sep 17 00:00:00 2001 From: Hazel K Date: Fri, 4 Oct 2024 12:22:09 -0400 Subject: [PATCH 1/5] on user profiles, move pinned notes down with the other notes --- locales/en-US.yml | 1 + locales/index.d.ts | 4 ++++ locales/ja-JP.yml | 1 + packages/frontend/src/pages/user/home.vue | 24 +++++++++++++++++------ 4 files changed, 24 insertions(+), 6 deletions(-) diff --git a/locales/en-US.yml b/locales/en-US.yml index 8163ca525b..22a3e5ef13 100644 --- a/locales/en-US.yml +++ b/locales/en-US.yml @@ -126,6 +126,7 @@ inChannelQuote: "Channel-only Quote" renoteToChannel: "Renote to channel" renoteToOtherChannel: "Renote to other channel" pinnedNote: "Pinned note" +pinnedOnly: "Pinned" pinned: "Pin to profile" you: "You" clickToShow: "Click to show" diff --git a/locales/index.d.ts b/locales/index.d.ts index fcd64071af..d247be7091 100644 --- a/locales/index.d.ts +++ b/locales/index.d.ts @@ -520,6 +520,10 @@ export interface Locale extends ILocale { * ピン留めされたノート */ "pinnedNote": string; + /** + * Pinned + */ + "pinnedOnly": string; /** * ピン留め */ diff --git a/locales/ja-JP.yml b/locales/ja-JP.yml index 7e39515c5c..2fc021011e 100644 --- a/locales/ja-JP.yml +++ b/locales/ja-JP.yml @@ -126,6 +126,7 @@ inChannelQuote: "チャンネル内引用" renoteToChannel: "チャンネルにリノート" renoteToOtherChannel: "他のチャンネルにリノート" pinnedNote: "ピン留めされたノート" +pinnedOnly: "Pinned" pinned: "ピン留め" you: "あなた" clickToShow: "クリックして表示" diff --git a/packages/frontend/src/pages/user/home.vue b/packages/frontend/src/pages/user/home.vue index e82ec0cb97..4716c980c9 100644 --- a/packages/frontend/src/pages/user/home.vue +++ b/packages/frontend/src/pages/user/home.vue @@ -125,10 +125,7 @@ SPDX-License-Identifier: AGPL-3.0-only
-
- -
- {{ i18n.ts.userPagePinTip }} + {{ i18n.ts.userPagePinTip }}
-
+
{{ i18n.ts.noNotes }}
- +
@@ -204,8 +204,8 @@ import { misskeyApi } from '@/scripts/misskey-api.js'; import { isFollowingVisibleForMe, isFollowersVisibleForMe } from '@/scripts/isFfVisibleForMe.js'; import { useRouter } from '@/router/supplier.js'; import { getStaticImageUrl } from '@/scripts/media-proxy.js'; -import { infoImageUrl } from "@/instance.js"; -import MkDateSeparatedList from "@/components/MkDateSeparatedList.vue"; +import { infoImageUrl } from '@/instance.js'; +import MkDateSeparatedList from '@/components/MkDateSeparatedList.vue'; const MkNote = defineAsyncComponent(() => (defaultStore.state.noteDesign === 'misskey') ? import('@/components/MkNote.vue') : @@ -255,6 +255,9 @@ const moderationNote = ref(props.user.moderationNote); const editModerationNote = ref(false); const noteview = ref(null); +// Sort pinned notes by date to match the other columns and ensure that MkDateSeparatedList does not break. +const pinnedNotes = computed(() => Array.from(user.value.pinnedNotes).sort((a, b) => b.id.localeCompare(a.id))); + const listenbrainzdata = ref(false); if (props.user.listenbrainz) { (async function() { From 5f435f7250edd4047a11fb504ac5b320e3503050 Mon Sep 17 00:00:00 2001 From: Hazel K Date: Mon, 7 Oct 2024 16:26:30 -0400 Subject: [PATCH 5/5] restore sorting of pinned notes --- packages/frontend/src/pages/user/home.vue | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/packages/frontend/src/pages/user/home.vue b/packages/frontend/src/pages/user/home.vue index bb3a47813b..2ec47889d6 100644 --- a/packages/frontend/src/pages/user/home.vue +++ b/packages/frontend/src/pages/user/home.vue @@ -156,13 +156,13 @@ SPDX-License-Identifier: AGPL-3.0-only
-
+
{{ i18n.ts.noNotes }}
- - - +
+ +
@@ -205,7 +205,6 @@ import { isFollowingVisibleForMe, isFollowersVisibleForMe } from '@/scripts/isFf import { useRouter } from '@/router/supplier.js'; import { getStaticImageUrl } from '@/scripts/media-proxy.js'; import { infoImageUrl } from '@/instance.js'; -import MkDateSeparatedList from '@/components/MkDateSeparatedList.vue'; const MkNote = defineAsyncComponent(() => (defaultStore.state.noteDesign === 'misskey') ? import('@/components/MkNote.vue') : @@ -255,9 +254,6 @@ const moderationNote = ref(props.user.moderationNote); const editModerationNote = ref(false); const noteview = ref(null); -// Sort pinned notes by date to match the other columns and ensure that MkDateSeparatedList does not break. -const pinnedNotes = computed(() => Array.from(user.value.pinnedNotes).sort((a, b) => b.id.localeCompare(a.id))); - const listenbrainzdata = ref(false); if (props.user.listenbrainz) { (async function() { @@ -827,4 +823,8 @@ onUnmounted(() => { margin-left: 4px; color: var(--success); } + +.pinnedNote:not(:last-child) { + border-bottom: solid 0.5px var(--divider); +}