Skip to content

fix: Submit/confirm prediction button disabled state#6989

Merged
dwesolow merged 2 commits into
developfrom
dwesolow/fix-submit-button-state
Jul 8, 2026
Merged

fix: Submit/confirm prediction button disabled state#6989
dwesolow merged 2 commits into
developfrom
dwesolow/fix-submit-button-state

Conversation

@dwesolow

@dwesolow dwesolow commented Jul 7, 2026

Copy link
Copy Markdown
Contributor

Summary

  1. The issue is that mapLocalAnnotationsToServer don't include confidences: null when there is no confidence - causing isEqual to be true.
  2. One minor issue that when annotation is invalid but subset is changed user is allowed to submit.

How to test

Checklist

  • The PR title and description are clear and descriptive
  • I have manually tested the changes
  • All changes are covered by automated tests
  • All related issues are linked to this PR (if applicable)
  • Documentation has been updated (if applicable)

@dwesolow dwesolow requested a review from a team as a code owner July 7, 2026 11:21
Copilot AI review requested due to automatic review settings July 7, 2026 11:21
@github-actions github-actions Bot added the Geti UI Issues related to Geti application frontend label Jul 7, 2026
@github-actions

github-actions Bot commented Jul 7, 2026

Copy link
Copy Markdown

⏱️ Backend import time — app.main

Accelerator Cumulative (s) Self (s)
cpu 4.104 0.003
xpu 4.394 0.003
cuda 4.630 0.003

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Fixes an annotator submit/confirm button disabled-state regression in the UI by ensuring annotation “confidence” data is normalized consistently between server DTOs and local models, and by tightening the submit-disable logic when annotations are invalid.

Changes:

  • Normalize mapLocalAnnotationsToServer to always include confidences (as null when absent) to avoid false “changed” comparisons.
  • Add unit/regression tests covering confidence round-tripping and canSubmit behavior on initial load.
  • Centralize submit-disable logic in getIsSubmitDisabled, preventing submission when annotations are invalid even if subset selection changes.

Reviewed changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated no comments.

Show a summary per file
File Description
application/ui/src/shared/annotator/annotation-mappers.ts Always emits confidences (null when no probabilities) to match backend DTO shape and stabilize equality checks.
application/ui/src/shared/annotator/annotation-mappers.test.ts Adds unit tests for confidence mapping and DTO round-trip equality (new test file).
application/ui/src/shared/annotator/annotation-actions-provider.test.tsx Adds regression coverage for canSubmit on initial load when server annotations include confidences: null.
application/ui/src/features/dataset/media-preview/secondary-toolbar/util.ts Introduces getIsSubmitDisabled to encapsulate submit-disable rules across modes and invalid states.
application/ui/src/features/dataset/media-preview/secondary-toolbar/util.test.ts Adds unit tests validating getIsSubmitDisabled behavior for annotation vs prediction modes and saving/loading flags.
application/ui/src/features/dataset/media-preview/secondary-toolbar/secondary-toolbar.component.tsx Switches submit-disable computation to getIsSubmitDisabled and includes invalid-annotation signal from actions provider.

@github-actions

github-actions Bot commented Jul 7, 2026

Copy link
Copy Markdown

📊 Test coverage report

Metric Coverage
Lines 60.2%
Functions 56.9%
Branches 51.8%
Statements 59.8%

@github-actions

github-actions Bot commented Jul 7, 2026

Copy link
Copy Markdown

🐳 Docker image sizes

Device Size
cpu 4002.9 MB (3.91 GB)
xpu 10791.5 MB (10.54 GB)
cuda 10198.1 MB (9.96 GB)


// If annotations are not changed but subset has changed we want to allow user to submit
const isSubmitDisabled = (!canSubmit && !hasSubsetChanged) || isSaving || isLoadingPredictions;
const isSubmitDisabled = getIsSubmitDisabled({

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why not useIsSubmitDisabled and call useAnnotationActions there since here we're just passing them around from 1 hook to an util

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No strong reason, we still need to call useAnnotationActions to get submitAnnotations, submitPredictions, initialAnnotations, initialPredictions. But we can move to hook itself as well if you find it better.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeah i know, but here the method is just used as a bridge, we can just get it directly if it becomes a hook

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated, thanks

@dwesolow dwesolow enabled auto-merge July 8, 2026 13:39
@dwesolow dwesolow added this pull request to the merge queue Jul 8, 2026
Merged via the queue into develop with commit f637e74 Jul 8, 2026
37 checks passed
@dwesolow dwesolow deleted the dwesolow/fix-submit-button-state branch July 8, 2026 13:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Geti UI Issues related to Geti application frontend

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants