Repository navigation
Conditions edit in place, and validation speaks the builder's language - #24
Merged
AllTerrainDeveloper merged 1 commit intoAug 21, 2026
Merged
Conversation
Two WYSIWYG moves in one change: The "shown when" row on a canvas card is now the editor for what it shows. The verb flips show/hide, the comparison is a small inline select, the answer is an editable chip (a select of the source field's choices where it has them), and "and"/"or" toggles how rules combine. Curve labels and the inspector follow every keystroke. The pattern box grew into an answer-shape system. A picker of 17 presets — email, phone, ZIP, IBAN, card number (Luhn-checked), and more — enforced identically by browser and server from twin tables, with tests/fixtures/validation-cases.json as the shared conformance table neither side can drift from. When no preset fits, "A custom rule…" opens a child window where plain-question blocks (starts with, must contain, only these characters, length) compile into one pattern, described back in plain words, with a live playground that judges sample answers as the rule is edited. The blocks are stored as a recipe (`validationRecipe`) so the editor reopens as it was left. New hook: `atf_validation_presets` (documented, Experimental). Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_0119U4sRRWGcTQdwYreTwpAp
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
WYSIWYG conditions on the canvas
The "shown when" row on a card is now the editor for what it shows — nothing on it is inert text any more:
Keystrokes write to the live rule and refresh the curve labels without rebuilding the DOM under the caret; the commit (change/blur) redraws everything and restores focus. Card gestures (drag, select, Backspace-to-delete) are fenced out of the row.
"The answer should be…" — validation presets
The raw regex "Pattern" box is replaced by a picker of 17 named answer shapes: email, phone, @handle, digits, decimal, price, US ZIP, UK postcode, IBAN, card number (Luhn-checked), letters, alphanumeric, one-word, URL, IP, slug, hex colour. Each preset is enforced identically by browser and server from twin tables (
src/shared/validation.ts/includes/validation.php), withtests/fixtures/validation-cases.jsonas the shared conformance fixture both suites read — the tables cannot drift silently. Every preset's picker hint is its own passing example.The custom-rule builder, with a playground
When no preset fits, "A custom rule…" opens a child window over the builder:
The blocks persist as a whitelisted-normalised recipe (
validationRecipe) so the editor reopens as it was left; the compiledpatternis what both engines enforce. A pre-existing hand-written pattern opens in the expert tab rather than starting from zero.New filter:
atf_validation_presets(documented indocs/hooks-reference.md, Experimental).Tests
atf_normalize_schema().🤖 Generated with Claude Code
https://claude.ai/code/session_0119U4sRRWGcTQdwYreTwpAp