-
Notifications
You must be signed in to change notification settings - Fork 3.1k
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
Added support for boolean parameters in annotations actions #8798
Conversation
Important Review skippedAuto incremental reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the You can disable this status message by setting the WalkthroughThis update introduces support for boolean parameters in annotation actions, enhancing the system's flexibility. Key changes include the addition of a Changes
Poem
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
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.
Actionable comments posted: 0
🧹 Outside diff range and nitpick comments (1)
cvat-ui/src/components/annotation-page/annotations-actions/annotations-actions-modal.tsx (1)
263-272
: Consider improving boolean value handlingThe current implementation could be more robust in handling boolean values:
- The string-to-boolean conversion could handle more cases
- The default value handling could be more explicit
Consider this improved implementation:
if (type === ActionParameterType.CHECKBOX) { return ( <Switch - checked={value.toLowerCase() === 'true'} + checked={['true', '1', 'yes'].includes(value.toLowerCase())} onChange={(val: boolean) => { - setValue(String(val)); + setValue(val ? 'true' : 'false'); }} + defaultChecked={['true', '1', 'yes'].includes(computedDefaultValue.toLowerCase())} /> ); }
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
📒 Files selected for processing (3)
changelog.d/20241209_110126_sekachev.bs_support_boolean.md
(1 hunks)cvat-core/src/annotations-actions/base-action.ts
(1 hunks)cvat-ui/src/components/annotation-page/annotations-actions/annotations-actions-modal.tsx
(3 hunks)
🔇 Additional comments (4)
changelog.d/20241209_110126_sekachev.bs_support_boolean.md (1)
1-4
: LGTM!
The changelog entry is well-formatted and properly documents the feature addition with a reference to the PR.
cvat-core/src/annotations-actions/base-action.ts (1)
12-12
: LGTM!
The addition of CHECKBOX
type to ActionParameterType
enum is clean and consistent with the existing pattern.
cvat-ui/src/components/annotation-page/annotations-actions/annotations-actions-modal.tsx (2)
28-28
: LGTM!
The imports are properly organized and the components are imported from the correct packages.
Also applies to: 33-33
Line range hint 253-272
: Verify error handling for invalid boolean values
The current implementation might not handle invalid string values gracefully.
Quality Gate passedIssues Measures |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## develop #8798 +/- ##
===========================================
+ Coverage 73.92% 73.95% +0.02%
===========================================
Files 409 409
Lines 43957 43957
Branches 3986 3986
===========================================
+ Hits 32497 32508 +11
+ Misses 11460 11449 -11
|
Motivation and context
How has this been tested?
Checklist
develop
branch(cvat-canvas,
cvat-core,
cvat-data and
cvat-ui)
License
Feel free to contact the maintainers if that's a concern.
Summary by CodeRabbit
New Features
CHECKBOX
option to action parameters, enhancing flexibility in parameter types.Improvements