Repository navigation
[GUI] Add Enter comments button and bold labels to pop_importdata - #759
Conversation
Co-Authored-By: Claude Opus 5.5 <[email protected]>
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 @claude[bot]'s task in 1m 20s —— View job Code review
BlockingNone. Important
NitsNone. Test gaps
EEGLAB parity notesNone. EEGLAB's What I checked: the |
|
|
||
|
|
||
| def _edit_comments(values, update): | ||
| update({'comments': pop_comments(values['comments'], 'Edit comments of current dataset')}) |
There was a problem hiding this comment.
Important: multi-line comments now produce a history command that won't parse.
Before this PR, comments came from a single-line QLineEdit, so it could never contain \n. Now pop_comments returns text from a QTextEdit, and _history_command passes it through format_history_value, which only wraps the string in quotes:
eegprep/src/eegprep/functions/popfunc/pop_importdata.py
Lines 131 to 136 in d0a275e
For the text in the new test ('line one\nline two'), EEG['history'] and the returned com contain a raw newline inside a quoted literal:
EEG = pop_importdata(..., 'comments', 'line one
line two');
That can't be replayed in MATLAB or Python, and it breaks LASTCOM/ALLCOM and exported scripts. pop_comments already handles this case by emitting a cell of lines:
eegprep/src/eegprep/functions/popfunc/pop_comments.py
Lines 124 to 128 in d0a275e
Suggested fix: format comments in pop_importdata._history_command the same way, for example by sharing _history_comments_value (moving it to _pop_utils would avoid a cross-module private import). Also extend test_pop_importdata_enter_comments_button_opens_pop_comments to call with return_com=True and check that com stays on one line and round-trips the two lines.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
|
The review bot found that a comment of several lines, now possible because the Enter comments button opens the pop_comments text box, wrote a raw line break into the history command, so LASTCOM, ALLCOM and exported scripts could not be replayed. Commit c87cb15 moves the formatting pop_comments already used into _pop_utils (format_history_comments), uses it in pop_importdata's history so the comments become a cell of lines, and lets pop_importdata accept that cell when the command is replayed. The test now calls the dialog with return_com=True, checks the command stays on one line, and replays it. The new check fails on the previous commit and passes now. The touched test files pass (test_stream9_gui_importers, test_pop_comments, test_pop_utils, test_stream9_import_options: 48 passed); a wider run of 13 related test files shows the same 30 failures before and after the change, all from onnxruntime missing in this local environment. This pull request is the one to keep for issue #756; #757 does the same job and has the same history problem. — orchestrator |
The pop_importdata window now has EEGLAB's Enter comments button next to About this dataset, which opens the pop_comments editor and keeps the text on the button, and shows Data sampling rate (Hz) and Channel location file or info in bold. Run_dialog_action updates now store values on value-holding pushbuttons instead of relabelling them. Adds an offscreen Qt test of the button.
Fixes #756
Part of #737
🤖 Generated with Claude Code