Skip to content

Unfinished polygon submit button#9587

Closed
AndrejOros wants to merge 2 commits intodevelopfrom
fb-unfinished-polygon-submit-button-b8d0
Closed

Unfinished polygon submit button#9587
AndrejOros wants to merge 2 commits intodevelopfrom
fb-unfinished-polygon-submit-button-b8d0

Conversation

@AndrejOros
Copy link
Copy Markdown
Contributor

Reason for change

Previously, users could submit, update, or accept an annotation even if it contained an unfinished polygon region. This PR disables the "Submit", "Update", and "Fix & Accept" buttons when an annotation has any incomplete polygon regions, preventing premature submission of incomplete work.

Screenshots

No direct UI layout changes. Verification involves observing button disabled states and tooltips.

Rollout strategy

Standard deployment. No feature flags or environment variables are needed.

Testing

  1. Create an incomplete polygon:
    • Navigate to an annotation task.
    • Start drawing a polygon region but do not close it (leave it with an open path).
  2. Verify button states:
    • Observe the "Submit", "Update", and "Fix & Accept" buttons in the BottomBar. They should be disabled.
    • Hover over the disabled buttons. A tooltip stating "Complete all regions before submitting/accepting" should appear.
  3. Complete the polygon:
    • Close the polygon region.
  4. Verify button states again:
    • The "Submit", "Update", and "Fix & Accept" buttons should now be enabled.
  5. Test with other region types:
    • Ensure that creating other region types (e.g., bounding box) does not disable the buttons unless a polygon is also incomplete.

Risks

Low risk. The changes are localized to the Annotation model and the active BottomBar UI components. Legacy UI components were explicitly reverted to ensure minimal impact.

Reviewer notes

  • web/libs/editor/src/stores/Annotation/Annotation.js: A new computed view hasIncompleteRegions was added. This view iterates over self.areas and checks for the incomplete property. Only PolygonRegion and VectorRegion define incomplete, ensuring other region types do not trigger this logic.
  • web/libs/editor/src/components/BottomBar/Controls.tsx: The isDisabled logic for the "Submit" and "Update" buttons (and their dropdown variants) now includes annotation.hasIncompleteRegions. Tooltips are updated accordingly.
  • web/libs/editor/src/components/BottomBar/buttons.tsx: The AcceptButton component now checks annotation.hasIncompleteRegions to determine its disabled state and tooltip.

General notes

This fix is intentionally scoped to only the active BottomBar UI and the Annotation model. No changes were made to legacy UI components or other button types (e.g., Skip, Reject) to keep the impact as minimal and targeted as possible.

Open in Web Open in Cursor 

… are unfinished

Add hasIncompleteRegions computed view to Annotation model that checks
if any areas have incomplete property set (unclosed polygons/vectors).

Use this flag in the BottomBar Controls to disable Submit, Update, and
Accept buttons when incomplete regions exist, with appropriate tooltips
explaining why the buttons are disabled.

Co-authored-by: AndrejOros <AndrejOros@users.noreply.github.com>
@cursor
Copy link
Copy Markdown

cursor bot commented Mar 11, 2026

Cursor Agent can help with this pull request. Just @cursor in comments and I'll start working on changes in this branch.
Learn more about Cursor Agents

@netlify
Copy link
Copy Markdown

netlify bot commented Mar 11, 2026

Deploy Preview for label-studio-storybook ready!

Name Link
🔨 Latest commit 728280d
🔍 Latest deploy log https://app.netlify.com/projects/label-studio-storybook/deploys/69b13f9e02f5e60008dce806
😎 Deploy Preview https://deploy-preview-9587--label-studio-storybook.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@netlify
Copy link
Copy Markdown

netlify bot commented Mar 11, 2026

Deploy Preview for label-studio-docs-new-theme canceled.

Name Link
🔨 Latest commit 728280d
🔍 Latest deploy log https://app.netlify.com/projects/label-studio-docs-new-theme/deploys/69b13f9e65660d0008befc1b

@netlify
Copy link
Copy Markdown

netlify bot commented Mar 11, 2026

Deploy Preview for label-studio-playground ready!

Name Link
🔨 Latest commit 728280d
🔍 Latest deploy log https://app.netlify.com/projects/label-studio-playground/deploys/69b13f9fcc378d0008cfc29e
😎 Deploy Preview https://deploy-preview-9587--label-studio-playground.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@codecov
Copy link
Copy Markdown

codecov bot commented Mar 11, 2026

Codecov Report

❌ Patch coverage is 64.28571% with 10 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
.../libs/editor/src/components/BottomBar/Controls.tsx 70.58% 5 Missing ⚠️
...b/libs/editor/src/components/BottomBar/buttons.tsx 0.00% 5 Missing ⚠️

📢 Thoughts on this report? Let us know!

Add early return guard for hasIncompleteRegions in the annotation:submit
hotkey handler, which covers Submit, Update, and Accept actions.

Co-authored-by: AndrejOros <AndrejOros@users.noreply.github.com>
@netlify
Copy link
Copy Markdown

netlify bot commented Mar 11, 2026

Deploy Preview for heartex-docs failed. Why did it fail? →

Name Link
🔨 Latest commit 7a51cc2
🔍 Latest deploy log https://app.netlify.com/projects/heartex-docs/deploys/69b13e65d364b200080f7948

1 similar comment
@netlify
Copy link
Copy Markdown

netlify bot commented Mar 11, 2026

Deploy Preview for heartex-docs failed. Why did it fail? →

Name Link
🔨 Latest commit 7a51cc2
🔍 Latest deploy log https://app.netlify.com/projects/heartex-docs/deploys/69b13e65d364b200080f7948

@netlify
Copy link
Copy Markdown

netlify bot commented Mar 11, 2026

Deploy Preview for heartex-docs canceled.

Name Link
🔨 Latest commit 728280d
🔍 Latest deploy log https://app.netlify.com/projects/heartex-docs/deploys/69b13f9e1d2e48000884a51d

@farioas farioas closed this Mar 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants