Skip to main content

Module user_widgets

Module user_widgets 

Source
Expand description

The user’s own widgets.json, next to settings.json — Pane Tab contract v1, Phase 6 (docs/specs/SPEC_PANE_TAB_CONTRACT_V1_2026_09_24.md §4).

The widget bar used to come only from the widgets.json embedded at build time, so there was nowhere to add a third-party (ext:) widget. This file’s entries are merged over the built-ins: a new key adds a widget, a built-in key replaces that widget. Same load-then-watch shape as settings.json (config_watcher_fs) and browser_start_page, on the same fs_watch pool, riding the existing full-config broadcast.

Constants§

USER_WIDGETS_FILE

Statics§

LAST_USER 🔒
The user’s widgets.json as last read, for the widget packages scan (its v1 module entries are implied packages) and for recomputing the merge when a package changes.

Functions§

apply 🔒
builtin_widgets 🔒
The built-in widgets, parsed once.
is_user_widgets_event 🔒
last_v1_entries
The v1 entries (module set) of the user’s widgets.json as last read.
load_user_widgets_from_disk
merge_widgets
The built-ins with the user’s entries merged over them.
on_changed 🔒
widgets.json changed: merge again, and tell every UI both the new config and the package list, since its v1 module entries are packages too.
read_user_widgets
The user’s widgets; an absent or empty file is none.
recompute
Merge again: the built-ins, then each approved widget package’s entries (SPEC_USER_WIDGETS_AND_WIDGET_API_2026_10_09.md §5.4), then the user’s own widgets.json, which replaces a package’s entry when it uses the same key.
spawn_user_widgets_watcher
user_widgets_path