feat(app-shell): Studio CEL editor for list-view conditional formatting (#1584 / #1582)#2558
Merged
Merged
Conversation
…ng (#1584 / #1582) conditionalFormatting had no authoring UI in Studio — a low-code author could only hand-write the JSON. Adds a ConditionalFormattingEditor to the View inspector (ViewVariantInspector, list-family views; also hosted by the runtime ObjectView right-rail editor): an ordered list of rules, each a CEL predicate authored with CelPredicateField (inline lint + field autocomplete on the canonical @objectstack/formula engine) plus background / text / border colors. Rules are first-match-wins, so move up / down is supported. Reads/writes the spec-canonical { condition, style } shape (what the list / grid / kanban renderers evaluate since #1584). Legacy shapes — native { field, operator, value }, top-level color props, or a { dialect, source } condition envelope — are normalized to { condition, style } on read, upgrading an existing rule in place. English + Chinese labels. Component tests cover normalization + add/remove/reorder/edit; full metadata-admin suite (689) green; app-shell type-check green. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_019LwrWThBJgvcfPtqNHpstB
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
Contributor
✅ Console Performance Budget
📦 Bundle Size Report
Size Limits
|
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.
Summary
Follow-up to #1584 (merged in #2544), advancing the Studio CEL-authoring goal of #1582 to the list conditional tier.
#1584 moved list/grid/kanban
conditionalFormattingonto the canonical CEL engine at runtime, but there was no authoring UI for it in Studio — a low-code author could only hand-write the JSON (the one real gap the earlier investigation surfaced; actionvisible/disabledand field*Whenalready get CEL authoring viaConditionBuilder). This adds that editor.What changed
ConditionalFormattingEditor(packages/app-shell/src/views/metadata-admin/): an ordered list of rules. Each rule is:CelPredicateField— inline lint + field autocomplete on@objectstack/formula, the same engine the runtime and server use;ViewVariantInspectorfor list-family views (which also backs the runtime ObjectView's right-rail view editor), reading/writingvariant.conditionalFormatting. The bound object + field catalog it already resolves feed CEL autocomplete. Pruned from the spec-form graft so it isn't double-edited.Shape & back-compat
Reads and writes the spec-canonical
{ condition, style }shape (what the renderers evaluate since #1584). Legacy shapes — native{ field, operator, value }, top-levelbackgroundColor/textColor/borderColor, or a{ dialect, source }condition envelope — are normalized to{ condition, style }on read, so opening an existing rule upgrades it in place. The authoredconditionalFormattingflows straight to the runtime (the field ObjectView/ListView already consume).Tests
ConditionalFormattingEditor.test.tsx(12):normalizeRuleacross all historical shapes (incl.{dialect,source}unwrap, native→CEL translation,in), and interaction — empty state, add, edit condition, set/clear colors, remove, reorder. Full metadata-admin suite (689) passes;turbo type-check @object-ui/app-shellgreen; no new lint errors.Notes
*When/ actionvisiblealready haveConditionBuilder; unifying those ontoCelPredicateField(lint/autocomplete) would be a separate Studio: CEL editor (validate + autocomplete) for field conditional rules (visibleWhen/readonlyWhen/requiredWhen) #1582 change.🤖 Generated with Claude Code
Generated by Claude Code