From e37d726a9433315a691171a59b5ad1f1e493e536 Mon Sep 17 00:00:00 2001 From: bunnybeam Date: Tue, 9 Dec 2025 20:45:19 +0000 Subject: [PATCH] fix timeline dropdowns --- locales/index.d.ts | 10 ++++++++ packages/frontend/src/pages/timeline.vue | 32 +++++++++++++++++++++--- sharkey-locales/en-US.yml | 3 +++ 3 files changed, 42 insertions(+), 3 deletions(-) diff --git a/locales/index.d.ts b/locales/index.d.ts index 9f5a238cc9..f5be688736 100644 --- a/locales/index.d.ts +++ b/locales/index.d.ts @@ -13673,6 +13673,16 @@ export interface Locale extends ILocale { * Background queue */ "backgroundQueue": string; + "_header": { + /** + * Browse + */ + "browse": string; + /** + * Manage + */ + "manage": string; + }; } declare const locales: { [lang: string]: Locale; diff --git a/packages/frontend/src/pages/timeline.vue b/packages/frontend/src/pages/timeline.vue index 7bb34b3bd5..fead322ce5 100644 --- a/packages/frontend/src/pages/timeline.vue +++ b/packages/frontend/src/pages/timeline.vue @@ -140,14 +140,28 @@ async function chooseList(ev: MouseEvent): Promise { (lists.length === 0 ? undefined : { type: 'divider' }), { type: 'link' as const, + icon: 'ti ti-pencil', + text: i18n.ts._header.manage, + to: '/my/lists', + }, + { icon: 'ti ti-plus', text: i18n.ts.createNew, - to: '/my/lists', + action: createList, }, ]; os.popupMenu(items, ev.currentTarget ?? ev.target); } +async function createList() { + const { canceled, result: name } = await os.inputText({ + title: i18n.ts.enterListName, + }); + if (canceled) return; + await os.apiWithDialog('users/lists/create', { name: name }); + userListsCache.delete(); +} + async function chooseAntenna(ev: MouseEvent): Promise { const antennas = await antennasCache.fetch(); const items: MenuItem[] = [ @@ -158,11 +172,17 @@ async function chooseAntenna(ev: MouseEvent): Promise { to: `/timeline/antenna/${antenna.id}`, })), (antennas.length === 0 ? undefined : { type: 'divider' }), + { + type: 'link' as const, + icon: 'ti ti-pencil', + text: i18n.ts._header.manage, + to: '/my/antennas', + }, { type: 'link' as const, icon: 'ti ti-plus', text: i18n.ts.createNew, - to: '/my/antennas', + to: '/my/antennas/create', }, ]; os.popupMenu(items, ev.currentTarget ?? ev.target); @@ -183,11 +203,17 @@ async function chooseChannel(ev: MouseEvent): Promise { }; }), (channels.length === 0 ? undefined : { type: 'divider' }), + { + type: 'link', + icon: 'ti ti-search', + text: i18n.ts._header.browse, + to: '/channels', + }, { type: 'link', icon: 'ti ti-plus', text: i18n.ts.createNew, - to: '/channels', + to: '/channels/new', }, ]; os.popupMenu(items, ev.currentTarget ?? ev.target); diff --git a/sharkey-locales/en-US.yml b/sharkey-locales/en-US.yml index 767d5773b7..2326f3660b 100644 --- a/sharkey-locales/en-US.yml +++ b/sharkey-locales/en-US.yml @@ -733,3 +733,6 @@ restartMigrationDescription: "Account migration was last attempted {date}. If th restartMigrationConfirm: "Are you sure you want to restart this account migration?" backgroundQueue: "Background queue" +_header: + browse: "Browse" + manage: "Manage"