Repository navigation
[GUI] Restore the EEGLAB geometry of the event value editor - #844
arnodelorme wants to merge 6 commits into
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 16s —— View job Code review
BlockingNone. ImportantNone. Nits
Test gapsNone. The epoched EEGLAB parity notes
|
| def test_event_editor_leaves_one_row_between_fields_and_navigation(qt_dialogs): | ||
| eeg = {"event": [{"latency": 1, "type": "A"}], "srate": 100, "trials": 1} | ||
| spec = pop_editeventvals_dialog_spec(eeg) | ||
| widgets = qt_dialogs.build(spec) | ||
| dialog = qt_dialogs.dialogs[-1] | ||
| dialog.show() | ||
| assert widgets["desc_latency"].text() == "latency (sec)" | ||
| assert spec.geometry[-4] == (1,) | ||
| assert widgets["desc_latency"].x() == widgets["desc_type"].x() | ||
| button = widgets["append_button"] | ||
| assert button.width() >= button.sizeHint().width() |
There was a problem hiding this comment.
Nit (test placement / implementation detail): This Qt layout test went into test_pop_editeventvals_current.py, which otherwise holds the @eeglab_test "current suite" ports. The other Qt renderer tests for this dialog (test_qt_renderer_navigation_updates_eventnum_and_fields and others) are in tests/test_pop_editeventvals.py. AGENTS.md says "Extend the closest existing test first".
Also, assert spec.geometry[-4] == (1,) reads back the geometry tuple the spec function just built, which is the kind of check AGENTS.md calls out ("Do not write tautological tests that only assert ... implementation details"). The rendered widgets already show the behavior: check that the navigation row sits at least one row height below the last field row, e.g. widgets["back1"].mapTo(dialog, QPoint()).y() - widgets["field_type"].mapTo(dialog, QPoint()).y() exceeds roughly twice the field row height. You could also drop that assertion and keep the label, alignment and button-width checks.
Suggested fix: move this test to tests/test_pop_editeventvals.py and replace the geometry-tuple assertion with a check on the rendered layout.
|
Review (Claude Fable): needs more work
DetailsReviewed at f175ace. 1. Captions (to fix). 2. Shared renderer change (
So the change does what it claims and the other two windows that use 3. Tests. Local run of the two touched files: 15 passed, 1 deselected. In the new test, the assertion that the three field buttons share one x also passes with develop's helper (x = 194 in both cases), so it does not guard the 4. Docs. The new paragraph is appended under "Quality Control Checklist" in 5. Parity checked and fine. Geometry 6. Not from this branch, for #725. No code fills the 7. CI. macOS failed on 8. Other open pull requests. Merges cleanly with develop, #846, #848 and #851. #835 and #778 conflict, but both already conflict with develop alone ( 9. What the pull request shows. Capture of EEGLAB, before and after is visible, the Word and PDF reports exist, and no histogram is needed since no numbers change. Missing: a line saying the two other windows were checked (rule 15), a mention of the capital letter difference, and the Mac capture (rule 29, to be added at night). — orchestrator review |
Co-Authored-By: Claude Fable 5.2 <[email protected]>
Co-Authored-By: Claude Fable 5.2 <[email protected]>
Code reviewIndependent review by Codex (OpenAI, model gpt-6.1-terra), run read-only on commit 1b43573 with the diff against develop. Its text follows unchanged, apart from local file links turned into plain file names. Overall assessmentNeeds changes. The geometry and ordinary captions follow the MATLAB control list, but the original event index is never displayed. The shared sizing change also needs a test for long field names. I could not run the Qt tests because PySide6 is unavailable. GitHub access was unavailable, so I could not verify the live PR head. BlockingNone. ImportantThe original event index remains blank. The changed control at NitsNone. Test gapsThe Qt test checks visible captions, alignment, spacing, and an unclipped Append button. It would fail on the base version because its captions and row spacing differ. The helper test checks capitalization, but does not establish what the user sees ( Add a GUI test for EEGLAB parity notesFor ordinary and unusual names, the capitalization rule matches the reference: The row weights and control order match ( What was done with these findings The review found nothing blocking. I fixed three of its points in commit c42b8ff. The help page no longer says that every button starts with a capital, since a one-letter field name stays as it is, in EEGLAB too. The matching sentence is now in the Sphinx migration notes ( I left the blank "original" text. It is true that EEGLAB writes "originally N" there, but no code filled it before this pull request either, and filling it on navigation and after insert, append and delete is new behaviour that belongs in its own small pull request under #725, not in a geometry fix. I also left the navigation row as it is: "Insert event" and "Append event" keep slightly different widths for the same weight, a point of the earlier review that is a design choice and was not part of this request. The two event editor test files and the shared dialog tests pass on the Mac (26 passed, 2 deselected). No numerical code changed, so no EEGLAB parity run is needed. Codex could not run the Qt tests in its sandbox. — orchestrator |
The event value editor now uses EEGLAB’s spacer and button rows. The field buttons carry a capital first letter, as EEGLAB's
superguigives them (Type,Position,Latency (ms),Epoch), and show the units used for latency and duration. All captions fit, including Append event.The four panels above are EEGLAB, EEGPrep before this pull request, the first version of this pull request (lower-case captions) and the current version. The EEGPrep panels use the native Mac style, drawn by Qt without showing the window, so they have no title bar. The earlier Linux capture is kept below. Its "EEGPrep after" panel is the first version, before the capital letters.
The change in the shared dialog code does not move the two other windows that use the same option,
pop_importepochandpop_chanevent: every control keeps its position and width (measured in the review of this pull request).Editable Word report · PDF report
Cause and change
The event editor omitted a spacer row and supplied its own margins, spacing and height. The control list now follows the MATLAB geometry. The button captions follow lines 387 to 398 of
supergui.m: capital first letter and the rest in lower case, unless the caption already starts with a capital followed by a lower-case letter. In the shared Qt renderer, equal weighted columns give repeated field buttons one minimum width so a longer caption cannot shift one row. The sample window keeps its width.Verification
After the caption change (c42b8ff): the two event editor test files and the shared dialog tests pass on the Mac (26 passed, 2 deselected), Ruff passes. No numerical code changed, so no EEGLAB parity run is needed. The Word and PDF reports linked above now hold the capitalized captions (Mac style for the current version, since it was not captured again on Linux). An independent review by Codex is in the comments. Earlier checks: 164 GUI, event editor and importer tests passed, with 138 subtests and six deselected MATLAB reference cases. Ruff, ty and pre-commit passed. Windows CI previously measured field-button starts at 239 and 242 px. A long custom field reproduced a 41 px offset locally. The regression now passes with both buttons at the same x and the original window width. The final Xvfb recapture matched the attached PNG and all control coordinates byte for byte. The four sample edit boxes start at x = 377 px and the 135 px Append event caption fits. A separate one-pixel Windows row-height check is tracked in #834 and its proposed fix. CI for the final branch.
Fixes #823
Fixes #859
Part of #725