Skip to content

fix(web): preserve computed definitions during rule metadata edits - #829

Merged
WaylandYang merged 2 commits into
deeplethe:devfrom
Maya-Kid:codex/preserve-computed-rule-editing
Sep 20, 2026
Merged

WaylandYang merged 2 commits into
deeplethe:devfrom
Maya-Kid:codex/preserve-computed-rule-editing

Conversation

@Maya-Kid

Copy link
Copy Markdown
Contributor

Computed rules currently appear without their expression, and editing them through the ordinary form sends a definition without conclude_expr, which the API rejects. Render their expression with attribute labels and preserve their definition by editing only name and description. Unknown expressions and values that the ordinary form cannot round-trip use the same protected metadata editor; failed saves retain the draft for retry.

This addresses the existing-rule editing portion of #488. It does not introduce a computed-rule creation editor or decide unit/datatype semantics. Expression operands are displayed defensively, without claiming the current API accepts them on creation.

Validation:

  • Six frontend regressions cover expression parsing, depth limits, ambiguous/missing labels, guarded definitions, and the exact metadata-only PATCH payload on failure/retry.
  • A real PostgreSQL authenticated API regression reproduces the old 422 response, verifies metadata updates preserve the nested expression and condition groups, and checks invalid-name/viewer rejection.
  • Linux workspace: 952 passed, zero failed, one existing ignored public-network test. Final added API assertion rerun passed. Formatting, Clippy with warnings denied, and workspace build passed; frontend 97 tests and production build passed.
  • Headless browser checks using mocked API data cover rendering, cancel, failed-save retry, unknown expressions, and Chinese text.
  • Combined with the human-review lock fix and rule dependency viewer: Linux workspace 957 passed, zero failed, one existing ignored test; frontend 106 passed, production build and both browser scenarios passed. Combining the two UI PRs requires retaining both imports, translation entries, and helpers in RulesPanel; this union was tested locally.

Refs #488

Signed-off-by: dada-yan <BinjunYann@gmail.com>
@WaylandYang
WaylandYang merged commit 8d70aeb into deeplethe:dev Sep 20, 2026
4 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.

2 participants