feat: support visible_rule for form questions#1891
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (11)
🚧 Files skipped from review as they are similar to previous changes (9)
📝 WalkthroughWalkthroughForm question create and update commands preserve ChangesForm visible rule support
Estimated code review effort: 3 (Moderate) | ~30 minutes Sequence Diagram(s)sequenceDiagram
participant CLI
participant BaseFormQuestionsCommand
participant DryRunAPI
CLI->>BaseFormQuestionsCommand: Provide questions JSON with visible_rule
BaseFormQuestionsCommand->>DryRunAPI: Parse questions and attach request body
DryRunAPI-->>CLI: Print POST or PATCH preview with visible_rule
Suggested reviewers: 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
🧹 Nitpick comments (1)
tests/cli_e2e/base/coverage.md (1)
53-56: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low valueAlign testcase reference formatting in the Command Table.
For consistency with the rest of the Command Table, please include the filename prefix (
base_form_questions_dryrun_test.go::) before the testcase names.💅 Proposed nitpick fix
-| ✓ | base +form-questions-create | shortcut | TestBaseFormQuestionsCreateVisibleRuleDryRun | questions[].visible_rule | dry-run: request shape + visible_rule body passthrough | +| ✓ | base +form-questions-create | shortcut | base_form_questions_dryrun_test.go::TestBaseFormQuestionsCreateVisibleRuleDryRun | questions[].visible_rule | dry-run: request shape + visible_rule body passthrough | | ✕ | base +form-questions-delete | shortcut | | none | form workflows not covered | | ✕ | base +form-questions-list | shortcut | | none | form workflows not covered | -| ✓ | base +form-questions-update | shortcut | TestBaseFormQuestionsUpdateVisibleRuleDryRun | questions[].visible_rule | dry-run: request shape + visible_rule body passthrough | +| ✓ | base +form-questions-update | shortcut | base_form_questions_dryrun_test.go::TestBaseFormQuestionsUpdateVisibleRuleDryRun | questions[].visible_rule | dry-run: request shape + visible_rule body passthrough |🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@tests/cli_e2e/base/coverage.md` around lines 53 - 56, Update the testcase references in the Command Table entries for form-questions-create and form-questions-update to prepend base_form_questions_dryrun_test.go:: to each testcase name, matching the established formatting used elsewhere in the table.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Nitpick comments:
In `@tests/cli_e2e/base/coverage.md`:
- Around line 53-56: Update the testcase references in the Command Table entries
for form-questions-create and form-questions-update to prepend
base_form_questions_dryrun_test.go:: to each testcase name, matching the
established formatting used elsewhere in the table.
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: 679a67ee-c059-4f3e-833f-9a2cefb5de69
📒 Files selected for processing (11)
shortcuts/base/base_form_execute_test.goshortcuts/base/base_form_questions_create.goshortcuts/base/base_form_questions_update.goshortcuts/base/base_shortcuts_test.goskills/lark-base/SKILL.mdskills/lark-base/references/lark-base-filter-condition.mdskills/lark-base/references/lark-base-form-questions-create.mdskills/lark-base/references/lark-base-form-questions-update.mdskills/lark-base/references/lark-base-view-set-filter.mdtests/cli_e2e/base/base_form_questions_dryrun_test.gotests/cli_e2e/base/coverage.md
🚀 PR Preview Install Guide🧰 CLI updatenpm i -g https://pkg.pr.new/larksuite/cli/@larksuite/cli@f753d1f51f85f4485a26515143ca1a45a67aa734🧩 Skill updatenpx skills add yballul-bytedance/cli#feat/form-question-visible-rule -y -g |
9e24135 to
0fd0d04
Compare
Form questions can now carry a visible_rule (display condition) so a question shows only when earlier questions match the rule. The rule shares the exact same structure as the view filter, so extract that structure into a single shared reference (lark-base-filter-condition.md) that both view-set-filter and visible_rule point to. - create/update shortcuts: document visible_rule in --questions help and transcribe the questions body (including visible_rule) into dry-run output - skill refs: add visible_rule sections to form-questions create/update, note it is only needed when the user asks for a display condition, and that form-questions-list returns it verbatim - tests: pin flag help, verbatim visible_rule passthrough on create/update/list, and add dry-run E2E coverage
0fd0d04 to
f753d1f
Compare
Summary
Form questions can now carry a
visible_rule(display condition) so a question is shown only when earlier questions satisfy the rule. The rule shares the exact same structure as the view filter, so that structure is extracted into a single shared reference that both+view-set-filterandvisible_rulepoint to.Changes
visible_rulein the--questionsflag help for+form-questions-create/+form-questions-update, and transcribe the questions body (includingvisible_rule) into dry-run output so the preview reflects what is actually sent.skills/lark-base/references/lark-base-filter-condition.md) as the SSOT for the{logic, conditions}structure;lark-base-view-set-filter.mdnow references it instead of duplicating it.visible_rulesections to the form-questions create/update refs (only needed when the user asks for a display condition; note that+form-questions-listreturns it verbatim), and wire the new ref intoSKILL.md.visible_rulepassthrough on create/update/list, and add dry-run E2E coverage.Test Plan
go test ./shortcuts/base/, dry-run E2E undertests/cli_e2e/base/)lark-cli base +form-questions-create/-listflow works against a real Base (BOE), including creating and reading back a question with avisible_ruleRelated Issues
Summary by CodeRabbit
New Features
visible_rule.questions[].visible_rulein the request payload.visible_rulecan be cleared by setting it tonull.Documentation
visible_rule/filter-condition reference with structure, operators, and examples.Tests
visible_ruleis passed through verbatim and dry-run output matches.