Repository navigation
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
|
os-zhuang
marked this pull request as ready for review
July 16, 2026 03:02
This was referenced Aug 13, 2026
akarma-synetal
pushed a commit
to akarma-synetal/objectui
that referenced
this pull request
Aug 17, 2026
…ack when no id is passed (objectstack-ai#4533) (objectstack-ai#4561) CelPredicateField renders BOTH halves of its own label association — the `Label htmlFor` and the `Textarea id` — but `id` was an optional prop with no fallback, so a call site that omitted it left both `undefined`: a label that read correctly on screen and resolved to nothing, and an editor with no accessible name. The RLS `USING (read filter)` and `CHECK (write filter)` clauses on the permission-set editor were mounted that way, so the row-filter authoring surface was unreachable by label. It surfaced from the authoring side: writing objectui#4302's wire pins, `getByLabelText('USING (read filter)')` was refused outright and that test had to select by placeholder instead. Fixed at the component rather than the callers: `id` falls back to `useId()`, so the association is a property of mounting the component instead of every caller remembering the prop. An explicit `id` still wins unchanged. The autocomplete listbox is named off the same resolved id, closing the same association hole on `aria-controls`. Two corrections to the card's table, both measured on origin/main: ConditionalFormattingEditor was listed as omitting `id` but has passed `cf-condition-{i}` since objectstack-ai#2558; and inspectors/ConditionBuilder.tsx DOES omit it and was not listed — the component-level fallback repairs it with no call-site edit, which is the argument for fixing the contract. Claude-Session: https://claude.ai/code/session_017Qqyix2QcnpUC9XeYVDzx3 Co-authored-by: Claude <noreply@anthropic.com>
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