Skip to content

PluginNoticeMode

How a new notice relates to the plugin’s current notice — the one occupying the single per-plugin slot this component keeps.

Raw new Notice(...) calls always pile up, which is rarely what a plugin wants: usually only the latest message matters. So the slot exists, and this chooses what a new message does with it.

Import:

import type { PluginNoticeMode } from 'obsidian-dev-utils/obsidian/components/plugin-notice-component';

Signature:

export enum PluginNoticeMode

Members:

MemberValueDescription
Append'append'Adds the message to the current notice, so both messages stay visible in a single notice — for a running account of an operation. The countdown restarts, so an appended message is readable for a full duration rather than inheriting the remains of the current one. Falls back to PluginNoticeMode.Replace when there is no current notice on screen (it was never shown, or it has since been dismissed).
Replace'replace'Hides the current notice and shows this one in its place, so only the latest message is on screen. This is the default, and the reason the slot exists.
Separate'separate'Shows the message as its own notice, leaving the current one alone: both are on screen, piled up like plain new Notice(...) calls. A separate notice never replaces, and is never replaced by, a slot notice; any number of them coexist. They are still hidden together on unload.

Links to this page: