Action text fallback behavior#801
Conversation
Replace elif with an independent guard so truthy rule_groups that only yield None (or other non-0/1 values) still read folder["action"] before defaulting to Block (Default).
|
Merging to
After your PR is submitted to the merge queue, this comment will be automatically updated with its status. If the PR fails, failure details will also be posted here |
| if action_val not in (0, 1) and "action" in folder: | ||
| action_val = folder["action"] |
There was a problem hiding this comment.
📝 Info: Behavioral change: rule_groups with invalid action now falls back to folder-level action
The elif → if change introduces genuinely new behavior in one scenario: when rule_groups exists and is non-empty, but all rule groups share an action value that is not 0 or 1 (e.g., None from a missing key via rg.get("action")). Previously, the old elif would skip the folder["action"] fallback entirely, causing the function to always return the default "Block (Default)". Now, it falls back to folder["action"] if present. This is the stated intent of the PR (commit message: "fix: restore folder action fallback when rule_groups lacks 0/1"). The existing tests in tests/test_plan_details.py and tests/test_ux.py all pass under the new logic because none of them exercise this specific edge case (rule_groups with non-0/1 actions alongside a folder-level action key). A test covering this exact scenario would strengthen confidence.
Was this helpful? React with 👍 or 👎 to provide feedback.
This pull request contains changes generated by a Cursor Cloud Agent