Skip to content

Set shared source-data fields (e.g. SpikeGLX stream) once in multi-session Locate Data - #1086

Merged
rly merged 4 commits into
mainfrom
feature/multisession-shared-stream
Jul 23, 2026
Merged

Set shared source-data fields (e.g. SpikeGLX stream) once in multi-session Locate Data#1086
rly merged 4 commits into
mainfrom
feature/multisession-shared-stream

Conversation

@rly

@rly rly commented Jul 15, 2026

Copy link
Copy Markdown
Collaborator

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.

  • The values are written to the project.SourceData globals 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_data path.
  • project.SourceData is the only store for these values. beforeSave drops them from the persisted structure.results entry as well as from the neuroconv/locate payload (which rejects unknown props), and render seeds the form from project.SourceData on every page load, so a default edited from either page round-trips.
  • The field description notes the value applies to all sessions and can be overridden per session.

Affected interfaces

The change is generic (any required, non-path field). Currently that surfaces:

Interface Field Type
SpikeGLXRecordingInterface stream_id string
TdtRecordingInterface gain number
ExtractSegmentationInterface sampling_frequency number
BrukerTiffMultiPlaneConverter plane_separation_type enum (disjoint/contiguous)

All four are already shown per-session today, so this only changes where they can be set, not whether they are exposed.

Testing

  • Launched the app locally (Electron + Flask) to exercise the multi-session SpikeGLX flow.
  • Validated the render-seeding and beforeSave routing 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 to project.SourceData, stripping from the locate payload, file-vs-folder derivation, clearing a value, empty-format-string skip).
  • Exercised the real render() and beforeSave() 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:app passes (91 tests).

🤖 Generated with Claude Code

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>

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.SourceData defaults (and strips them from the neuroconv/locate payload).
  • Seeds the Locate Data form from existing project.SourceData defaults so values round-trip.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

rly and others added 2 commits July 16, 2026 13:51
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 pauladkisson left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I confirmed that this works on my end. Sorry for the delay.

@rly

rly commented Jul 23, 2026

Copy link
Copy Markdown
Collaborator Author

All good. Thank you for the review!

@rly
rly merged commit cb9c613 into main Jul 23, 2026
27 checks passed
@rly
rly deleted the feature/multisession-shared-stream branch July 23, 2026 16:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Multi-session: allow specifying the SpikeGLX stream once for all sessions

3 participants