feat: add support for right-side composer sidebar and update related types

This commit is contained in:
Linus Rath
2026-04-25 19:45:45 +02:00
parent e683c90404
commit d657aec391
5 changed files with 16 additions and 2 deletions
+1
View File
@@ -48,6 +48,7 @@ function resetStore() {
'email-footer': [],
'composer-toolbar': [],
'composer-sidebar': [],
'composer-sidebar-right': [],
'sidebar-widget': [],
'email-detail-sidebar': [],
'settings-section': [],
+2 -1
View File
@@ -612,7 +612,8 @@ export function createPluginAPI(plugin: InstalledPlugin): PluginAPI {
registerComposerSidebar: (widget: SidebarWidget) => {
requirePermission(plugin, 'ui:composer-sidebar');
return registerSlot(plugin.id, 'composer-sidebar', widget.render as React.ComponentType<Record<string, unknown>>, widget.order ?? 100);
const slot = widget.side === 'right' ? 'composer-sidebar-right' : 'composer-sidebar';
return registerSlot(plugin.id, slot, widget.render as React.ComponentType<Record<string, unknown>>, widget.order ?? 100);
},
registerDetailSidebar: (widget: SidebarWidget) => {
+7
View File
@@ -110,6 +110,7 @@ export type SlotName =
| 'email-footer'
| 'composer-toolbar'
| 'composer-sidebar'
| 'composer-sidebar-right'
| 'sidebar-widget'
| 'email-detail-sidebar'
| 'settings-section'
@@ -159,6 +160,12 @@ export interface SidebarWidget {
label: string;
render: React.ComponentType;
order?: number;
/**
* For composer sidebars, choose which side of the New Message dialog the
* panel renders on. Defaults to `'left'` for backwards compatibility.
* Ignored by other sidebar slots.
*/
side?: 'left' | 'right';
}
export interface ContextMenuItem {