Add ctx.ui.setFooter() for extensions to replace footer component
Extensions can now replace the built-in footer with a custom component: - setFooter(factory) replaces with custom component - setFooter(undefined) restores built-in footer Includes example extension demonstrating context usage display. Closes #481
This commit is contained in:
@@ -88,6 +88,7 @@ function createNoOpUIContext(): ExtensionUIContext {
|
||||
notify: () => {},
|
||||
setStatus: () => {},
|
||||
setWidget: () => {},
|
||||
setFooter: () => {},
|
||||
setTitle: () => {},
|
||||
custom: async () => undefined as never,
|
||||
setEditorText: () => {},
|
||||
|
||||
@@ -63,6 +63,7 @@ const noOpUIContext: ExtensionUIContext = {
|
||||
notify: () => {},
|
||||
setStatus: () => {},
|
||||
setWidget: () => {},
|
||||
setFooter: () => {},
|
||||
setTitle: () => {},
|
||||
custom: async () => undefined as never,
|
||||
setEditorText: () => {},
|
||||
|
||||
@@ -65,6 +65,9 @@ export interface ExtensionUIContext {
|
||||
setWidget(key: string, content: string[] | undefined): void;
|
||||
setWidget(key: string, content: ((tui: TUI, theme: Theme) => Component & { dispose?(): void }) | undefined): void;
|
||||
|
||||
/** Set a custom footer component, or undefined to restore the built-in footer. */
|
||||
setFooter(factory: ((tui: TUI, theme: Theme) => Component & { dispose?(): void }) | undefined): void;
|
||||
|
||||
/** Set the terminal window/tab title. */
|
||||
setTitle(title: string): void;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user