Skip to content

Pointlayer autosave#1069

Open
Teranis wants to merge 4 commits intomainfrom
pointlayer-autosave
Open

Pointlayer autosave#1069
Teranis wants to merge 4 commits intomainfrom
pointlayer-autosave

Conversation

@Teranis
Copy link
Copy Markdown
Member

@Teranis Teranis commented Apr 3, 2026

  • Fix typo "acoid" → "avoid" in comment at gui.py line 23801
  • Use posData.recoveryFolderpath() in savePointsAddedByClickingFromEndname to ensure recovery folder exists before writing
  • Fix loadClickEntryDfs to check file existence before pd.read_csv and only use recovery file when it exists and is actually newer than the main file

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Adds autosave + recovery loading support for “click-entry” point layers and adjusts UI behavior for single-frame (snapshot) datasets.

Changes:

  • Track “dirty” point-layer tables and autosave them into the recovery/ folder on the main autosave cadence and on position switches.
  • Prompt to load a newer recovery CSV for point layers when it’s newer than the main CSV.
  • Guard points-layer DataFrame conversion when a position has no points data; hide/disable delNewObjAction in snapshot mode.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.

File Description
cellacdc/gui.py Implements dirty tracking + autosave flush for point layers, recovery/newer-file prompt flow, and snapshot-mode UI changes.
cellacdc/widgets.py Prevents crash when converting point-layer actions to DataFrame if current position is missing in action.pointsData.
Comments suppressed due to low confidence (1)

cellacdc/gui.py:19740

  • In snapshot mode delNewObjAction is hidden/disabled, but in the else branch it is never restored. Switching from snapshot back to other modes will leave the action permanently hidden/disabled until restart. Please re-enable and show it in the non-snapshot branch.

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

Agent-Logs-Url: https://github.com/SchmollerLab/Cell_ACDC/sessions/e130e0da-6862-4494-b26c-da092b0027a6

Co-authored-by: Teranis <33847528+Teranis@users.noreply.github.com>
@Teranis
Copy link
Copy Markdown
Member Author

Teranis commented Apr 3, 2026

It could be a good idea to add the whole saving routine to the autosaver worker, but saving is so fast that I didn't bother 🙃

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.


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

Comment on lines +19729 to +19730
self.delNewObjAction.setVisible(False)
self.delNewObjAction.setDisabled(True)
Copy link

Copilot AI Apr 3, 2026

Choose a reason for hiding this comment

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

setFramesSnapshotMode disables/hides delNewObjAction when entering Snapshot mode, but the else branch (leaving Snapshot mode) does not re-enable/show it. This will leave the action permanently disabled/hidden after toggling back to Viewer. Please restore symmetric setVisible(True)/setDisabled(False) in the non-snapshot branch.

Copilot uses AI. Check for mistakes.
Comment on lines +24118 to +24121
filepath, _ = self.getClickEntryTableFilepaths(posData, tableEndName)
if os.path.exists(filepath):
doesTableExists = True
break
Copy link

Copilot AI Apr 3, 2026

Choose a reason for hiding this comment

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

checkClickEntryTableEndnameExists now only considers the main table path (filepath) when deciding whether a table exists. With the new recovery autosave flow, it's possible for only the recovery file to exist (e.g., user never manually saved, or main file was deleted), in which case this function returns early and prevents loading/recovering points. Consider treating an existing recovery table as “table exists” too (e.g., check recovery_filepath from getClickEntryTableFilepaths), and then let loadClickEntryDfs decide which file to load.

Copilot uses AI. Check for mistakes.
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.

3 participants