Changeset 0.28.3.1 (#188)
This commit is contained in:
74
CHANGELOG.md
74
CHANGELOG.md
@@ -1,5 +1,79 @@
|
||||
# Changelog
|
||||
|
||||
## [0.28.3.1] — 2026-03-14
|
||||
|
||||
### Summary
|
||||
|
||||
Frontend decomposition Phases 2 + 3. Phase 2: onclick→data-action
|
||||
delegation migration (143 → 5 unconvertible). Phase 3: `sb.js` action
|
||||
registry replacing all `window.*` exports with centralized
|
||||
`sb.register()`/`sb.ns()` dispatch.
|
||||
|
||||
### Added
|
||||
|
||||
#### Action Registry — `sb.js` (Phase 3)
|
||||
- New file `src/js/sb.js`, loaded first in `base.html`.
|
||||
- `sb.register(name, fn)` — register standalone action, dual-writes to
|
||||
`window[name]` for backward compat until ES modules land.
|
||||
- `sb.ns(name, obj)` — register namespace object (API, UI, App, etc.),
|
||||
methods accessible via dot notation: `sb.resolve('UI.copyMessage')`.
|
||||
- `sb.resolve(name)` — centralized action resolution for flat names
|
||||
and dot-notation namespace methods. Falls back to `window[name]`.
|
||||
- `sb.call(name, ...args)` — template bridge for Go onclick handlers.
|
||||
- `sb.callEvent(event, name, ...args)` — event passthrough variant.
|
||||
- `sb.list()` — introspection: list all registered actions/namespaces.
|
||||
- `sb.has(name)` — check if action is registered.
|
||||
|
||||
### Changed
|
||||
|
||||
#### Phase 2 — onclick→data-action Delegation
|
||||
- 138 of 143 dynamic inline onclick handlers converted to `data-action`
|
||||
+ `data-args` attributes with centralized event delegation.
|
||||
- `_uiDispatch(container)`: idempotent delegated click handler wired on
|
||||
`document.body`. Supports `data-args` (JSON), `data-pass-event`
|
||||
(context menu positioning), `data-pass-el` (checkbox state).
|
||||
- `_ctxDispatch(container)`: idempotent delegated handler for context
|
||||
menus and panel buttons (auto-dismisses menu after action).
|
||||
- Wrapper functions for compound expressions: `_toggleArchivedProjects`,
|
||||
`_submitEditFromDOM`, `_copyCodeBlock`, `_openNoteFromTool`,
|
||||
`_toggleNoteSelectCb`, `_noteItemClick`.
|
||||
- 5 unconvertible onclick remain (self-referencing DOM removal,
|
||||
computed onclick from variable).
|
||||
|
||||
**Files converted (onclick):** `projects-ui.js` (26→0), `ui-core.js`
|
||||
(25→1), `ui-admin.js` (28→1), `ui-format.js` (10→0),
|
||||
`notifications.js` (8→0), `notes.js` (8→0), `channel-models.js` (5→0),
|
||||
`ui-settings.js` (8→0), `files.js` (3→0), `admin-handlers.js` (2→0),
|
||||
`app.js` (4→1), `workflow-queue.js` (6→0), `workflow-admin.js` (5→0),
|
||||
`task-settings.js` (1→0), `task-sidebar.js` (3→1).
|
||||
|
||||
#### Phase 3 — Action Registry Migration
|
||||
- 234 top-level `window.X = X` exports across 35 files converted to
|
||||
`sb.register('X', X)` or `sb.ns('X', X)`. 28 namespace objects,
|
||||
206 standalone functions.
|
||||
- 14 in-body `window.X = function` assignments across 6 files
|
||||
(`settings-handlers.js`, `task-admin.js`, `task-settings.js`,
|
||||
`task-sidebar.js`, `workflow-admin.js`, `workflow-queue.js`)
|
||||
converted to `sb.register('X', function)` or local const + `sb.ns()`.
|
||||
- `_uiDispatch` and `_ctxDispatch` dispatch updated to use
|
||||
`sb.resolve()` instead of `window[]` walking.
|
||||
- `base.html` loads `sb.js` before `app-state.js`.
|
||||
- `sb.register/sb.ns` dual-writes to `window.*` for backward
|
||||
compatibility — this side-effect is removed when files convert to
|
||||
ES module imports (Phase 4).
|
||||
|
||||
### Metrics
|
||||
|
||||
| | v0.28.3 | v0.28.3.1 |
|
||||
|--|---------|-----------|
|
||||
| Dynamic inline onclick | 143 | 5 (unconvertible) |
|
||||
| data-action delegated | 0 | 163 |
|
||||
| `window.*` exports | 248 | 1 (debug fetch patch) |
|
||||
| `sb.register` calls | 0 | 220 |
|
||||
| `sb.ns` calls | 0 | 30 |
|
||||
| Action resolution | `window[]` | `sb.resolve()` centralized |
|
||||
|
||||
|
||||
## [0.28.3] — 2026-03-13
|
||||
|
||||
### Summary
|
||||
|
||||
Reference in New Issue
Block a user