Set shared source-data fields (e.g. SpikeGLX stream) once in multi-session Locate Data - #1086
Merged
Conversation
On the multi-session Locate Data (path expansion) page, expose each interface's required non-path source-data fields (e.g. the SpikeGLX stream_id) alongside base_directory / format_string_path, so they can be entered once for every located session instead of per session on the Source Data page. The values are written to the project.SourceData globals that the Source Data page already applies to each session form, so they auto-fill every session and remain overridable per session, and stay in sync with the "Edit Default Values" editor. The fields are seeded from any existing global default so they round-trip, and are stripped from the neuroconv/locate payload. The field description notes that the value applies to all sessions and can be overridden per session. Closes #1085 Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
There was a problem hiding this comment.
Pull request overview
This PR improves the multi-session “Locate Data” (path expansion) step by surfacing required non-path source-data fields (e.g., SpikeGLX stream_id) on the Locate Data page so users can set shared defaults once, while still allowing per-session overrides later on the Source Data page.
Changes:
- Adds logic to expose required non-path source-data schema properties on the Locate Data form for each interface.
- Routes those shared field values into
project.SourceDatadefaults (and strips them from theneuroconv/locatepayload). - Seeds the Locate Data form from existing
project.SourceDatadefaults so values round-trip.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
The strip loop deleted the shared props from a shallow copy of the structure entry, so globalState.structure.results kept a copy of its own and persisted it to the progress file. Since #initialize aliases localState.results to that persisted object, the seeding guard in render never applied the value from project.SourceData: a default edited via Edit Default Values showed stale on Locate Data and was reverted on the next save of that page. Delete the prop from the persisted structure too, so render re-seeds from project.SourceData on every page load. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
pauladkisson
approved these changes
Jul 23, 2026
pauladkisson
left a comment
Collaborator
There was a problem hiding this comment.
I confirmed that this works on my end. Sorry for the delay.
Collaborator
Author
|
All good. Thank you for the review! |
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Motivation
In the multi-session conversion workflow, interfaces with a required non-path source-data field (most visibly the SpikeGLX
stream_id) required entering that field separately for every located session on the Source Data page. Since the value is almost always identical across sessions, this is tedious and error prone.Closes #1085.
Change
On the Locate Data (path expansion) page, each interface's required non-path source-data fields are now shown alongside
base_directory/format_string_path, so they can be set once for all sessions.project.SourceDataglobals that the Source Data page already applies to every session form, so they auto-fill each session and remain overridable per session. The existing Edit Default Values editor stays as the fallback for the non-locate_datapath.project.SourceDatais the only store for these values.beforeSavedrops them from the persistedstructure.resultsentry as well as from theneuroconv/locatepayload (which rejects unknown props), andrenderseeds the form fromproject.SourceDataon every page load, so a default edited from either page round-trips.Affected interfaces
The change is generic (any required, non-path field). Currently that surfaces:
SpikeGLXRecordingInterfacestream_idTdtRecordingInterfacegainExtractSegmentationInterfacesampling_frequencyBrukerTiffMultiPlaneConverterplane_separation_typedisjoint/contiguous)All four are already shown per-session today, so this only changes where they can be set, not whether they are exposed.
Testing
beforeSaverouting logic with a standalone simulation (field added only for required non-path props, path props not duplicated, optional props excluded, shared schema not mutated, seeding from globals, local value not clobbered, routing toproject.SourceData, stripping from the locate payload, file-vs-folder derivation, clearing a value, empty-format-string skip).render()andbeforeSave()through the cross-page round trip (set the field on Locate Data, change it via Edit Default Values, revisit Locate Data, save again) to confirm the edited default is displayed and is not reverted.npm run test:apppasses (91 tests).🤖 Generated with Claude Code