Closed eatyourgreens closed 2 years ago
This is fixed in the Classifier
component, so that classifications are preserved when the locale
prop changes, but I think it still needs checking in the project app's Classify page. Work in progress will still be lost if the classifier unmounts and mounts when the page language changes.
I'm opening this again. It's fixed in the standalone classifier, but not in the project app, where navigating between different Classify pages unmounts and mounts the classifier, which can reset the store for some projects.
Package
app-project lib-classifier
Describe the bug
Client-side page transitions should preserve classifications in the global classifier store. However, if I use the drop-down language menu to navigate from
/projects/nora-dot-eisner/planet-hunters-tess/classify/workflow/11235
to/projects/fr/nora-dot-eisner/planet-hunters-tess/classify/workflow/11235
(the Classify workflow page in French), the classifier deletes my annotations and starts a new classification.To Reproduce
LocaleSwitcher
in theProjectHeader
component.yarn build && yarn start:dev
.Expected behavior
A locale change should refresh the classifier, but otherwise shouldn't change the global store state.
Additional context
The underlying cause is this effect hook, which starts a new classification if the workflow version changes. It runs when the classifier loads but doesn't check if
workflowVersion
already matchesclassifierStore.workflows.active?.version
. https://github.com/zooniverse/front-end-monorepo/blob/ad72d0134822990e0a5d483af7489b0c4db4977d/packages/lib-classifier/src/components/Classifier/Classifier.js#L64-L79