-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: Apply rules in request list in generators #499
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is it expected to still have the Rule preview tab? Personally, I find it more confusing to have preview in two places and to be able to turn off rule application while being in the rule editor
} | ||
|
||
return ( | ||
<Flex |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This doesn't prevent the user from using keyboard to edit the rules, but I'm not convinced we should disable/hide the UI if the switch is off - maybe keeping the rule list/rule editor accessible, but showing a very noticeable Callout
component at the top of that pane will work better? Here's what it could look like (the copy is a quick draft)


Might be worth discussing this with @majavojnoska
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
src/store/generator/slices/rules.ts
Outdated
@@ -4,6 +4,7 @@ import { ImmerStateCreator } from '@/utils/typescript' | |||
interface State { | |||
rules: TestRule[] | |||
selectedRuleId: string | null | |||
rulesEnabled: boolean |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it should have a different name, because we already have a concept of disabled rules and it means something else.
checked={rulesEnabled} | ||
onCheckedChange={setEnableRules} | ||
/> | ||
Apply rules |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To me, this part of the new UI is rather confusing - why would I not want to apply rules to my recording?
I also think that when it comes to script generation rules should be applied regardless of this setting.
I don't have a good copy suggestion, but maybe something focused on the recording rather than rules? The reason I think it might be better is because the goal of having this switch (as far as I understand) is for the user to be able to check the original recording without any test rules applied.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've used "View original requests" and will revisit after we collect feedback
Keeping the preview tab in this iteration to preserve the ability to see which requests are affected by the selected rule. Will be removed in the next PR. Other comments have been addressed, and it's ready for another review 🙌 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
Description
This is the first PR towards improved rule preview - apply rules in request list in generators. Previously, we would show unmodified requests, with exception when opening a rule editor and viewing rule preview tab, which will be removed in future PRs. Also, it wasn't possible to see request list with all rules applied, just the one you have selected.
Per suggestion during our latest sync I've also added ability to switch between original request list and the one with rules applied. It affects request list, details inspector, script, and validator. This may come handy when debugging rules and user won't have to disable rules one-by-one.
How to Test
Verify modifications added by rules are reflected in request list, inspector, script, and validator. Confirm with both "apply rules" toggle enabled and disabled.
Checklist
npm run lint
) and all checks pass.npm test
) and all tests pass.Screenshots (if appropriate):
screencapture.2025-02-18.at.14.34.44.mp4
Related PR(s)/Issue(s)