Skip to content
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
11 changes: 11 additions & 0 deletions client/platform/desktop/frontend/components/NavigationBar.vue
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
<script>
import { defineComponent } from 'vue';
import JobTab from './JobTab.vue';
import { lastAnnotation } from '../store/dataset';

export default defineComponent({
components: { JobTab },
Expand All @@ -10,6 +11,9 @@ export default defineComponent({
default: 'DIVE',
},
},
setup() {
return { lastAnnotation };
},
});
</script>

Expand All @@ -21,6 +25,13 @@ export default defineComponent({
style="flex-basis:0; flex-grow:0;"
color="accent"
>
<v-tab
v-if="lastAnnotation"
:to="{ name: 'viewer', params: { id: lastAnnotation.id } }"
:title="`Resume editing ${lastAnnotation.name}`"
>
Resume<v-icon>mdi-history</v-icon>
</v-tab>
<v-tab :to="{ name: 'recent' }">
Library<v-icon>mdi-folder-open</v-icon>
</v-tab>
Expand Down
13 changes: 12 additions & 1 deletion client/platform/desktop/frontend/components/ViewerLoader.vue
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down Expand Up @@ -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
Expand Down
16 changes: 16 additions & 0 deletions client/platform/desktop/frontend/store/dataset.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,16 @@ function hydrateJsonConfigCacheValue(input: any): JsonConfigCache {

const datasets = ref({} as Record<string, JsonConfigCache>);

// Remember annotation navigation separately from library selections and jobs.
const lastAnnotationId = ref<string | null>(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) {
Expand All @@ -70,6 +80,7 @@ function setRecents(meta: JsonConfig, accessTime?: string) {
}

function clearRecents() {
lastAnnotationId.value = null;
datasets.value = {};
window.localStorage.setItem(RecentsKey, JSON.stringify([]));
}
Expand Down Expand Up @@ -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);
}
Expand All @@ -144,6 +158,8 @@ function removeRecents(datasetId: string) {
}

export {
lastAnnotation,
rememberAnnotation,
datasets,
recents,
autoDiscover,
Expand Down
Loading