From 7d9125731730fccae3a608d48c286e595980e011 Mon Sep 17 00:00:00 2001
From: ThatOneCalculator <kainoa@t1c.dev>
Date: Sat, 23 Jul 2022 21:30:42 -0700
Subject: [PATCH] Less cluttered notifications

---
 CALCKEY.md                                    |  2 +-
 packages/backend/src/misc/get-note-summary.ts |  2 +
 packages/client/src/ui/classic.sidebar.vue    | 56 ++++++++++++++++++-
 .../sw/src/scripts/create-notification.ts     |  2 +-
 4 files changed, 59 insertions(+), 3 deletions(-)

diff --git a/CALCKEY.md b/CALCKEY.md
index 843dbffff..333027918 100644
--- a/CALCKEY.md
+++ b/CALCKEY.md
@@ -11,7 +11,6 @@
 - Fully revamp non-logged-in screen
 - Personal notes for all accounts
 - Admin custom CSS
-- Improve notifications (content is too verbose)
 - Non-nyaify cat mode
 - Timeline filters
 - "Bubble" timeline
@@ -25,6 +24,7 @@
 - Rosé Pine by default (+ non-themable elements made Rosé Pine)
 - Better sidebar/navbar
 - Mark as read from notifications widget
+- Less cluttered notification summary
 - Better welcome screen (not logged in)
 - Ability to turn off "Connection lost" message
 - Spinner instead of "Loading..."
diff --git a/packages/backend/src/misc/get-note-summary.ts b/packages/backend/src/misc/get-note-summary.ts
index 3f35ccee8..ddcfade42 100644
--- a/packages/backend/src/misc/get-note-summary.ts
+++ b/packages/backend/src/misc/get-note-summary.ts
@@ -32,6 +32,7 @@ export const getNoteSummary = (note: Packed<'Note'>): string => {
 		summary += ` (📊)`;
 	}
 
+	/*
 	// 返信のとき
 	if (note.replyId) {
 		if (note.reply) {
@@ -49,6 +50,7 @@ export const getNoteSummary = (note: Packed<'Note'>): string => {
 			summary += '\n\nRN: ...';
 		}
 	}
+	*/
 
 	return summary.trim();
 };
diff --git a/packages/client/src/ui/classic.sidebar.vue b/packages/client/src/ui/classic.sidebar.vue
index 172401f42..e688c74f4 100644
--- a/packages/client/src/ui/classic.sidebar.vue
+++ b/packages/client/src/ui/classic.sidebar.vue
@@ -32,7 +32,7 @@
 	</MkA>
 	<div class="divider"></div>
 	<div class="about">
-		<MkA v-click-anime class="link" to="/about">
+		<MkA v-click-anime class="link" @click="openInstanceMenu">
 			<img :src="$instance.iconUrl || $instance.faviconUrl || '/favicon.ico'" class="_ghost"/>
 		</MkA>
 	</div>
@@ -133,6 +133,60 @@ export default defineComponent({
 		},
 	},
 });
+
+function openInstanceMenu(ev: MouseEvent) {
+	os.popupMenu([{
+		text: instance.name ?? host,
+		type: 'label',
+	}, {
+		type: 'link',
+		text: i18n.ts.instanceInfo,
+		icon: 'fas fa-info-circle',
+		to: '/about',
+	}, {
+		type: 'link',
+		text: i18n.ts.customEmojis,
+		icon: 'fas fa-laugh',
+		to: '/about#emojis',
+	}, {
+		type: 'link',
+		text: i18n.ts.federation,
+		icon: 'fas fa-globe',
+		to: '/about#federation',
+	}, null, {
+		type: 'parent',
+		text: i18n.ts.help,
+		icon: 'fas fa-question-circle',
+		children: [{
+			type: 'link',
+			to: '/mfm-cheat-sheet',
+			text: i18n.ts._mfm.cheatSheet,
+			icon: 'fas fa-code',
+		}, {
+			type: 'link',
+			to: '/scratchpad',
+			text: i18n.ts.scratchpad,
+			icon: 'fas fa-terminal',
+		}, {
+			type: 'link',
+			to: '/api-console',
+			text: 'API Console',
+			icon: 'fas fa-terminal',
+		}, null, {
+			text: i18n.ts.document,
+			icon: 'fas fa-question-circle',
+			action: () => {
+				window.open('https://misskey-hub.net/help.html', '_blank');
+			},
+		}],
+	}, {
+		type: 'link',
+		text: i18n.ts.aboutMisskey,
+		to: '/about-misskey',
+	}], ev.currentTarget ?? ev.target, {
+		align: 'left',
+	});
+}
 </script>
 
 <style lang="scss" scoped>
diff --git a/packages/sw/src/scripts/create-notification.ts b/packages/sw/src/scripts/create-notification.ts
index 7c95e8e41..619a5e6b4 100644
--- a/packages/sw/src/scripts/create-notification.ts
+++ b/packages/sw/src/scripts/create-notification.ts
@@ -263,7 +263,7 @@ export async function createEmptyNotification() {
 		if (!swLang.i18n) swLang.fetchLocale();
 		const i18n = await swLang.i18n as I18n<any>;
 		const { t } = i18n;
-	
+
 		await self.registration.showNotification(
 			t('_notification.emptyPushNotificationMessage'),
 			{