diff options
| author | 1STEP621 <86859447+1STEP621@users.noreply.github.com> | 2023-12-12 12:19:49 +0900 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-12-12 12:19:49 +0900 |
| commit | 7f85d7a1f9b05e1d918dff189ccdfbfa219f2008 (patch) | |
| tree | 3628fd61e214a62a56bbabdc9b7527fa029c21d0 | |
| parent | fix type (diff) | |
| download | sharkey-7f85d7a1f9b05e1d918dff189ccdfbfa219f2008.tar.gz sharkey-7f85d7a1f9b05e1d918dff189ccdfbfa219f2008.tar.bz2 sharkey-7f85d7a1f9b05e1d918dff189ccdfbfa219f2008.zip | |
Enhance(frontend): リスト/アンテナ/チャンネルをタイムラインから新規作成できるように (#12629)
* 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 <Syuilotan@yahoo.co.jp>
| -rw-r--r-- | CHANGELOG.md | 1 | ||||
| -rw-r--r-- | 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<void> { 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<void> { 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<void> { 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); } |