From ab34ee4d50d6678dc72e1639e957cbf0534cce6f Mon Sep 17 00:00:00 2001 From: Richard Osborne Date: Wed, 18 Feb 2026 17:38:55 +0100 Subject: [PATCH] =?UTF-8?q?docs(uba):=20sprint-1=20session-2=20progress=20?= =?UTF-8?q?=E2=80=94=20STYLE-005=20+=20UBA-001/002=20done?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../phase-6-uba-system/PROGRESS-richard.md | 67 +++++++++++++++++++ 1 file changed, 67 insertions(+) create mode 100644 dev-docs/tasks/phase-6-uba-system/PROGRESS-richard.md diff --git a/dev-docs/tasks/phase-6-uba-system/PROGRESS-richard.md b/dev-docs/tasks/phase-6-uba-system/PROGRESS-richard.md new file mode 100644 index 0000000..114476d --- /dev/null +++ b/dev-docs/tasks/phase-6-uba-system/PROGRESS-richard.md @@ -0,0 +1,67 @@ +# Phase 6: UBA System — Richard's Progress + +## Sprint 1 Session 2 — 18 Feb 2026 + +### Completed this session + +#### STYLE-005: SuggestionBanner wiring (property panel) — COMPLETE + +- Created `ElementStyleSectionHost` (editor-side React wrapper) + - Combines `ElementStyleSection` + `SuggestionBanner` + - Uses `useStyleSuggestions()` for the active suggestion + - Creates local `StyleTokensModel` instance (multiple instances safe — sync via ProjectModel events) + - Calls `executeSuggestionAction()` on accept, `dismissSession`/`dismissPermanent` on ignore/never +- Wired into `propertyeditor.ts` — drop-in replacement, zero API change +- All TS errors resolved + +#### UBA-001: TypeScript type definitions — COMPLETE + +- `packages/noodl-editor/src/editor/src/models/UBA/types.ts` +- Full discriminated union on `Field.type` (string, text, number, boolean, secret, url, select, multi_select) +- `BackendMetadata`, `Endpoints`, `AuthConfig`, `Capabilities`, `Section`, `Condition`, `DebugSchema` +- `ParseResult` discriminated union + `ParseError` type +- Zero external dependencies + +#### UBA-002: SchemaParser — COMPLETE + +- `packages/noodl-editor/src/editor/src/models/UBA/SchemaParser.ts` +- Accepts pre-parsed JS object (JSON.parse / yaml.load output) — no YAML dep required +- Validates: schema_version, backend (id/name/version/endpoints/auth/capabilities), sections, fields, debug +- Unknown field types → warning, not error (forward-compat) +- Unknown schema major version → warning with best-effort parsing +- All field types validated individually; partial errors collected before failing +- `packages/noodl-editor/src/editor/src/models/UBA/index.ts` — clean barrel exports + +#### UBA-002: SchemaParser unit tests — COMPLETE + +- `packages/noodl-editor/tests/models/UBASchemaParser.test.ts` +- 22 test cases covering: null/array rejection, missing version, version warning, minimal happy path +- Backend: missing, missing id, missing endpoints.config, optional fields, invalid auth type +- Sections: not array, minimal section, missing id +- Field types: string, boolean, number (min/max), secret, select (+ no-options error), multi_select, unknown type warning +- Debug schema with event_schema + +### Next session priorities + +#### UBA-003: Field renderers + +- 8 field renderer components (one per field type) +- `FieldRenderer` factory component (dispatches on `field.type`) +- Shared styles (`fields.module.scss`) +- `FieldWrapper` with label, description, required indicator + +#### UBA-004: ConfigPanel shell + +- `ConfigPanel.tsx` — renders sections + fields from a parsed `UBASchema` +- `useConfigForm` hook — manages form values, validation, dirty state +- Section collapsing, `visible_when` condition evaluation + +### Tracking + +| Task | Status | +| ---------------------------------- | ------- | +| STYLE-005: SuggestionBanner wiring | ✅ DONE | +| UBA-001: TypeScript types | ✅ DONE | +| UBA-002: SchemaParser + tests | ✅ DONE | +| UBA-003: Field renderers | 🔲 NEXT | +| UBA-004: ConfigPanel + hook | 🔲 TODO |