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§
Functions§
- add_
section_ entry - Adds a section’s
entryto the user’s widgets.json (section_entry_in) and applies the file at once, so the widget bar can pin the entry as soon as this returns; the file watcher applies it again a moment later, which changes nothing. Returns the entry’s key. For “Pin this section to the widget bar” (section-pins.ts): the bar pins only an entry that exists. - last_
v1_ entries - The v1 entries (
moduleset) 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.
- parse_
user_ widgets - The widgets in a widgets.json’s text (
read_user_widgetswithout the file). - read_
user_ widgets - The user’s widgets; an absent file, or one with nothing in it but comments, is none. The file is read as
JSONC, like
settings.json: comments and trailing commas are allowed. A file that does not parse is an error that names its line and column. - 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.
- section_
entry_ in - Where a section’s
entryis, or goes, in widgets.json: underbaseif that key is free or already opens this section, otherwise under the first freebase-2,base-3, …, so a key the user reused for something else is never handed back as this section’s. Returns the key and, when the entry has to be added, the file’s new text. An absent or empty file is{}; one that doesn’t parse is an error, so a file the user is halfway through editing is never rewritten. - spawn_
user_ widgets_ watcher - user_
widgets_ path