Skip to content

fix: LEAP-2064: Choices on imported annotations are not displayed in View All on initial load #7488

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

Merged
merged 4 commits into from
May 8, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 20 additions & 2 deletions web/libs/editor/src/stores/Annotation/store.js
Original file line number Diff line number Diff line change
Expand Up @@ -68,8 +68,26 @@ const AnnotationStoreModel = types
self.selected.selected = false;
}

self.annotations.forEach((c) => {
c.editable = false;
// When FF_SIMPLE_INIT is enabled, we need to ensure all tags have their results set from the annotations.
// This process is normally done via selecting explicitly all annotations but, when the flag is enabled, it is
// skipped in AppStore::initializeStore to enforcing better performance.
// The byproduct of this performance improvement is that we do not update the objects with their corresponding
// results and, when entering the ViewAll mode, we can only see the results updated for the previously selected
// annotation but not the rest of them.
// This fix aims to mimic the behaviour of selectAnnotation when it comes to updating the objects only without
// actually executing the full process of selecting the annotation.
if (isFF(FF_SIMPLE_INIT)) {
[...self.predictions, ...self.annotations].forEach((a) => {
// Skip the current annotation as it's already handled
if (a === self.selected) return;

// Set results for each annotation without selecting it
a.updateObjects();
});
}

self.annotations.forEach((a) => {
a.editable = false;
});
} else {
selectAnnotation(self.annotations.at(isFF(FF_SIMPLE_INIT) ? -1 : 0).id, { fromViewAll: true });
Expand Down
10 changes: 9 additions & 1 deletion web/libs/editor/src/tags/control/Choice/Choice.scss
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ body :global(.ant-checkbox-wrapper) {

body :global(.ant-checkbox .ant-checkbox-inner) {
background-color: var(--color-neutral-surface);
border-color: var(--color-neutral-border);
border-color: var(--color-neutral-border) !important;
}

body :global(.ant-checkbox-checked .ant-checkbox-inner) {
Expand All @@ -89,3 +89,11 @@ body :global(.ant-checkbox-checked)::after {
:global(.ant-checkbox-wrapper span + span) {
color: var(--color-neutral-content);
}

body :global(.ant-checkbox-disabled .ant-checkbox-inner) {
background-color: var(--color-neutral-background);
}

body :global(.ant-checkbox-disabled.ant-checkbox-checked .ant-checkbox-inner::after) {
border-color: var(--color-neutral-content-subtlest);
}
Loading