Skip to content

Conversation

RasmiaKulan
Copy link
Collaborator

@RasmiaKulan RasmiaKulan commented Aug 28, 2025

Issue Closes #2057

Description

  • Updated main/view.py by:
    1. Adding a reset_layout function that handles closing and reopening all stacks, while also catching errors if the action is unsuccessful.
    2. Creating a View menu and an option for resetting the layout.
  • Updated stack_visualiser/view.py by adding a Reset main window layout action to the right-click menu.
  • Added unit tests for reset_layout, covering:
    1. No stacks available (shows error dialog).
    2. Recreating stacks (closes old ones, clears state, and rebuilds).
    3. Exception handling (shows error dialog with details).

Developer Testing

  • I have verified unit tests pass locally: python -m pytest -vs
  • I have verified that the unit tests I added pass locally: python -m unittest -v mantidimaging.gui.windows.test.view_test

Acceptance Criteria and Reviewer Testing

  • Unit tests pass locally: python -m pytest -vs
  • Load one or two datasets.
  • Drag some stacks next to each other within the main window, and drag others outside the main window.
  • From the top menu, click ViewReset default layout and confirm the layout resets to the default.
  • Right-click on a stack, select Reset main window layout, and confirm the layout resets to the default.

Expected Behaviour

reset_layout_to_default.mp4

Documentation and Additional Notes

  • Screenshot tests have been updated
    • Before merge for developer: Resolve the change on applitools by, creating a new baseline for test and verify that the tests pass.
    • After merge for reviewer: Go to Applitools compare and merge page, select all changes and merge dev branch to default branch
    • After merge for reviewer: Verify that other PR's screenshot tests do not start to fail (See Applitools baselines for more info) -->

@RasmiaKulan RasmiaKulan changed the title allow resetting gui to default layout 2057 allow resetting gui to default layout Aug 28, 2025
@coveralls
Copy link

coveralls commented Sep 1, 2025

Coverage Status

coverage: 70.339% (-0.3%) from 70.656%
when pulling ef90380 on 2057-reset_gui_to_default_layout
into f1e1e8b on main.

@RasmiaKulan RasmiaKulan changed the title 2057 allow resetting gui to default layout 2057 Allow Resetting GUI to Default Layout Sep 2, 2025
@RasmiaKulan RasmiaKulan marked this pull request as ready for review September 2, 2025 12:41
@hussam-stfc hussam-stfc self-requested a review September 5, 2025 12:57
@hussam-stfc hussam-stfc self-assigned this Sep 5, 2025
@@ -0,0 +1 @@
#2057: Updated the code to allow resetting GUI to default layout through a view menu as well as the right-click menu.
Copy link
Collaborator

Choose a reason for hiding this comment

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

The description is a bit ambiguous, perhaps we could mention resetting floating windows

@@ -0,0 +1 @@
#1619: Updated the code to prevent the sidebar from minimising at all.
Copy link
Collaborator

Choose a reason for hiding this comment

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

Has this file ended up in this PR by accident?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

@hussam-stfc I forgot to add the release notes for that issue when I closed it, so I snuck them in here. 👀

@JackEAllen JackEAllen marked this pull request as draft September 5, 2025 13:06
@RasmiaKulan RasmiaKulan marked this pull request as ready for review September 8, 2025 06:51
@RasmiaKulan RasmiaKulan marked this pull request as draft September 8, 2025 06:53
@RasmiaKulan RasmiaKulan marked this pull request as ready for review September 8, 2025 08:19
@hussam-stfc hussam-stfc added this pull request to the merge queue Sep 9, 2025
Merged via the queue into main with commit 0ed98bd Sep 9, 2025
9 checks passed
@hussam-stfc hussam-stfc deleted the 2057-reset_gui_to_default_layout branch September 9, 2025 09:13
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.

Reset GUI to Default Layout
3 participants