Commit Graph

7 Commits

Author SHA1 Message Date
Richard Osborne
7bd9b4c3e6 feat(sprint-2): STYLE-005 StyleAnalyzer tests + UBA-005 UBAClient HTTP service
- STYLE-005: 19 unit tests for StyleAnalyzer (toSuggestions, analyzeProject, analyzeNode)
  - toSuggestions: ordering, message format, id format, acceptLabel variants
  - analyzeProject: repeated color/spacing detection, threshold enforcement, var() skip, tokenModel matching
  - analyzeNode: variant candidate detection, threshold, var() reference exclusion
- STYLE-005: Wire tests into test index (new tests/models/ and tests/services/ indexes)
- UBA-005: UBAClient static class with configure(), health(), openDebugStream()
  - Full auth support: bearer, api_key (custom header), basic
  - Timeout via AbortController (10s default)
  - health() never throws — always returns HealthResult
  - openDebugStream() returns DebugStreamHandle; handles named SSE event types
  - UBAClientError with status + body for non-2xx responses
2026-02-18 19:58:30 +01:00
Richard Osborne
c04bf2e6cb feat(uba): UBA-003/004 field renderers + ConfigPanel + Conditions 2026-02-18 18:23:10 +01:00
Richard Osborne
6e0ad689ae feat(styles+uba): STYLE-005 wiring + UBA-001/002
STYLE-005: ElementStyleSectionHost wraps ElementStyleSection with
SuggestionBanner. Uses useStyleSuggestions + executeSuggestionAction.
propertyeditor.ts updated to use host (drop-in, zero API change).

UBA-001: types.ts — Field discriminated union (8 types), BackendMetadata,
Section, Condition, ParseResult<T>. Zero external deps.

UBA-002: SchemaParser.ts validates pre-parsed objects against UBA v1.
Forward-compat: unknown field types/versions produce warnings not errors.
22 unit tests in tests/models/UBASchemaParser.test.ts.
2026-02-18 17:38:55 +01:00
Richard Osborne
64e565f00f test(styles): STYLE-005 StyleAnalyzer unit tests (17 cases)
Covers: hex/rgb color detection, spacing detection, variant candidate
threshold logic, toSuggestions ordering, stable IDs, edge cases.

Infra note: tests in tests/models/ — use 'npm run test:editor' not
'npx jest' directly (webpack build required by test-editor.ts script).
'npx jest' alone hangs on webpack. Move tests to tests/models/ not
tests/services/ — transform config only covers models/ path.
2026-02-18 17:14:52 +01:00
Richard Osborne
d9acb41d2f feat(launcher): add ProjectCreationWizard multi-step flow
Replaces CreateProjectModal with a guided wizard supporting:
- Quick Start (name + location, direct creation)
- Guided Setup (basics → style preset → review → create)
- AI Builder stub (V2, same flow as Guided for now)

Files added:
- WizardContext.tsx — state machine with step sequencing + canProceed validation
- EntryModeStep — card-based mode selector
- ProjectBasicsStep — name/description/location picker
- StylePresetStep — preset card grid
- ReviewStep — summary before creation
- ProjectCreationWizard.tsx — drop-in replacement for CreateProjectModal
- SCSS + index.ts barrel

Integration:
- ProjectsPage.tsx imports ProjectCreationWizard (API-identical swap)

Tests:
- tests/models/ProjectCreationWizard.test.ts — 17 pure logic tests
  (infra note: npm run test:editor required, not npx jest directly)

Pre-existing broken tests in tests/components/ and tests/git/ are
unrelated and not modified.
2026-02-18 16:45:12 +01:00
Richard Osborne
297dfe0269 Added sprint protocol 2026-02-18 15:59:52 +01:00
Richard Osborne
6f08163590 new code editor 2026-01-11 09:48:20 +01:00