fix timeline dropdowns

This commit is contained in:
bunnybeam 2025-12-09 20:45:19 +00:00
parent 8c196d5cb2
commit e37d726a94
No known key found for this signature in database
3 changed files with 42 additions and 3 deletions

10
locales/index.d.ts vendored
View file

@ -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;

View file

@ -140,14 +140,28 @@ async function chooseList(ev: MouseEvent): Promise<void> {
(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<void> {
const antennas = await antennasCache.fetch();
const items: MenuItem[] = [
@ -158,11 +172,17 @@ async function chooseAntenna(ev: MouseEvent): Promise<void> {
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<void> {
};
}),
(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);

View file

@ -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"