Let plugins register a navigation entry

A plugin that adds a screen has no way to offer a way into it. The
folder list toolbar holds Compose and Contacts, and nothing else can be
added to it, so plugins reach into the UI themselves: polling for an
existing button, replacing its icon and hanging a menu off it. That is
fragile, it varies per plugin, and it puts screens somewhere users do
not look for them.

rl.addNavEntry({icon, title, hash}) appends an entry to that toolbar,
rendered with the same .btn classes so it follows the active theme.
click may be given instead of hash for a popup rather than a route.

Three lines of template, one observableArray, one function, and no
change to existing behaviour when no plugin registers anything.
This commit is contained in:
Fathi Ben Nasr 2026-08-14 11:04:25 +00:00
parent c154d23cfe
commit 548e2fdc11
3 changed files with 35 additions and 0 deletions

View file

@ -7,6 +7,7 @@ import { mailBox, settings } from 'Common/Links';
import { addComputablesTo } from 'External/ko';
import { AppUserStore } from 'Stores/User/App';
import { pluginNavEntries } from 'Common/Plugins';
import { SettingsUserStore } from 'Stores/User/Settings';
import { FolderUserStore } from 'Stores/User/Folder';
import { MessageUserStore } from 'Stores/User/Message';
@ -36,6 +37,7 @@ export class MailFolderList extends AbstractViewLeft {
this.moveAction = moveAction;
this.allowContacts = AppUserStore.allowContacts();
this.pluginNavEntries = pluginNavEntries;
this.foldersFilter = foldersFilter;