Skip to content

Add popups confirming saves and calculation start#33

Merged
Faria22 merged 3 commits intomainfrom
codex/popup_confirmations
Feb 3, 2026
Merged

Add popups confirming saves and calculation start#33
Faria22 merged 3 commits intomainfrom
codex/popup_confirmations

Conversation

@Faria22
Copy link
Owner

@Faria22 Faria22 commented Feb 3, 2026

Summary

  • add success confirmations when forms or scripts are saved and hook them into the close-coupling/time-dependent editors
  • introduce a popup when running notebook scripts and centralize the common save notification helper
  • clean up some string formatting and notebook iteration for clarity

Testing

  • Not run (not requested)

Copilot AI review requested due to automatic review settings February 3, 2026 15:27
@Faria22
Copy link
Owner Author

Faria22 commented Feb 3, 2026

Fixes #26

@Faria22 Faria22 merged commit 875c29e into main Feb 3, 2026
@Faria22 Faria22 deleted the codex/popup_confirmations branch February 3, 2026 15:31
Copy link

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 user-facing popups to confirm successful saves and to notify when a notebook calculation begins running, plus small readability/formatting cleanups.

Changes:

  • Added new popup helpers for “calculation started” and “files saved”, and wired them into multiple save/run flows.
  • Added save success confirmations across close-coupling, time-independent, and time-dependent pages (with optional suppression for nested saves).
  • Minor refactors for readability (e.g., Path.read_text(), loop variable naming, string formatting).

Reviewed changes

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

Show a summary per file
File Description
src/astra_gui/utils/popup_module.py Introduces started_calculation_popup and save_success_popup helpers.
src/astra_gui/utils/notebook_module.py Shows “calculation started” popup when launching background scripts; minor file-read refactor.
src/astra_gui/time_independent/ti_notebook_page_module.py Shows save-success popup after saving TI scripts.
src/astra_gui/time_independent/structural.py String formatting cleanup for generated command lines.
src/astra_gui/time_dependent/pulse.py Shows save-success popup after writing pulse files.
src/astra_gui/close_coupling/molecule.py Shows save-success popup after saving molecule inputs.
src/astra_gui/close_coupling/lucia.py Adds show_popup flag to save() and shows save-success popup when enabled.
src/astra_gui/close_coupling/dalton.py Shows save-success popup after saving DALTON inputs.
src/astra_gui/close_coupling/clscplng.py Suppresses nested Bsplines save popup and shows a single save-success popup for CLSCPLNG.
src/astra_gui/close_coupling/bsplines.py Adds show_popup flag to save() and conditionally shows save-success popup.
src/astra_gui/app.py Minor variable rename cleanup in notebook iteration.
.codex/environments/environment.toml Adds a Codex environment config to run hatch run all.

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

Comment on lines +580 to +583
self.controller.after(
0,
lambda: started_calculation_popup(f'{script_name} started running.'),
)
Copy link

Copilot AI Feb 3, 2026

Choose a reason for hiding this comment

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

started_calculation_popup is scheduled before verifying that the background launch command actually succeeded. If the local nohup subprocess returns a non-zero code or the remote run_remote_command returns exit_code != 0, the user will still see “started running”, which is inaccurate. Consider moving this popup to after the launch succeeds (after checking result.returncode == 0 locally / exit_code == 0 remotely), or changing the message to something like “launch requested” and only showing “started” on success.

Copilot uses AI. Check for mistakes.
Comment on lines 244 to +245
self.save_script(self.SCRIPT_FILE, commands, f'{self.label} calculation', convert_cs_irreps=True)
save_success_popup(f'{self.label} inputs saved successfully.')
Copy link

Copilot AI Feb 3, 2026

Choose a reason for hiding this comment

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

save_success_popup is shown unconditionally after save_script(...), but save_script can return early without writing anything (e.g., when idle_processor_popup(...) is declined). This can lead to a false “inputs saved successfully” confirmation. Consider having save_script return a boolean indicating whether it actually saved, or restructuring so the success popup is only shown after the save definitely occurred.

Suggested change
self.save_script(self.SCRIPT_FILE, commands, f'{self.label} calculation', convert_cs_irreps=True)
save_success_popup(f'{self.label} inputs saved successfully.')
saved = self.save_script(
self.SCRIPT_FILE,
commands,
f'{self.label} calculation',
convert_cs_irreps=True,
)
if saved:
save_success_popup(f'{self.label} inputs saved successfully.')

Copilot uses AI. Check for mistakes.
Comment on lines +91 to +99
def started_calculation_popup(message: str) -> None:
"""Display a start message for long-running calculations."""
messagebox.showinfo('Calculation Started', message)


def save_success_popup(message: str) -> None:
"""Display a confirmation message after saving files."""
messagebox.showinfo('Files Saved', message)

Copy link

Copilot AI Feb 3, 2026

Choose a reason for hiding this comment

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

New popup helpers started_calculation_popup and save_success_popup were added here, but the existing popup wrapper test suite (see tests/test_popup_module.py) enumerates the popup functions it expects to forward to the messagebox spy. Please extend/update that test coverage to include these new wrappers so regressions (wrong messagebox method, title, etc.) are caught.

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.

1 participant