From 7f85d7a1f9b05e1d918dff189ccdfbfa219f2008 Mon Sep 17 00:00:00 2001 From: 1STEP621 <86859447+1STEP621@users.noreply.github.com> Date: Tue, 12 Dec 2023 12:19:49 +0900 Subject: [PATCH] =?UTF-8?q?Enhance(frontend):=20=E3=83=AA=E3=82=B9?= =?UTF-8?q?=E3=83=88/=E3=82=A2=E3=83=B3=E3=83=86=E3=83=8A/=E3=83=81?= =?UTF-8?q?=E3=83=A3=E3=83=B3=E3=83=8D=E3=83=AB=E3=82=92=E3=82=BF=E3=82=A4?= =?UTF-8?q?=E3=83=A0=E3=83=A9=E3=82=A4=E3=83=B3=E3=81=8B=E3=82=89=E6=96=B0?= =?UTF-8?q?=E8=A6=8F=E4=BD=9C=E6=88=90=E3=81=A7=E3=81=8D=E3=82=8B=E3=82=88?= =?UTF-8?q?=E3=81=86=E3=81=AB=20(#12629)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * add short leads to lists, antennas, and channels * remove unused import * add CHANGELOG.md * hide separator when there is no item * fix mistakes * Update timeline.vue --------- Co-authored-by: syuilo --- CHANGELOG.md | 1 + packages/frontend/src/pages/timeline.vue | 62 +++++++++++++++++------- 2 files changed, 46 insertions(+), 17 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index c7ee4b0388..9b0ccfdb30 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -35,6 +35,7 @@ - Enhance: ノートプレビューに「内容を隠す」が反映されるように - Enhance: データセーバーの適用範囲を個別で設定できるように - 従来のデータセーバーの設定はリセットされます +- Enhance: タイムライン上のタブからリスト、アンテナ、チャンネルの管理ページにジャンプできるように - Feat: センシティブと判断されたウェブサイトのサムネイルをぼかすように - ウェブサイトをセンシティブと判断する仕組みが動いていないため、summalyProxyを使用しないと機能しません。 - fix: 「設定のバックアップ」で一部の項目がバックアップに含まれていなかった問題を修正 diff --git a/packages/frontend/src/pages/timeline.vue b/packages/frontend/src/pages/timeline.vue index 942061efe3..f3213ad273 100644 --- a/packages/frontend/src/pages/timeline.vue +++ b/packages/frontend/src/pages/timeline.vue @@ -48,6 +48,7 @@ import { definePageMetadata } from '@/scripts/page-metadata.js'; import { miLocalStorage } from '@/local-storage.js'; import { antennasCache, userListsCache } from '@/cache.js'; import { deviceKind } from '@/scripts/device-kind.js'; +import { MenuItem } from '@/types/menu.js'; provide('shouldOmitHeaderTitle', true); @@ -83,22 +84,40 @@ function top(): void { async function chooseList(ev: MouseEvent): Promise { const lists = await userListsCache.fetch(); - const items = lists.map(list => ({ - type: 'link' as const, - text: list.name, - to: `/timeline/list/${list.id}`, - })); + const items: MenuItem[] = [ + ...lists.map(list => ({ + type: 'link' as const, + text: list.name, + to: `/timeline/list/${list.id}`, + })), + (lists.length === 0 ? undefined : { type: 'divider' }), + { + type: 'link' as const, + icon: 'ti ti-plus', + text: i18n.ts.createNew, + to: '/my/lists', + }, + ]; os.popupMenu(items, ev.currentTarget ?? ev.target); } async function chooseAntenna(ev: MouseEvent): Promise { const antennas = await antennasCache.fetch(); - const items = antennas.map(antenna => ({ - type: 'link' as const, - text: antenna.name, - indicate: antenna.hasUnreadNote, - to: `/timeline/antenna/${antenna.id}`, - })); + const items: MenuItem[] = [ + ...antennas.map(antenna => ({ + type: 'link' as const, + text: antenna.name, + indicate: antenna.hasUnreadNote, + to: `/timeline/antenna/${antenna.id}`, + })), + (antennas.length === 0 ? undefined : { type: 'divider' }), + { + type: 'link' as const, + icon: 'ti ti-plus', + text: i18n.ts.createNew, + to: '/my/antennas', + }, + ]; os.popupMenu(items, ev.currentTarget ?? ev.target); } @@ -106,12 +125,21 @@ async function chooseChannel(ev: MouseEvent): Promise { const channels = await os.api('channels/my-favorites', { limit: 100, }); - const items = channels.map(channel => ({ - type: 'link' as const, - text: channel.name, - indicate: channel.hasUnreadNote, - to: `/channels/${channel.id}`, - })); + const items = [ + ...channels.map(channel => ({ + type: 'link' as const, + text: channel.name, + indicate: channel.hasUnreadNote, + to: `/channels/${channel.id}`, + })), + (channels.length === 0 ? undefined : null), + { + type: 'link' as const, + icon: 'ti ti-plus', + text: i18n.ts.createNew, + to: '/channels', + }, + ]; os.popupMenu(items, ev.currentTarget ?? ev.target); }