Skip to content

Fix saving picks breaking picking - #11

Closed
boriskaus wants to merge 1 commit into
mainfrom
fix-save-picks
Closed

boriskaus wants to merge 1 commit into
mainfrom
fix-save-picks

Conversation

@boriskaus

Copy link
Copy Markdown
Member

This contains only the src changes from #10, so that they can go into main before the workshop. It doesn't include the tests or CI.

Bug fix

Save Picks... assigned the NamedTuple it saves to picks, the name of the global Observable that holds the picks. After saving once:

  • you could no longer add or drag picks with the mouse (picks[] fails on a NamedTuple)
  • Load Picks... failed without any message, because the error happens inside an @async task

Only restarting the GUI helped. The fix renames the variable to pick_data. The saved jld2 file is unchanged: it still has the keys picks, pick_info and profile_info.

File dialog hook

The native file dialogs are now called through PICK_FILE[] / SAVE_FILE[]. By default these are pick_file / save_file, so nothing changes for users. The tests in #10 swap them for functions that return a fixed filename.

Testing

The tests in #10 run exactly this code, and they pass on Julia 1.10, 1.11, 1.12 and the latest release on Linux, Windows and macOS. On macOS only the loading checks run.

🤖 Generated with Claude Code

- "Save Picks..." assigned the saved NamedTuple to `picks`, overwriting the
  global Observable used for picking. After saving once, adding/dragging picks
  and "Load Picks..." no longer worked until the GUI was restarted.
- the native file dialogs are called through the PICK_FILE/SAVE_FILE Refs, so
  that tests can replace them. By default they are pick_file/save_file.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@boriskaus

Copy link
Copy Markdown
Member Author

Closing: these changes are already in main via #10.

@boriskaus boriskaus closed this Sep 25, 2026
@boriskaus
boriskaus deleted the fix-save-picks branch September 25, 2026 08:29
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.

1 participant