Skip to content

Status bar

Falcion edited this page Apr 22, 2025 · 2 revisions

Note

This block forked from official Obsidian's docs: https://help.obsidian.md/status-bar

The status bar shows small bits of information in the bottom right corner of the window. That includes helpful information about the current file, the current vault, or the current status like time and date.

statusbar-preview

Status items are added both by core plugins and community plugins. Some items are interactive but some are purely informational. The desktop version of the status bar pictured below features information about the backlinks present, the current editor view, and the current word and character count from the word count plugin.

Status bar of UNITADE

UNITADE provides it own status bar module with dynamic config support, essentialy, it updates every "instance-tick" of the Obsidian (every event). Status bar displays different data:

status-bar-display

Status bar with UNITADE can be divided in multiple "color-coded" categories:

  1. RED: worker category, display currently assigned processor (parser);
  2. YELLOW: display extensions, display views registered in current Vault;
  3. GREEN: display column and line of text cursor (caret) in instance of opened file;
  4. BLUE: what render (view) is assigned to current file;

Red category: worker

Worker logic can be assigned by two modes (renders) for file: either it is Obsidian's markdown-preprocessor on which entire pipeline is defined, or it is an instance of Monaco Editor of UNITADE.

  • if you open "Obsidian-like" instances for ItemView, status bar will display as worker - obsidian value;

If you open instance of UNITADE's codeview, it would display you assigned worker for current view and file from Monaco Editor. It will omit $model{X} like value, where $(X)$ is an index of model in given queue.

This naming occurs because the name of a model in the Monaco Editor is typically defined by its URI, which uniquely identifies it. But in case of UNITADE, we are not defining by URI or any LTS-elements, because UNITADE's instance of editor is offline-supportive, meaning it could work without Internet connection.

So, when you call monaco.editor.createModel(content, language) without a URI, Monaco assigns an auto-generated name in the format $modelX, where $X$ is an incrementing number. The $ prefix is used to indicate that this is an auto-generated (in-memory) model rather than a file with a real filesystem path.

const model = monaco.editor.createModel("console.log('Hello')", "javascript");
console.log(model.uri.toString()); // Outputs: "inmemory://model/0" (or similar)

Note

Internally, Monaco assigns a URI like inmemory://model/X to the model. The $modelX name is a simplified representation for display purposes.

This URI-indepent system is used, because UNITADE uses simple implementation where files aren’t tied to a filesystem on API of web-based editor (Obsidian's CodeMirror).

Yellow category: extensions and views

Yellow category is defined by two counters: counter for registered extensions and for registered views at the instance of opened Vault.

Extensions counter is an advanced counter, meaning you can configure what does it count:

  1. Count "vanilla" extensions: this setting starts to count "extensions-as-markdown" into the final sum. Keep in mind, if you enable "use default extensions"^2 option, these extensions wouldn't go into the final sum.
  2. Count grouped extensions: this setting starts to count UNIQUE grouped extensions, meaning extensions of markdown and codeview renders assigned by grouped extensions setting won't be counted into the final sum.
  3. Count code editor extensions: this setting starts to count extensions assigned by code editor, you enable "use default extensions"^2 option, these extensions would go under this setting.

As algorithmic representation of this logic:

const {
    extensions,
    grouped_extensions,
    code_editor_settings
} = this.settings;

const globalExtensionsByView = parsegroup(grouped_extensions);

if (!globalExtensionsByView['codeview'])
    globalExtensionsByView['codeview'] = [];
if (!globalExtensionsByView['markdown'])
    globalExtensionsByView['markdown'] = [];

if (code_editor_settings.enabled)
    globalExtensionsByView['codeview'] = globalExtensionsByView['codeview'].concat(code_editor_settings.use_default_extensions
        ? extensions.split('>')
        : code_editor_settings.extensions.split('>'));

globalExtensionsByView['markdown'] = globalExtensionsByView['markdown'].concat(extensions.split('>'));

if (this.settings.status_bar.registered_extensions.include_extensions)
    registered_extensions += globalExtensionsByView['markdown'].length;
if (this.settings.status_bar.registered_extensions.include_code_editor_extensions)
    registered_extensions += globalExtensionsByView['codeview'].length;
if (this.settings.status_bar.registered_extensions.include_extensions_grouped) {
    const views = Object.keys(globalExtensionsByView).filter(view => (view !== 'markdown' && view !== 'codeview'));

    for (const view in views)
        try {
            registered_extensions += globalExtensionsByView[view].length;
        } catch {
            registered_extensions += 0;
        }
}

Logic behind extensions counter can be displayed by this diagram:

reg-counter-diagram

Views counter just counts every views registered by the plugin natively, to count all of the views - use specified settings.

Green category: column and line of cursor

Column and line of the text cursor counts differently, depending on the type of view you currently editing:

  • if you work with code editor: in this case, column and line for your cursor would update at every mouse event and data would be provided by Monaco Editor.
  • anything else or just vanilla: in this case, column and line for your cursor would update only upon "editing" instance of file itself (editing file); this happens, because Obsidian doesn't provide correct way to read cursor's position natively - you would need entire subplugin for this.

Blue category: assigned render

This item displays currently assigned render for the file: for example, .py is python, native Obsidian's render - is markdown, every other unsupported render by Obsidian/UNITADE would be rendered as plaintext (unless it is supported by other plugin).

Clone this wiki locally