Skip to content

ReleaseNotesComponentConstructorParams

Parameters for the ReleaseNotesComponent constructor.

Import:

import type { ReleaseNotesComponentConstructorParams } from 'obsidian-dev-utils/obsidian/components/release-notes-component';

Signature:

export interface ReleaseNotesComponentConstructorParams

Properties

PropertyTypeDescription
appAppThe Obsidian app instance.
getShownReleaseNoteVersions() => readonly string[]Returns the versions whose notes the user has already seen.

Storage belongs to the host plugin, typically as one of its settings, because this component has no data.json of its own and the list has to outlive a reload.

Only ever called once pluginSettingsComponent reports its settings loaded, so an implementation that reads a setting reads the stored value rather than its default.
pluginNamestringThe display name of the plugin, shown in the popup title.
pluginSettingsComponentPluginSettingsComponentBase<object>The settings component holding whatever getShownReleaseNoteVersions reads.

Taken as a whole component rather than as a bare "ready" flag, so the host cannot forget to wire the wait.
releaseNotesProvider() => ReleaseNotesBuilds the release notes.

Called at layout ready rather than at construction, so the fragments are built only when they may be shown, and a localized string is read after the host's translations are set up.

Every key must be a valid semantic version. The notes are shown in ascending version order, whatever order the keys were written in.
setShownReleaseNoteVersions(versions: readonly string[]) => Promisable<void>Records the versions whose notes the user has now seen.

Called before the popup is shown, with the full list: the versions already shown followed by the ones about to be.
shouldShowReleaseNotes?() => Promisable<boolean>Decides whether the release notes may be shown now.

When it returns false, nothing is shown and nothing is recorded, so the notes are shown at a later start once it returns true. Use it when the notes only make sense while some feature is on.