Skip to content

[GUI] Spread the main window startup text over the frame - #721

Merged
arnodelorme merged 2 commits into
developfrom
agent/issue-699
Nov 27, 2026
Merged

arnodelorme merged 2 commits into
developfrom
agent/issue-699

Conversation

@arnodelorme

@arnodelorme arnodelorme commented Nov 26, 2026 •

Copy link
Copy Markdown
Collaborator

The startup lines of the main window share the frame height, as EEGLAB spreads its text rows over the figure, instead of being stacked at the top above an empty band. The continuous and epoched states already filled the frame and are unchanged, pixel for pixel.

Captures (EEGLAB, before, after) and tests: https://github.com/adelorme-assistant/project_eegprep/blob/main/reports/pr-699/issue-699_before_after.pdf (Word: https://github.com/adelorme-assistant/project_eegprep/blob/main/reports/pr-699/issue-699_before_after.docx)

Fixes #699
Part of #744

@claude claude Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

⚠️ Code review skipped — your organization has no extra usage available to pay for this review.

If your organization's extra usage balance is empty, an organization admin can add extra usage credits at claude.ai/admin-settings/usage. If its monthly spend limit was reached, an admin can raise it on the same page. If neither applies, contact Anthropic support.

Once extra usage is available, someone with write access to this repository can comment @claude review on this pull request to trigger a review.

@claude

claude Bot commented Nov 26, 2026 •

Copy link
Copy Markdown
Contributor

Claude finished @arnodelorme's task in 1m 6s —— View job


Code review

  • Pre-review gate (open, not a draft, no earlier review, HEAD 3d899aa matches the PR head)

  • Read the diff and its context

  • Review passes (AGENTS.md, conventions, correctness, EEGLAB parity)

  • Post review

  • Overall assessment: The layout change is small and correct. Removing the trailing addStretch(1) lets the startup rows spread over the frame. The data panel (QGridLayout) is untouched, which fits the claim that the continuous and epoched states don't change. I checked the stack/frame layout in _build_central_widget, the label size policy, where the test sits and how it is guarded, and AGENTS.md compliance.

  • Highest-risk area: The new test runs without the optional GUI extra installed.

  • Merge recommendation: Safe to merge after the test guard fix below.

Blocking

None.

Important

  • tests/test_gui_main_window.py, test_startup_text_fills_the_frame_height. The test builds a Qt window but has no pytest.importorskip("PySide6"), and it sits in EEGPrepSessionTests, which otherwise holds non-Qt tests. PySide6 is only in the optional gui extra (pyproject.toml). Every other test that calls build_main_window (in QtMainWindowTests and at L461) skips when PySide6 is missing. As written, this test errors instead of skipping on an install without the gui extra.
    Fix: move the test into QtMainWindowTests and add pytest.importorskip("PySide6") as its first line. Fix this →

Nits

  • src/eegprep/functions/guifunc/main_window.py L174–175. The comment says each row gets an "equal share" of the frame height. However, _configure_eeglab_label (L568) sets the vertical size policy to QSizePolicy.Fixed, so stretch factor 1 cannot make the labels taller. The rows spread because the trailing addStretch(1) is gone, and QBoxLayout then puts the extra space between the fixed-height items. The result is the same either way. Consider making the comment say that the extra height goes between the rows, or drop the , 1.

Test gaps

None. The check that the last label's bottom edge is below 90% of the stack height should fail with the old addStretch(1) and pass with the new layout, so it is a real regression guard rather than a tautology. I could not run it here because running pytest was not approved in this job.

EEGLAB parity notes

None. The change brings the startup state closer to EEGLAB, which spreads its text rows over the full figure height.

Comment thread tests/test_gui_main_window.py Outdated
Comment on lines +301 to +303
def test_startup_text_fills_the_frame_height(self):
os.environ.setdefault("QT_QPA_PLATFORM", "offscreen")
from eegprep.functions.guifunc.main_window import build_main_window

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Important: This test builds a Qt window but doesn't skip when PySide6 is missing. PySide6 is only in the optional gui extra, so on an install without that extra this test errors instead of skipping. Every other build_main_window test guards against this, for example

class QtMainWindowTests(unittest.TestCase):
def test_gui_main_window_checks_selected_dataset_menu_item(self):
pytest.importorskip("PySide6")
os.environ.setdefault("QT_QPA_PLATFORM", "offscreen")
from eegprep.functions.guifunc.main_window import build_main_window

Fix: move this test into QtMainWindowTests and make its first line:

pytest.importorskip("PySide6")

@arnodelorme

Copy link
Copy Markdown
Collaborator Author

🤖 Captures: EEGLAB, EEGPrep before and EEGPrep after, taken on jamming under a virtual screen. The continuous and epoched states do not change.

Main window, startup

Main window, startup

Main window, one continuous dataset

Main window, one continuous dataset

Main window, one epoched dataset

Main window, one epoched dataset

@arnodelorme

Copy link
Copy Markdown
Collaborator Author

The bot found that test_startup_text_fills_the_frame_height builds a Qt window without skipping when PySide6 is missing, and that the comment about "equal shares" of the height was misleading because the labels have a fixed height.

Commit 48eda04 moves the test into QtMainWindowTests with pytest.importorskip("PySide6") as its first line and rewrites the comment to say that the spare height goes between the rows. The layout itself is unchanged. In tests/test_gui_main_window.py, 47 tests pass offscreen. The 3 ICLabel async tests fail locally in exactly the same way on the previous head, because of the local ICLabel setup, and they pass in CI.

— orchestrator

@arnodelorme
arnodelorme merged commit 0615907 into develop Nov 27, 2026
12 checks passed
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.

eeglab main window: text squeezed in the startup state, use the full width as in EEGLAB

1 participant