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>
This commit is contained in:
parent
564a23c0b5
commit
7f85d7a1f9
2 changed files with 46 additions and 17 deletions
|
@ -35,6 +35,7 @@
|
|||
- Enhance: ノートプレビューに「内容を隠す」が反映されるように
|
||||
- Enhance: データセーバーの適用範囲を個別で設定できるように
|
||||
- 従来のデータセーバーの設定はリセットされます
|
||||
- Enhance: タイムライン上のタブからリスト、アンテナ、チャンネルの管理ページにジャンプできるように
|
||||
- Feat: センシティブと判断されたウェブサイトのサムネイルをぼかすように
|
||||
- ウェブサイトをセンシティブと判断する仕組みが動いていないため、summalyProxyを使用しないと機能しません。
|
||||
- fix: 「設定のバックアップ」で一部の項目がバックアップに含まれていなかった問題を修正
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue