pi-utils-settings: v0.23.0
Minor Changes
-
67b01b6: Reorganize internals for depth and testability.
SectionedSettingstakes a single options object ({ sections, maxVisible?, theme, onChange, onCancel, ... }) instead of positional arguments, matching every other component. Nothing else constructed it in known consumers, so resolution is mechanical.- Removed unused
SectionedSettings.updateValue— no internal or consumer usage. defaultChangeHandleris no longer re-exported from@aliou/pi-utils-settings/settings-command; it lives in the panel module. It was never exported from the package root.- New layout: component classes live in
components/(including the newSettingsPanel implements Component, whichregisterSettingsCommand’sctx.ui.customcallback just constructs), config infrastructure inconfig/(loader, version math, schema helpers), and shared domain types (scopes, tabs, section-builder contracts) intypes.ts. - Corrupted config files no longer fail silently: the loader queues a
[settings] Failed to parse config …message on its existingdrainMessages()channel — drain onsession_startand show viactx.ui.notifywith the fresh context. Migration failures and broken message factories use the same channel. Noconsole.*anywhere in library code (it corrupts the TUI layout). - Test support: shared
src/test/helpers (identity theme, key constants, render assertions, the settings command harness), excluded from the npm tarball. The harness captures all registered commands and passesargsas a string, matching the real pi contract.
-
705ce1c: Add an
aliasesoption toregisterSettingsCommand: each alias registers a second command (e.g./my-ext:proxy) that opens the same settings UI with a preselected tab (scope or extra tab), with registration-time validation for duplicate alias names and unknown tabs, and a default palette description ofOpen ${title} (${tabLabel}). The main command’s args now preselect a tab (/my-ext:settings proxy, matched case-insensitively against tab ids then labels, unknown tokens warn and fall back to the default tab) and it registersgetArgumentCompletionswith one item per registered tab.