Skip to content

[GUI] Size a dialog from its rows, one row height per platform, never shorter than its content - #776

Merged
arnodelorme merged 9 commits into
developfrom
agent/20261127-fix-775
Nov 28, 2026
Merged

arnodelorme merged 9 commits into
developfrom
agent/20261127-fix-775

Conversation

@claude

@claude claude Bot commented Nov 27, 2026 •

Copy link
Copy Markdown
Contributor

A window whose specification gives no height is now as high as its rows, as in EEGLAB's supergui: every row, blank rows included, takes the same height. That height is a constant per platform kept in one place (28 pixels), raised in each window to its tallest one-line control plus the gap, so no row is ever shorter than its content. pop_importdata no longer has a height of its own. On Linux 13 of the 127 dialog renderings change size, the other 114 are identical pixel for pixel.

Graphics

On Linux (jamming): EEGLAB, EEGPrep before, EEGPrep after.

pop_importdata on Linux: EEGLAB, EEGPrep before, EEGPrep after

With the Mac style (drawn without opening a window, today): develop at 480 pixels, after at 454 pixels: 13 rows of 30 pixels (edit box 26 plus a gap of 4). The real Mac window comes tonight.

pop_importdata with the Mac style: before and after

Numerical difference with EEGLAB

pop_importdata, distance between EEGLAB and EEGPrep

All 10 test cases give exactly EEGLAB's result: the data (distance 0), the sampling rate, the numbers of channels, points and epochs, the start and end times, the channel labels and coordinates, and the dataset fields. No case fails. This pull request changes the window only, so these numbers are those of develop.

The numbers: EEGLAB's rule and the row height per platform
  • EEGLAB (supergui.m, lines 334 to 437): the height of a figure is its number of rows times one row height, plus 1.1 rows of borders. The row height is the height of a line of text times a platform factor: 1 on Linux, 1.5 on the Mac, 1.08 on Windows. inputgui.m adds one blank row and the row of buttons.
  • EEGLAB's pop_importdata on Linux: 15 rows, 450 pixels, so 27.8 pixels per row.
  • EEGPrep: EEGLAB_ROW_HEIGHT in guifunc/theme.py, the smallest row per platform: Linux 28, Mac 28, Windows 28 (EEGLAB's own row). Each window raises it to its tallest edit box or popup menu plus the 4 pixel gap: 31 pixels on Linux (edit box 27), 30 with the Mac style (edit box 26). Since develop's commit 9ada0ae the edit boxes are as tall as their text needs, which is why the row is above 28.
  • EEGPrep's pop_importdata: 13 rows of 31 pixels plus the margins and the buttons, 471 pixels on Linux, 454 with the Mac style (EEGLAB on Linux: 450 for 15 rows). A larger font makes the rows and the window taller.
  • Not changed: the 61 dialogs that still give a height in pixels keep it. Each one loses it when its function is worked on (rule 26).
Every dialog that moves on Linux, before and after (13 of 127)
Dialog Before After Height
pop_importdata 1150 by 480 1150 by 471 -9
pop_exportbids 709 by 331 709 by 378 +47
pop_chanevent 833 by 335 833 by 378 +43
pop_biosig 692 by 284 692 by 316 +32
pop_writeeeg, epoched 417 by 225 417 by 241 +16
pop_studyerp 1070 by 176 1070 by 192 +16
pop_loadcnt 503 by 179 503 by 192 +13
pop_mffimport 356 by 117 356 by 130 +13
pop_writeeeg, continuous 417 by 202 417 by 210 +8
pop_eventinfo (BIDS) 423 by 308 423 by 316 +8
pop_participantinfo (BIDS) 476 by 277 476 by 285 +8
pop_fileio 546 by 187 546 by 192 +5
pop_loadeeg 487 by 218 487 by 223 +5

dialogs that move, part 1

dialogs that move, part 2

What the code changes, and the tests
  • guifunc/theme.py: the table EEGLAB_ROW_HEIGHT.
  • guifunc/qt.py: _row_height (the platform minimum, raised to the tallest one-line control of the window plus the gap) and _content_row_height (geomvert times that height, 1 by default). Each row gets it as a layout strut, so it is at least one row high and a taller control, such as a list box or a larger font, makes the row and the window taller. A blank row takes a full row.
  • popfunc/pop_importdata.py: size=(1150, None).
  • New test: in a window without a height, the step between two rows is one row height and two across a blank row. A checkbox row is as high as an edit box row. It fails on develop and passes here. Develop's own test that a larger font makes a field taller passes too.
  • On jamming: the dialog tests pass. The failures left are those of develop (test_disabled_list_box_is_greyed, fixed by [GUI] Parse the dialog style sheet afresh so a dialog never inherits another one's #778, and tests that need packages jamming lacks).
How the numbers were obtained
  • Test cases: float32 little endian continuous and epoched (xmin -1 and 0), float32 big endian, ASCII text, MATLAB file with and without the number of channels, with a channel location file, with the dataset fields (name, subject, condition, group, session, comments), and 16 channels at 500 Hz. All are made from the real sample files eeglab_data.fdt, eeglab_data_epochs_ica.fdt and eeglab_data_epochs_ica.set.
  • Both programs: EEGLAB develop with MATLAB R2025b and EEGPrep develop (395f19e; the import code has not changed since, up to 2558e8e), the same call on the same file, on jamming.
  • Distance: the largest absolute difference between the two outputs divided by the largest absolute value of EEGLAB's output. Tolerance 1e-12. Counts, labels and text fields must be the same.
  • Scripts: notes/file-menu-row-height-2026-11-27/scripts of adelorme-assistant/project_eegprep (numeric_ref.m, numeric_py.py, histogram.py).

Fixes #775
Part of #737 and #745

The fixed 480 pixel height spread the 13 rows over too much space. A dialog
with no fixed height no longer shares height among its rows.

Fixes #775

Co-Authored-By: Claude Opus 5.5 <[email protected]>

@claude claude Bot left a comment

Copy link
Copy Markdown
Contributor Author

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 27, 2026 •

Copy link
Copy Markdown
Contributor Author

Claude finished @claude[bot]'s task in 59s —— View job


Code review

  • Overall assessment: Looks good. The change does what it claims. With size=(1150, None), _rows_share_height now returns False. That gives each row a fixed vertical policy, turns the blank rows into fixed spacing instead of a stretch of 100, and has _add_buttons add a trailing stretch. _apply_spec_size then keeps the adjustSize() height (qt.py:1008). The window therefore takes the height of its content.
  • Highest-risk area: the shared _rows_share_height guard in qt.py. On develop it also changes pop_chanevent, which already uses size=(833, None) (pop_chanevent.py:439). Its blank rows become fixed spacing instead of collapsing to nothing at content height. This matches what [GUI] Restore pop_chanevent blank rows and align its notes #773 intends, and test_chanevent_labels_fit_their_column checks only column positions and height <= sizeHint + 4, so I see no breakage whichever PR merges first.
  • Merge recommendation: Safe to merge.

Blocking

None.

Important

None.

Nits

  • tests/test_stream9_gui_importers.py:509: the test is still named test_importdata_rows_share_the_window_height_and_show_the_chanlocs_note. Its new assertions now check the opposite: the window fits its content (dialog.height() <= sizeHint + 4) and the gap after Dataset name is fixed. Suggest renaming it to something like test_importdata_window_fits_its_rows_and_shows_the_chanlocs_note.

Test gaps

None. The new assertions cover both claims in the description: the window fits its content, and the blank row after Dataset name is kept (setname→srate gap is more than 1.8 × the srate→pnts row pitch).

EEGLAB parity notes

None. GUI-only layout change. Labels, defaults and control order are unchanged, and the window no longer spreads rows over spare height, which brings it closer to EEGLAB's packed inputgui layout.

I checked correctness of the size and stretch paths in qt.py (build_dialog, _row_stretch, _add_buttons, _apply_spec_size), other callers that use width-only sizes, the changelog entry, and AGENTS.md compliance. I could not run the GUI tests: running pytest through Bash is not permitted in this job. To let future reviews run them, allow Bash(uv run pytest:*).

@arnodelorme

Copy link
Copy Markdown
Collaborator

🤖 Captures: review: the change is the one of issue #775 and it is right. It gives the same picture as my own version (1150 by 389 on jamming, 385 with the Mac style, EEGLAB's is 450). One commit added (a70cb7d): the changelog entry moved a few lines down, because it conflicted with the entry of #773. The two now merge in any order, and both carry the same one line of qt.py. The check Ruff and ty fails because of develop itself (merge #766 first).

jamming: EEGLAB, EEGPrep develop, EEGPrep after

jamming: EEGLAB, EEGPrep develop, EEGPrep after

Native Mac style (grabbed without showing a window): develop and after

Native Mac style (grabbed without showing a window): develop and after

@arnodelorme

Copy link
Copy Markdown
Collaborator

🤖 Captures: new height after Arno's answer of November 27 ("Before too much space between the rows. After it doesn't have enough. Something in the middle would be great for Mac."). The window is now 1150 by 430 pixels, between the 480 of develop and the 385 of the first version. The rows share that height again, so this pull request no longer touches the shared code (only the size, the test and the changelog), and develop is merged in. The Mac pictures are real windows shown on the Mac for a second and grabbed by Qt (native macOS style, no title bar: a screen capture needs a permission I do not answer). The jamming pictures are taken under Xvfb.

Mac, real window: develop (480), first version (385), now (430)

Mac, real window: develop (480), first version (385), now (430)

jamming: EEGLAB (450), develop (480), first version (389), now (430)

jamming: EEGLAB (450), develop (480), first version (389), now (430)

@arnodelorme arnodelorme changed the title [GUI] Let the pop_importdata window take the height of its content [GUI] Make the pop_importdata window 430 pixels high Nov 27, 2026
@arnodelorme

Copy link
Copy Markdown
Collaborator

🤖 About the failing test jobs here: the one test that fails, test_disabled_list_box_is_greyed, fails on develop itself on every platform and has nothing to do with this change. Pull request #778 fixes it. With #778, #770 and this branch merged together on jamming, the dialog tests pass (181 passed, the one failure is a test that needs a package jamming does not have). Merge #778 first, then the checks here can be rerun.

@arnodelorme arnodelorme changed the title [GUI] Make the pop_importdata window 430 pixels high [GUI] Size a dialog from its rows, one row height per platform; pop_importdata has no height of its own Nov 27, 2026
arnodelorme and others added 2 commits November 28, 2026 10:15
A window without a height takes the platform row height, raised to its
tallest one-line control plus the gap, through a layout strut so a
larger font grows the row and the window.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@arnodelorme arnodelorme changed the title [GUI] Size a dialog from its rows, one row height per platform; pop_importdata has no height of its own [GUI] Size a dialog from its rows, one row height per platform, never shorter than its content Nov 28, 2026
@arnodelorme

Copy link
Copy Markdown
Collaborator

🤖 Handoff for the November 28 GUI work. My EEGPrep code change is 5a14380 on agent/issue-822, in #831. It lets pop_rmdat fit its two existing input rows. On Linux the gap between the event types and time limits fields went from 37 px to 6 px, compared with 5 px in MATLAB. The PR includes a Qt regression test and the three captures. The Linux, macOS and Windows CI test jobs passed. Arno has the PR for review.

For anyone working on shared dialog sizing in #776, the regression test to check is test_pop_rmdat_time_limits_sit_directly_below_event_types. It measures the gap between the rendered fields. The only runtime file changed in #831 is pop_rmdat.py.

Current work is the comparison report for Tools, Plot, Study, Datasets and Help. The Linux PDF and Word report have been sent. Results for rejection by inspection, rereferencing and epoch extraction are on #793, #794 and #795. Native macOS and Windows captures are scheduled for November 29 at 12:05 a.m. Pacific. I am documenting differences in these menus for Arno’s review.

@arnodelorme
arnodelorme merged commit 2fe5606 into develop Nov 28, 2026
11 of 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.

pop_importdata window: no fixed height, the rows set it with one row height per platform

1 participant