You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In the Data Manager grid, the Annotation Results column renders on first load but goes blank for every row after opening a task in the labelling view and navigating back. Any column resize makes the values reappear instantly.
Root cause
The grid store is destroyed on unmount and rebuilt on return, so coming back always refetches the task list. The list serializer emits "" for summary fields the queryset did not evaluate (data_manager/serializers.py_pretty_results), and the frontend setList replaced rendered values with that "" wholesale (web/libs/datamanager/src/mixins/DataStore/DataStore.js). A resize triggers view.save() → list reload with the settled view, which is why values come back. Full chain in #9897 (comment).
Fix
DataStore.setList now consults an optional per-store mergeListItem(existing, incoming) hook (stores without it keep exact previous behavior).
TasksStore.mergeListItem preserves cached annotations_results/predictions_results only when the incoming value is empty (""/null/undefined) and the matching live counter (total_annotations/total_predictions, which exclude cancelled/deleted rows) is positive — provably an unevaluated payload, never a genuine deletion. Zero counters, fresh values, and first loads pass through untouched. Same preservation pattern as the existing user-chip merge in mergeSnapshot.
Tests
DataStore.test.js: hook wiring — lean refetch preserves via hook; behavior unchanged without hook.
__tests__/tasks.test.js: 5 cases for preserveUnevaluatedSummaries (preserve on positive counter, blank on zero counter, fresh values win, no-cache passthrough, missing keys treated as unevaluated).
Run: bun test libs/datamanager/src/mixins/DataStore/DataStore.test.js libs/datamanager/src/stores/DataStores/__tests__/tasks.test.js → 15 pass, 0 fail. Biome check clean on touched files. Backend untouched (ruff/tavern N/A).
Note: Tabs suites in this lib currently fail at import on missing react-router-dom in a bare checkout; verified identical failure without this change (pre-existing env gap, unrelated files).
Acceptance criteria (for QA)
Open a project with annotated tasks, Annotation Results column visible — values render.
Open any task in the labelling view, navigate back to the grid — Annotation Results still shows values, no resize needed.
Delete an annotation so a task has zero annotations, return to the grid — its cell correctly blanks (no stale preservation).
Edit annotation results, return — fresh values display (no stale preservation).
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
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.
Fixes #9897.
Problem
In the Data Manager grid, the Annotation Results column renders on first load but goes blank for every row after opening a task in the labelling view and navigating back. Any column resize makes the values reappear instantly.
Root cause
The grid store is destroyed on unmount and rebuilt on return, so coming back always refetches the task list. The list serializer emits
""for summary fields the queryset did not evaluate (data_manager/serializers.py_pretty_results), and the frontendsetListreplaced rendered values with that""wholesale (web/libs/datamanager/src/mixins/DataStore/DataStore.js). A resize triggersview.save()→ list reload with the settled view, which is why values come back. Full chain in #9897 (comment).Fix
DataStore.setListnow consults an optional per-storemergeListItem(existing, incoming)hook (stores without it keep exact previous behavior).TasksStore.mergeListItempreserves cachedannotations_results/predictions_resultsonly when the incoming value is empty (""/null/undefined) and the matching live counter (total_annotations/total_predictions, which exclude cancelled/deleted rows) is positive — provably an unevaluated payload, never a genuine deletion. Zero counters, fresh values, and first loads pass through untouched. Same preservation pattern as the existing user-chip merge inmergeSnapshot.Tests
DataStore.test.js: hook wiring — lean refetch preserves via hook; behavior unchanged without hook.__tests__/tasks.test.js: 5 cases forpreserveUnevaluatedSummaries(preserve on positive counter, blank on zero counter, fresh values win, no-cache passthrough, missing keys treated as unevaluated).bun test libs/datamanager/src/mixins/DataStore/DataStore.test.js libs/datamanager/src/stores/DataStores/__tests__/tasks.test.js→ 15 pass, 0 fail. Biome check clean on touched files. Backend untouched (ruff/tavern N/A).react-router-domin a bare checkout; verified identical failure without this change (pre-existing env gap, unrelated files).Acceptance criteria (for QA)