Repository navigation
[GUI] Match the resizable dataset comments figure - #929
Conversation
There was a problem hiding this comment.
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 finished @arnodelorme's task in 1m 25s —— View job Code review
BlockingNone. Important
NitsNone. Test gapsNone. The new tests check the figure geometry at two sizes and that unchanged wrapped text is restored. EEGLAB parity notesNone found. The editor, CANCEL and SAVE rectangles ( Also checked: SAVE/CANCEL return values through |
| if spec.size is not None: | ||
| available = dialog.screen().availableGeometry().size() | ||
| size = core.QSize(*spec.size) | ||
| if size.width() > available.width() or size.height() > available.height(): | ||
| size.scale(available, core.Qt.AspectRatioMode.KeepAspectRatio) | ||
| dialog.resize(size) |
There was a problem hiding this comment.
Important (breaks an existing test): the figure now opens at spec.size whatever the content, which matches pop_comments.m. But tests/test_guifunc_primitives.py::test_multiline_editor_grows_with_long_comments (
eegprep/tests/test_guifunc_primitives.py
Lines 210 to 226 in d378dee
short.height() < long.height() for 1 line vs. 100 lines of comments. Both dialogs now get the same height, so that assertion fails. That file wasn't in the 47-test focused run described in the PR.
Suggested fix: the content-driven growth is gone on purpose, so delete or rewrite that test. Its last half (resizing the window enlarges the editor) is already covered by test_comments_figure_resizes_like_matlab, so deleting it is probably enough.
arnodelorme
left a comment
There was a problem hiding this comment.
This review was written by an AI assistant during a nightly check, not by Arno.
Code review
- Overall assessment: Safe to merge.
- Highest-risk area: Normalized axes layout in
src/eegprep/functions/guifunc/qt_comments.pyand 53 column display wrapping insrc/eegprep/functions/popfunc/pop_comments.py. - Merge recommendation: Safe to merge.
Blocking
None.
Important
None.
Nits
None.
Test gaps
None.
EEGLAB parity notes
None. Compared qt_comments.py and pop_comments.py against functions/popfunc/pop_comments.m, functions/sigprocfunc/strmultiline.m, and functions/sigprocfunc/icadefs.m. Normalized control rectangles ([0 10 105 85], [0 -5 20 10], [80 -5 20 10] relative to default axes [0.13 0.11 0.775 0.815]), figure and button colors, Courier 10 pt editor and Helvetica bold plain text title fonts, strmultiline(..., 53) trigger and word wrapping, cancel handling, and documented preservation of original line breaks when saving without edits all align.
Checked for correctness bugs, EEGLAB parity, data structure compatibility, callers (QtDialogRenderer, inputgui, pop_importdata, menu_actions, eeglab_execmenu), documentation and help files, and AGENTS.md compliance.
Tests run in a detached worktree at 683e21e03ca5352089cab3a08fae60647ec23ebf:
pytest tests/test_pop_comments.py tests/test_guifunc_primitives.py: 25 passed, 4 deselected.pytest tests/test_stream9_gui_importers.py -k pop_comments: 1 passed, 38 deselected.pytest tests/test_gui_geometry.py tests/test_eeglab_execmenu.py tests/test_package_help.py: 151 passed, 65 skipped (Linux only geometry checks on macOS), 2 deselected.QT_QPA_PLATFORM=offscreen pytest tests/test_stream11_help_errors.py: 26 passed.ruff checkandruff format --checkon changed Python files: passed.
🤖 Fixes #925. Refines the dataset comments editor tracked in #727 and the Edit menu in #875. Stacked on #908. Once #908 reaches develop, this PR can target develop.
The dataset comments editor now follows the normalized axes used by the MATLAB figure. Its heading and editor use the reference font settings. The buttons, editing area and heading resize together. Saving and cancelling preserve the original comment text when it has not changed.
Opening window. Left to right, live MATLAB, Qt before and Qt after on the same 2560 × 1600 jamming desktop. MATLAB and the revised Qt figure both opened at 1394 × 840. The former Qt figure opened at 1394 × 456.
Resize. The same native figures at 950 × 620. The maximum difference in horizontal position, vertical position, width or height of the editor and buttons was 0.5 px at each size. Native toolkit painting and font rendering can still be seen in the panels. Default opening sizes on other screen configurations are outside this two-size geometry comparison.
SAVE and CANCEL. The two implementations displayed the same 24 lines after removal of MATLAB character-matrix padding. Saving a two-line edit returned matching comments. Cancel returned all nine original lines, including the trailing blank line, and an empty history command.
Four test cases failed on the previous source. After the change, the focused suite passed 47 tests and deselected three optional EEGLAB backend checks. The live public-function MATLAB oracle and Qt mouse interactions ran separately on jamming. The source checkout guard, staged pre-commit checks, Ruff and type checks passed. The change is confined to this bespoke comments figure, its tests and the corresponding user documentation.
Full inventory report for the project team. pop_comments (p. 2). PDF · Editable Word.