Show LabelBOT popup despite no suggestions#1478
Open
gkourie wants to merge 9 commits into
Open
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR changes LabelBOT’s empty-result behavior so annotations can still be created when no suggestions are found, then prompts the user to manually choose a label or dismiss the temporary annotation.
Changes:
- Backend LabelBOT now returns an empty label list instead of throwing a 404.
- Image/video annotation creation can save annotations without immediately attaching a label.
- LabelBOT popup now displays an empty-suggestions message and supports manual label selection/deletion flow.
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
app/Services/LabelBot/LabelBotService.php |
Returns an empty suggestion array when no similar labels are found. |
app/Http/Controllers/Api/ImageAnnotationController.php |
Skips label authorization/attachment when no label is available. |
app/Http/Controllers/Api/VideoAnnotationController.php |
Mirrors the image annotation empty-label persistence behavior. |
resources/assets/js/annotations/components/labelbotPopup.vue |
Adds no-suggestions UI and temporary annotation deletion behavior. |
resources/assets/js/annotations/annotatorContainer.vue |
Refreshes annotations after manually attaching a label when no previous label existed. |
resources/assets/sass/annotations/components/_labelbot-popup.scss |
Adds styling for the no-suggestions popup message. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
199
to
201
| if (!this.selectedLabel || this.selectedLabel.id !== label.id) { | ||
| this.dismissLabelbotAnnotation = false; | ||
| this.$emit('update', {label: label, annotation: this.annotation}); |
Comment on lines
+456
to
+457
| if (this.noLabels && this.dismissLabelbotAnnotation) { | ||
| this.deleteLabelAnnotation(); |
|
|
||
| if (empty($topNLabels)) { | ||
| throw new NotFoundHttpException("LabelBOT could not find similar annotations."); | ||
| return []; |
| $response->assertSuccessful(); | ||
|
|
||
| // We expect an empty array | ||
| $response->assertJsonFragment([]); |
Comment on lines
+207
to
+209
| this.emitClose(); | ||
| Events.emit('labelbot.chose_label_1'); | ||
| if (this.noLabels) { | ||
| this.deleteLabelAnnotation(); |
Comment on lines
+456
to
+457
| if (this.noLabels && this.deletePendingLabelbotAnnotation) { | ||
| this.deleteLabelAnnotation(); |
Comment on lines
+250
to
+256
| if ($label) { | ||
| VideoAnnotationLabel::create([ | ||
| 'label_id' => $label->id, | ||
| 'user_id' => $request->user()->id, | ||
| 'annotation_id' => $annotation->id, | ||
| ]); | ||
| } |
Member
|
Please request my review again once you are through with the AI. |
Contributor
Author
|
@mzur While trying to implement this for videos, I found some other issues:
Screencast.from.2026-06-02.13-58-18.webm
Screencast.from.2026-06-02.14-04-56.webmOr was that intentional for 2 ? Otherwise, I could try to fix it here. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
When LabelBOT returns no suggestions, an empty array will be sent to the front end. The LabelBOT popup will show a message to type a label in the typeahead. For now the temp annotation will be saved in the database without a label and it will have the editing style in the front end until it's confirmed with a label, if not then it will be deleted.