Skip to content

ui: add "Add New (copy settings)" button and initialdir support for file browser - #15

Draft
akhanf with Copilot wants to merge 2 commits into
mainfrom
copilot/add-new-copy-settings-button
Draft

ui: add "Add New (copy settings)" button and initialdir support for file browser#15
akhanf with Copilot wants to merge 2 commits into
mainfrom
copilot/add-new-copy-settings-button

Conversation

Copilot AI commented Jul 12, 2026

Copy link
Copy Markdown
Contributor

When adding multiple scans that share most settings (orientation, staining, session, etc.), users had to re-enter everything for each new scan. The file browser also always opened to the OS default directory instead of the last-used path.

Changes

  • _browse_for_file(initialdir=None) — passes initialdir to tkinter.filedialog.askopenfilename; updated on each successful selection so subsequent Browse clicks open the same folder
  • _render_scan_entry(..., *, copy_settings=None) — pre-populates session-state widget keys for orientation, sample, session, acquisition, and stain channels from copy_settings on first render; also seeds initialdir from the source path's parent directory
  • "➕ Add New (copy settings)" button — captures all fields from the last scan except spim_path and subject, stores them as _copy_settings_{new_id} in session state, then appends the new scan and reruns; disabled when no scans exist
  • non_empty_rows filtering — strips _-prefixed internal keys (e.g. _staining_channels_raw) before passing rows to validators/generators

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.

2 participants