Skip to content

feat(page-editor): v1.1 — structured Logs/Settings/Chat/Files/Custom editors + validator inline marks + undo/redo#35

Merged
rubenvdlinde merged 4 commits into
developmentfrom
feature/page-editor-v1-1
May 12, 2026
Merged

feat(page-editor): v1.1 — structured Logs/Settings/Chat/Files/Custom editors + validator inline marks + undo/redo#35
rubenvdlinde merged 4 commits into
developmentfrom
feature/page-editor-v1-1

Conversation

@rubenvdlinde
Copy link
Copy Markdown
Contributor

Implements the bulk of #9 (openbuilt-page-editor v1.1 follow-up).

Landed

Page-type structured editors (5 stubs → real editors)

  • 4.4 LogsPageEditor — one-of picker between (register + schema, via the OR-REST pickers IndexPageEditor uses) OR a source string; columns list reusing ColumnBuilder.
  • 4.5 SettingsPageEditor + new SettingsSectionBuildersaveEndpoint field; sections vs tabs XOR (radio switch, tabbed mode owns nested section builders); each section declares exactly-one-of fields[] / component(+props) / widgets[] with built-in widget types version-info, register-mapping, component (componentName).
  • 4.6 ChatPageEditorconversationSource OR postUrl one-of + optional schema.
  • 4.7 FilesPageEditor — folder path + an allowed-types tag input (datalist of common MIME types / extensions).
  • 4.9 CustomPageEditorcomponent registry key (free-text, plus a <datalist> of known keys when a live-preview registry is available) + a props JSON textarea (parse errors surfaced inline, no emit on invalid JSON).
  • SUB_EDITOR_MAP in PageDesigner already pointed at these names; StubPageEditor stays the fallback for unknown types. Every editor keeps config keys it doesn't surface on update (lossless round-trip).

5.5 Validator inline marks (REQ-OBPD-011)

  • useManifestValidator gains errorMap ({ prefix → { hasError, message } }) + errorFor(prefix), with JSON-Pointer boundary matching so /pages/1 doesn't swallow /pages/10/... (and <pointer> is required / <pointer>: <msg> suffix forms still match).
  • New InlineFieldMark presentational component + pageEditorValidation mixin: sub-editors inject the pageEditorValidator PageDesigner provides, register/unregister their top-level config keys, set aria-invalid and render an inline <span role="alert"> next to each field. Injection is optional so each editor still mounts standalone. The right-pane error list is kept as the overview.

OQ-1 Undo/redo

  • New useManifestHistory composable: bounded (default 50) stack, no-ops on structurally-identical states, truncates the redo tail on a fresh push, exposes canUndo/canRedo.
  • PageDesigner toolbar gains Undo/Redo buttons; Ctrl+Z undo, Ctrl+Shift+Z / Ctrl+Y redo via a document keydown listener (removed on destroy). History is fed from the manifest watcher; undo/redo re-emit the historical manifest and (because push no-ops on identical states) the controlled-component echo doesn't thrash the stack. PageDesignerHost's save flow is untouched.

7.1 Tests

New vitest specs for LogsPageEditor, SettingsPageEditor, SettingsSectionBuilder, ChatPageEditor, FilesPageEditor, CustomPageEditor, InlineFieldMark + the mixin, useManifestValidator.inline-marks, useManifestHistory, PageDesigner.undo-redo. 280 vitest specs green (was 182). npm run lint / npm run stylelint clean; npm run build compiles.

Deferred (residual #9)

#9 stays open with that residual.

…sable

- useManifestValidator: add errorMap ({prefix -> {hasError, message}})
  + errorFor(prefix); JSON-Pointer boundary matching so /pages/1 does not
  swallow /pages/10/...; register() now takes an optional second arg.
- new useManifestHistory: bounded (default 50) undo/redo stack — no-ops
  on structurally identical states, truncates the redo tail on push.
- new InlineFieldMark presentational component + pageEditorValidation
  mixin (inject pageEditorValidator -> register/unregister config keys,
  markFor/isInvalid helpers); optional injection so sub-editors still
  mount standalone.

Refs #9 (5.5, OQ-1).
…itors + inline marks on all 9 sub-editors

- LogsPageEditor (4.4): register+schema OR source one-of (OR-REST
  pickers), columns via ColumnBuilder.
- SettingsPageEditor (4.5) + SettingsSectionBuilder: saveEndpoint,
  sections|tabs XOR, each section one-of fields/component(+props)/widgets
  (built-in widget types version-info, register-mapping, component).
- ChatPageEditor (4.6): conversationSource OR postUrl one-of + optional
  schema.
- FilesPageEditor (4.7): folder path + allowedTypes tag input.
- CustomPageEditor (4.9): customComponents key (free-text, datalist when
  preview registry available) + props JSON.
- All editors keep unsurfaced config keys on update (lossless round-trip).
- Index/Detail/Dashboard/Form: wired to the pageEditorValidation mixin +
  InlineFieldMark + aria-invalid.

Refs #9 (4.4-4.9, 5.5).
…orValidator

- toolbar with Undo / Redo buttons (canUndo/canRedo gating) above the
  three panes; Ctrl+Z undo, Ctrl+Shift+Z / Ctrl+Y redo via a document
  keydown listener (removed on destroy).
- seeds + feeds useManifestHistory from the manifest watcher (push
  no-ops on identical states, so the controlled-component echo is free);
  undo/redo re-emit the historical manifest without re-pushing.
- provide()s pageEditorValidator { register, unregister, errorFor } that
  maps a sub-editor's config key to /pages/<selected>/config/<key> and
  reads back the validator's errorMap for inline marks.

Refs #9 (OQ-1, 5.5).
…story, undo/redo

- LogsPageEditor / SettingsPageEditor / SettingsSectionBuilder /
  ChatPageEditor / FilesPageEditor / CustomPageEditor specs — mount with
  sample config, drive interactions, assert update:config payload shape
  and lossless round-trip (task 7.1).
- InlineFieldMark + pageEditorValidation mixin spec.
- useManifestValidator.inline-marks spec (errorMap/errorFor, boundary,
  suffix forms, register/unregister).
- useManifestHistory spec (push/no-op/undo/redo/bounds/reset/clone).
- PageDesigner.undo-redo spec (controlled-component echo, toolbar,
  keybindings, no-thrash, redo-tail truncation).

280 vitest specs green (was 182).

Refs #9 (7.1).
@github-actions
Copy link
Copy Markdown

Quality Report — ConductionNL/openbuilt @ 049c812

Check PHP Vue Security License Tests
lint
phpcs
phpmd
psalm
phpstan
phpmetrics
eslint
stylelint
composer ✅ 100/100
npm ✅ 432/432
PHPUnit
Newman
Playwright ⏭️

Coverage: 0% (0/19 statements)


Quality workflow — 2026-05-12 12:47 UTC

Download the full PDF report from the workflow artifacts.

@rubenvdlinde rubenvdlinde merged commit 9b9168a into development May 12, 2026
47 of 49 checks passed
@rubenvdlinde rubenvdlinde deleted the feature/page-editor-v1-1 branch May 12, 2026 12:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant