From 44eed683de3aae32cff6a2f9db310a4af4e97b07 Mon Sep 17 00:00:00 2001 From: Luke Schreiber <131496683+Luke-Schreiber@users.noreply.github.com> Date: Tue, 3 Mar 2026 14:44:45 -0700 Subject: [PATCH 1/2] Add experiment selector folder tree support --- .../globalSettings/DatasetSelector.vue | 409 +++++++++++++++++- apps/client/src/util/experimentTree.ts | 146 +++++++ 2 files changed, 534 insertions(+), 21 deletions(-) create mode 100644 apps/client/src/util/experimentTree.ts diff --git a/apps/client/src/components/globalSettings/DatasetSelector.vue b/apps/client/src/components/globalSettings/DatasetSelector.vue index c3587427..f8e06cf9 100644 --- a/apps/client/src/components/globalSettings/DatasetSelector.vue +++ b/apps/client/src/components/globalSettings/DatasetSelector.vue @@ -9,6 +9,13 @@ import { useSelectionStore } from '@/stores/interactionStores/selectionStore'; import { useMosaicSelectionStore } from '@/stores/dataStores/mosaicSelectionStore'; import { useConditionSelectorStore } from '@/stores/componentStores/conditionSelectorStore'; +import { + buildExperimentTree, + type TreeNode, + type FolderNode, + type ExperimentNode, +} from '@/util/experimentTree'; + const globalSettings = useGlobalSettings(); const datasetSelectionStore = useDatasetSelectionStore(); const datasetSelectionTrrackedStore = useDatasetSelectionTrrackedStore(); @@ -18,6 +25,8 @@ const selectionStore = useSelectionStore(); const mosaicSelectionStore = useMosaicSelectionStore(); const conditionSelectorStore = useConditionSelectorStore(); +const menuRef = ref(null); + watch( () => datasetSelectionStore.fetchingTabularData, () => { @@ -40,8 +49,10 @@ const shortExpName = computed(() => { return datasetSelectionStore.currentExperimentMetadata.name; } let shortName = datasetSelectionTrrackedStore.currentExperimentFilename; - if (shortName === null) return ''; - shortName = shortName.split('.')[0]; + if (shortName === null) return 'Select Experiment'; + // Extract just the filename from path + const parts = shortName.split('/'); + shortName = parts[parts.length - 1].split('.')[0]; const maxChar = 24; if (shortName.length > maxChar) { shortName = shortName.slice(0, maxChar) + '...'; @@ -49,6 +60,18 @@ const shortExpName = computed(() => { return shortName; }); +const treeOptions = computed(() => { + const list = datasetSelectionStore.experimentFilenameList; + if (!list || list.length === 0) return []; + return buildExperimentTree(list); +}); + +function selectExperiment(path: string) { + datasetSelectionTrrackedStore.currentExperimentFilename = path; + onSelectExperiment(); + menuRef.value?.hide(); +} + function onSelectExperiment() { selectionStore.resetState(); mosaicSelectionStore.resetState(); @@ -57,24 +80,232 @@ function onSelectExperiment() {