Skip to content

feat(example-showcase): demo field conditional rules on Invoice (B2) - #1653

Merged
xuyushun441-sys merged 1 commit into
mainfrom
b2-showcase-conditional-rules
Jun 7, 2026
Merged

xuyushun441-sys merged 1 commit into
mainfrom
b2-showcase-conditional-rules

Conversation

@xuyushun441-sys

Copy link
Copy Markdown
Collaborator

What

Exercises the B2 dual-side field conditional rules end-to-end on the showcase Invoice header:

issued_on: Field.date({ requiredWhen: "record.status in ['sent', 'paid']" }),
tax_rate:  Field.number({ readonlyWhen: "record.status == 'paid'" }),
paid_on:   Field.date({
  visibleWhen:  "record.status == 'paid'",   // UX-only — hidden until paid
  requiredWhen: "record.status == 'paid'",   // enforced client AND server
}),

Verification

Drives the objectui field-conditional-rules live e2e (Status → paid/sent/draft re-gates each dependent field). Example-only change; no published package affected.

🤖 Generated with Claude Code

Adds visibleWhen / readonlyWhen / requiredWhen to the showcase Invoice header
to exercise the full dual-side conditional-rule feature end to end:
- issued_on.requiredWhen = "record.status in ['sent', 'paid']"
- tax_rate.readonlyWhen  = "record.status == 'paid'"  (server also strips writes)
- paid_on.visibleWhen / requiredWhen = "record.status == 'paid'"

Drives the objectui field-conditional-rules live e2e.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@vercel

vercel Bot commented Jun 7, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
spec Ready Ready Preview, Comment Jun 7, 2026 1:15pm

Request Review

This branch was successfully deployed

1 active deployment
Preview — d6ea8ac9 Deployed Jun 7, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants