Skip to content

[GUI] Share dialog height among rows and add the pop_importdata note - #722

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

arnodelorme merged 2 commits into
developfrom
agent/issue-700

Conversation

@arnodelorme

@arnodelorme arnodelorme commented Nov 26, 2026 •

Copy link
Copy Markdown
Collaborator

Dialogs with a fixed window size and no geomvert now share their height among their rows, as EEGLAB's supergui does, instead of stacking the rows above an empty band. About fifty dialogs change this way. pop_importdata also sizes its columns by weight and shows EEGLAB's note on channel location files.

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

Fixes #700
Part of #737 and #745

@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.

@arnodelorme

Copy link
Copy Markdown
Collaborator Author

🤖 Captures: EEGLAB, EEGPrep before and EEGPrep after, taken on jamming under a virtual screen. Then four other windows that the shared change moves, before and after.

pop_importdata window

pop_importdata window

pop_importepoch, before and after

pop_importepoch, before and after

pop_importevent, before and after

pop_importevent, before and after

pop_epoch, before and after

pop_epoch, before and after

pop_rejmenu, before and after

pop_rejmenu, before and after

@arnodelorme

arnodelorme commented Nov 27, 2026 •

Copy link
Copy Markdown
Collaborator Author

The review bot never looked at this pull request because it ran out of credit, so I reviewed it by hand. The new rule in qt.py matches EEGLAB's supergui.m, which gives every row the same share of the window height when there is no geomvert; it only applies to fixed-size dialogs that are not scrollable and have no text area, and empty rows get the same share as in EEGLAB. The pop_importdata note line and its row match pop_importdata.m.

I ran the dialog tests (30 GUI test files) with this branch and with its base, and logged the layout of every fixed-size dialog they build (pop_importdata, pop_editset, pop_erpimage, pop_rejmenu, pop_reref, pop_dipfit_settings, pop_importepoch and 14 others): no control overlaps another and none is squeezed below its normal height, before or after. The test results are the same apart from the new test, which now passes; the remaining failures come from onnxruntime and defusedxml missing in this local environment. The branch also merges cleanly with #759, and the importer tests pass on the combination. I found nothing to fix: it is safe to merge.

— orchestrator

@arnodelorme arnodelorme left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

This review was written by an AI assistant during a nightly check, not by Arno.

Code review

  • Overall assessment: safe to merge. The renderer change does what the title says, and the pop_importdata geometry and note text match pop_importdata.m. Checked at 133567b.
  • Highest-risk area: the shared rule in qt.py, because it moves the rows of every fixed-size dialog without geomvert, and only one of those dialogs has an assertion.
  • Merge recommendation: safe to merge. The points below are small and can be handled here or in a follow-up.

Blocking

None.

Important

None.

Nits

  1. Nit. _rows_share_height, text area clause and its docstring (qt.py#L907-L918, qt.py#L942-L943). The docstring says "A text area keeps the spare height for itself". That is not what the code does. I built a 600 x 800 dialog with one label row, one text area row and one edit row, no geomvert: the text area stays at its 192 px size hint, the last row ends at y = 255 and the OK button starts at y = 767, so the spare 500 px is the same empty band this pull request removes elsewhere. No packaged dialog reaches this branch either: the only textarea spec is pop_comments, and it sets geomvert. So the clause and the addStretch(1) left in _add_buttons now serve a case that does not exist, and the comment describes behavior that does not happen. Suggested fix: drop the textarea test from _rows_share_height and the stretch in _add_buttons (a text area row then gets an equal share, and its Expanding policy fills it). If the exception is wanted, give the text area row the stretch so the sentence becomes true.

  2. Nit. Local imports in the new test (test_stream9_gui_importers.py#L462-L465). AGENTS.md says "All imports go at the top. No local imports except for circular dependency breaks or optional dependency guards." The two imports inside the test are the only local ones in this file and neither exception applies. Move them next to the other eegprep.functions.guifunc imports at the top.

Test gaps

The new test covers pop_importdata, which uses weighted_columns. The rule itself is generic and also changes the dialogs that take the other branch of build_dialog (controls added with AlignVCenter), plus the new addStretch for empty rows. Nothing asserts either. One renderer test would lock them, for example in tests/test_guifunc_primitives.py: a spec with geometry=(1, 1, 1), a spacer as the middle control, a fixed size and no geomvert, asserting that the first and third rows sit two equal row heights apart (within 1 or 2 px) and that the last row ends close to the buttons. Not blocking: the layout survey below found no defect in the dialogs the existing GUI tests build.

EEGLAB parity notes

  • supergui.m lines 186 to 187 set geomvert to ones when it is empty, so equal row shares and a full share for an empty {} row are what EEGLAB does. The new code matches.
  • pop_importdata.m lines 153 to 154 (geometry) and 229 to 231 (note text) match the new spec row for row. At 1150 px the note needs 847 px and gets 1066 px, so it is not cut.
  • One remaining difference, no change requested: inputgui.m lines 203 to 204 add a skipped line and the button row to the rows that share the figure, so EEGLAB's row height is H / (n + 2). EEGPrep keeps a fixed button block and shares the rest among n rows. For dialogs with many rows the two agree closely. For the smallest ones the EEGPrep rows are a little taller (pop_resample, 2 rows in 199 px: about 57 px per row against about 50 px in EEGLAB).

Tests run

All on the pull request code in a separate worktree, offscreen Qt, without MATLAB.

  • tests/test_stream9_gui_importers.py: 28 passed. The new test fails against the base source (df89e80), as it should.
  • pytest tests -m gui: 320 passed, 30 failed, 2 collection errors on this branch. On the base: 319 passed, 30 failed, 2 errors. The lists of failures are identical, and the errors I read come from onnxruntime, hypothesis and pamica missing in my local environment, not from this change.
  • Layout survey during that run: 21 dialogs that now share their height (among them pop_editset, pop_erpimage, pop_rejmenu, pop_epoch, pop_dipfit_settings, pop_importevent, pop_importepoch). On this branch no control is shorter than its size hint, no label is cut, no two controls overlap and none leaves the window. The gap between the last row and the OK button goes from 27 to 311 px on the base to 23 to 43 px here. The other dialogs the description counts (about fifty in total) are not built by these tests, so I did not measure them.

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.

pop_importdata window: text squeezed and the channel location note missing (shared layout)

1 participant