diff --git a/client/platform/desktop/frontend/components/NavigationBar.vue b/client/platform/desktop/frontend/components/NavigationBar.vue index 04ff20a0e..84ce5b306 100644 --- a/client/platform/desktop/frontend/components/NavigationBar.vue +++ b/client/platform/desktop/frontend/components/NavigationBar.vue @@ -1,6 +1,7 @@ @@ -21,6 +25,13 @@ export default defineComponent({ style="flex-basis:0; flex-grow:0;" color="accent" > + + Resumemdi-history + Librarymdi-folder-open diff --git a/client/platform/desktop/frontend/components/ViewerLoader.vue b/client/platform/desktop/frontend/components/ViewerLoader.vue index 56eaef38b..b4e4c932c 100644 --- a/client/platform/desktop/frontend/components/ViewerLoader.vue +++ b/client/platform/desktop/frontend/components/ViewerLoader.vue @@ -41,7 +41,7 @@ import { import Export from './Export.vue'; import JobTab from './JobTab.vue'; import DatasetSourceInfo from './DatasetSourceInfo.vue'; -import { datasets } from '../store/dataset'; +import { datasets, rememberAnnotation } from '../store/dataset'; import { settings } from '../store/settings'; import { runningJobs } from '../store/jobs'; import { setCloseGuard } from '../store/closeGuard'; @@ -935,6 +935,17 @@ export default defineComponent({ // is deferred to the viewer-ready watcher below instead. watch(stereoServiceWanted, (enabled) => requestStereoServiceState(enabled, true)); + watch( + () => viewerRef.value?.progress?.loaded === true, + (loaded) => { + // Read-only scoring previews should not replace the last editing sequence. + if (loaded && !scoringPreviewFile.value) { + rememberAnnotation(props.id); + } + }, + { immediate: true }, + ); + // Load-time auto-enable of a remembered setting: run once the viewer has // actually finished loading the dataset (progress.loaded), so the metadata // and calibration the enable needs are available. One-shot -- stop after the diff --git a/client/platform/desktop/frontend/store/dataset.ts b/client/platform/desktop/frontend/store/dataset.ts index 6ad79e32f..0ddd5e259 100644 --- a/client/platform/desktop/frontend/store/dataset.ts +++ b/client/platform/desktop/frontend/store/dataset.ts @@ -45,6 +45,16 @@ function hydrateJsonConfigCacheValue(input: any): JsonConfigCache { const datasets = ref({} as Record); +// Remember annotation navigation separately from library selections and jobs. +const lastAnnotationId = ref(null); +const lastAnnotation = computed(() => ( + lastAnnotationId.value ? datasets.value[lastAnnotationId.value] : undefined +)); + +function rememberAnnotation(datasetId: string) { + lastAnnotationId.value = datasetId; +} + const recents = computed(() => (Object.values(datasets.value))); function setRecents(meta: JsonConfig, accessTime?: string) { @@ -70,6 +80,7 @@ function setRecents(meta: JsonConfig, accessTime?: string) { } function clearRecents() { + lastAnnotationId.value = null; datasets.value = {}; window.localStorage.setItem(RecentsKey, JSON.stringify([])); } @@ -136,6 +147,9 @@ function locateDuplicates(meta: JsonConfig) { } function removeRecents(datasetId: string) { + if (lastAnnotationId.value === datasetId) { + lastAnnotationId.value = null; + } if (datasets.value[datasetId]) { Vue.delete(datasets.value, datasetId); } @@ -144,6 +158,8 @@ function removeRecents(datasetId: string) { } export { + lastAnnotation, + rememberAnnotation, datasets, recents, autoDiscover,