Repository navigation
Closed
Labels
phaseEpic implementation phase
Description
🤖 Phase 4 for the EEGBrowser epic. Target branch: feature/eegbrowser-completion.
Dependency
Start after Phases 2 and 3 merge.
Goal
Replace current pop_eegplot placeholders with working menu, API, GUI, history, and console workflows.
Implementation scope
- Implement
pop_eegplot(EEG, icacomp=1, superpose=0, reject=1, ...). - Wire Tools > Inspect/reject data by eye.
- Wire Plot > Channel data (scroll).
- Wire Plot > Component activations (scroll).
- Wire Reject by inspection data/ICA menu paths.
- Support
return_com=True, valid Python console echo, GUI command echo,EEGPrepSessionupdates,ALLCOM/LASTCOM, andeegprep-consolemixed use. - Remove
pop_eegplotfrom browser exclusion metadata only once all menu variants work.
Acceptance criteria
- Every
pop_eegplot:*menu action opens the correct browser mode and enabled state. - Continuous reject creates a new/updated dataset like EEGLAB’s
pop_eegplotflow. - Epoched mark/update and reject flows update
EEG.rejectfields or remove epochs as EEGLAB does. - Component mode requires ICA and shows clear user-facing errors when ICA is missing.
- Console and GUI stay synchronized after accept, reject, cancel, and failed action.
- No runtime code depends on
src/eegprep/eeglab.
Tests and evidence
- Tests for all menu action variants and enabled states.
tests/test_console_workspace.pycoverage for GUI action then console inspection and console action then GUI refresh/history.- Sample-data GUI flows.
- MATLAB parity where deterministic.
- Visual parity screenshots attached to the phase PR as GitHub user attachments.
uv run --no-sync ruff check .uv run --no-sync ruff format --check .uv run --no-sync ty check- Focused pytest for changed tests.
/goal prompt
/goal Implement pop_eegplot and all main-window menu paths from this issue. Preserve EEGLAB command/history behavior while integrating with EEGPrepSession and eegprep-console. Remove placeholder/exclusion metadata only when all menu variants work. Verify with sample_data GUI flows, console workspace tests, MATLAB parity where deterministic, visual parity screenshots, ruff/format/ty, and focused pytest.
Required references for every phase
AGENTS.md.agents/skills/eegprep-feature-development/SKILL.md.agents/skills/eeglab-gui-visual-parity/SKILL.mdfor GUI features.agents/skills/gui-agent-flow-qa/SKILL.mdfor end-user flow QA- EEGLAB reference under
src/eegprep/eeglab, used only as development/parity input.
Core EEGLAB references
src/eegprep/eeglab/functions/sigprocfunc/eegplot.msrc/eegprep/eeglab/functions/sigprocfunc/eegplotlegacy.msrc/eegprep/eeglab/functions/sigprocfunc/eegplot2event.msrc/eegprep/eeglab/functions/sigprocfunc/eegplot2trial.msrc/eegprep/eeglab/functions/sigprocfunc/trial2eegplot.msrc/eegprep/eeglab/functions/popfunc/pop_eegplot.msrc/eegprep/eeglab/functions/popfunc/eeg_rejmacro.msrc/eegprep/eeglab/functions/popfunc/eeg_multieegplot.m
Metadata
Metadata
Assignees
Labels
phaseEpic implementation phase
Activity
claude commentedon May 31, 2026
🤖 Plan:
Research
Phase 4 of epic #94. Issue explicitly states "Start after Phases 2 and 3 merge." Phases 1 (#95), 2 (#96), 3 (#97) are still open issues with no PRs, so this phase is blocked on its prerequisites: shared browser state/rendering/
eegplotAPI (Phase 1), browser UI shell and menus (Phase 2), andwinrej/rejection-conversion semantics (Phase 3). Implementing Phase 4 before they land would force ad-hoc redefinition of all three contracts.Scope is also well over the 100-line agent-fix threshold:
pop_eegplotwith 5 menu variants, continuous reject vs. epoched mark/update/reject, ICA-mode gating, history+ALLCOM/LASTCOMecho,EEGPrepSessionsync, plus MATLAB parity, console-workspace tests, sample-data GUI flows, and visual parity captures.Current placeholder surface
src/eegprep/functions/guifunc/menu_placeholders.py#L39—pop_eegplotflagged aseegbrowserexclusion; remove only after all menu variants work.src/eegprep/functions/guifunc/eeglab_menu.py#L161,172,197,231,254— five menu actions wired as placeholders:pop_eegplot:data,:reject_data,:reject_ica,:channels,:components.src/eegprep/functions/guifunc/eeglab_menu.py#L406—pop_eegplot:datais the anchor for clean_rawdata insertion; ordering must be preserved when wiring real actions.pop_eegplot.pyexists yet underfunctions/popfunc/; no Python references toEEGBrowserexist.origin/feature/eegbrowser-completionexists but contains no EEGBrowser commits yet (latest commits are STUDY work).Proposed approach (for human review — no PR)
This is design-level work that should not start until prerequisite PRs land. Recommended path:
Block until Phases 1–3 merge. Phase 4 depends on the
eegplotAPI surface, dialog shell, andwinrejsemantics defined by those phases. Starting now means re-inventing those contracts and then re-doing the integration once they land.When unblocked, implement in
src/eegprep/functions/popfunc/pop_eegplot.pyas the dispatch entry point that mirrors EEGLAB'spop_eegplot.mflow:pop_eegplot(EEG, icacomp=1, superpose=0, reject=1, *, topcommand=None, return_com=False, **eegplot_kwargs)matching the MATLAB signature.icacomp(1=data, 0=ICA) and onreject/dataset epoching to choose continuous-reject vs. epoched mark/update flows.eeg_rejmacro-equivalent callback in Python that convertswinrej(from Phase 3) into eitherpop_select-based continuous rejection orEEG.reject.rej*updates / epoch removal for epoched data.(EEG, com)wherecomis a valid Python echo (pop_eegplot(EEG, 1, 0, 1, ...)), consumed byeegprep-consoleauto-store andLASTCOM/ALLCOM.Menu wiring in
eeglab_menu.py. Replace the five placeholder actions with handlers that:pop_eegplot:data→pop_eegplot(EEG, icacomp=1, reject=0)(Plot › Channel data scroll, no reject UI).pop_eegplot:channels→ same dispatch but launched from Plot menu (parity with EEGLAB's two entry points).pop_eegplot:components→pop_eegplot(EEG, icacomp=0, reject=0), ICA-gated.pop_eegplot(EEG, icacomp=1, reject=1).:reject_data/:reject_ica→ epoched reject-by-inspection paths (icacomp 1/0,reject=1).EEG.icaweightsis empty.Session/console sync. Use
EEGPrepSession.store_current,add_history, andnotify_changedfor any path that mutatesEEG(continuous reject, epoch removal,EEG.rejectupdates). Tests must cover both directions: GUI action → console namespace; console call → GUI refresh.Remove the
eegbrowserexclusion inmenu_placeholders.pyonly after every variant works end-to-end and tests pass. Update the placeholder map intests/conftest.pyif marker categorization changes.Tests (
tests/test_pop_eegplot.pynew; extendtests/test_console_workspace.py):winrej(MATLAB parity, deterministic).EEG.reject.rejmanualand friends; epoched reject removes the right trials.pop_eegplot(EEG, 1, 0, 1, ...)auto-stores and updatesLASTCOM/ALLCOM; GUI refresh after console mutation..agents/skills/eeglab-gui-visual-parityattached as PR user attachments (not committed)..agents/skills/gui-agent-flow-qafor the five menu paths.Why no PR now: (a) prerequisite phases are unmerged and unimplemented; (b) the change is multi-module, well beyond the 100-line agent-fix threshold; (c) this issue's acceptance criteria require Phase 3's
winrejsemantics and Phase 1/2's browser shell, neither of which exists yet.Recommended next step for a human: drive Phases 1–3 to PR first, then re-open this issue for Phase 4 implementation (or run the
/goalprompt against an interactive session once prerequisites land).