Skip to content

The custom-rule editor is a real child window, not a dialog - #25

Merged
AllTerrainDeveloper merged 2 commits into
mainfrom
feature/validation-child-window
Aug 21, 2026
Merged

AllTerrainDeveloper merged 2 commits into
mainfrom
feature/validation-child-window

Conversation

@AllTerrainDeveloper

Copy link
Copy Markdown
Owner

Follow-up to #24, on review feedback: the custom validation editor opened as an overlay dialog, but OpenStation offers real child windows — so now it uses them.

What changed

openValidationEditor() now asks the shell first: it resolves the builder's window id (windowIdOf) and opens the editor via wp.os.windowManager.openChild() — a native child window owned by the builder:

  • Its own title bar ("Custom rule — field label"), drag, resize, minimize, maximize and taskbar entry, centered over the builder.
  • The builder stays fully visible, scrollable and interactive beside it — the person can still see, select and reread the field whose rule they are writing — but can never sit above its child (the shell's ownership rule).
  • Closing/minimizing the owner cascades to the child; children are excluded from session snapshots (ephemeral: true says so explicitly).
  • Save and the title-bar X both funnel through the window's close; the window's onClose is the single place that decides whether that was a cancel, so the inspector's picker reverts however the window goes away.
  • Reopening for the same field replaces a stale instance; geometry memory is shared across fields via baseId.

The overlay dialog remains only as the fallback on the plain admin page, where there is no shell. The editor UI itself (blocks, expression tab, plain-words summary, playground) is built once by one function into whichever host shows it — no duplication between the two modes.

QA (8889, live)

  • Opens as wp-window-allterrain-forms-validation-f3 with full chrome, no overlay/backdrop.
  • Dragged it aside; built a rule while the builder stayed readable next to it; playground verdicts live.
  • Save → window closes, inspector shows "Your rule" in plain words.
  • Title-bar X → window closes, picker reverts to "Anything at all".
  • Child stays above the builder when the builder is clicked; builder keeps working.

Tests: 337 vitest pass; no PHP changes.

🤖 Generated with Claude Code

https://claude.ai/code/session_0119U4sRRWGcTQdwYreTwpAp

AllTerrainDeveloper and others added 2 commits August 21, 2026 10:00
The rule being written is about a field the person can still see,
select and reread while they write it — so the editor now opens
through the shell's own windowing, `windowManager.openChild()`, as a
window the builder owns: its own chrome, drag, resize, minimize and
taskbar entry, centered over the builder, which stays scrollable and
readable beside it but can never sit above its child. Save and the
title-bar X both funnel through the window's close; `onClose` is the
one place that decides whether that was a cancel, so the picker
reverts however the window goes away.

The overlay remains as the fallback on the plain admin page, where
there is no shell to ask. The editor's UI is built once, by one
function, into whichever host is showing it.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0119U4sRRWGcTQdwYreTwpAp
Three refinements from live review:

The editor's host is now pinned absolutely to the window body instead
of sized 100% — the body is a flex item with overflow hidden and no
explicit height, so the percentage could resolve against nothing and
the content grew past the window with the Save button clipped
somewhere nobody could reach.

Save and Cancel ride the bottom of the scrollport as a sticky bar
with a top border, so in a window the person sizes themselves,
"scroll to find Save" stops being a step at all.

The condition row's dropdowns are the shell's own <os-select> when
its components are loaded — the same control the inspector uses, so
nothing on the card reads as a foreign widget — with the free-text
value input and the chips raised to the trigger's scale and the row
centered as one line. The compact native select remains as the
fallback for the plain admin page, now with the 30px wp-admin floor
explicitly zeroed, which is what had it towering over its own row.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0119U4sRRWGcTQdwYreTwpAp
@AllTerrainDeveloper
AllTerrainDeveloper merged commit f3b63b3 into main Aug 21, 2026
3 checks passed
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