-
Notifications
You must be signed in to change notification settings - Fork 45
Extract edit bounding box (Part 2) #1158
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
base: main
Are you sure you want to change the base?
Conversation
...packages/smart-tools/src/edit-bounding-box/edit-bounding-box/edit-bounding-box.component.tsx
Show resolved
Hide resolved
updateAnnotation={(newAnnotation) => { | ||
scene.updateAnnotation({ | ||
...newAnnotation, | ||
shape: convertToolShapeToGetiShape(newAnnotation.shape), |
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.
👍🏼
web_ui/src/pages/annotator/tools/edit-tool/edit-annotation-tool.component.tsx
Show resolved
Hide resolved
5a8e03e
to
1fd6218
Compare
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.
Pull Request Overview
This PR refactors the edit bounding box functionality by extracting components and utilities into a new smart-tools package structure. The refactoring aims to improve code organization and reusability without breaking existing functionality.
- Extracted edit bounding box tool and translate shape component to the smart-tools package
- Moved utility functions (allowPanning, getBoundingBoxResizePoints, etc.) to centralized locations
- Updated import paths and removed duplicate code across the codebase
Reviewed Changes
Copilot reviewed 24 out of 25 changed files in this pull request and generated 2 comments.
Show a summary per file
File | Description |
---|---|
drawing-box.component.tsx |
Updated import path for allowPanning utility |
utils.ts |
Removed allowPanning function (moved to smart-tools) |
svg-tool-canvas.component.tsx |
Consolidated imports from smart-tools |
keypoint-tool.component.tsx |
Updated imports for moved utilities and TranslateShape |
edit-tool/utils.ts |
Removed file - utilities moved to smart-tools package |
edit-tool.component.tsx |
Added Labels component rendering with Fragment wrapper |
Multiple edit tool components | Updated to use TranslateShape from smart-tools and render children |
edit-bounding-box.test.tsx |
Updated test imports and shape type references |
edit-annotation-tool.component.tsx |
Integrated smart-tools EditBoundingBox component |
Smart-tools package files | Added new utilities, components, and type definitions |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
web_ui/packages/smart-tools/src/edit-bounding-box/translate-shape.component.tsx
Show resolved
Hide resolved
7f5fe6b
to
b3d2733
Compare
📝 Description
✨ Type of Change
Select the type of change your PR introduces:
🧪 Testing Scenarios
Describe how the changes were tested and how reviewers can test them too:
✅ Checklist
Before submitting the PR, ensure the following: