Skip to content

Phase 2: Core browser UI, navigation, menus, and visual shell parity #96

Closed

Description

@suraj-ranganath

🤖 Phase 2 for the EEGBrowser epic. Target branch: feature/eegbrowser-completion.

Dependency

Start after Phase 1 merges. This can run in parallel with Phase 3.

Goal

Implement the visible browser experience that users interact with directly, matching EEGLAB layout and controls while keeping EEGPrep responsive and standalone.

Implementation scope

  • Main browser window matching EEGLAB controls: activity plot, time/channel labels, event types, navigation buttons, position field, scale field, +/- scale, stack/spread, norm/denorm, cancel, and reject/update button when applicable.
  • Browser menus: Figure, Display, Settings, Help.
  • Menu behavior for grids, title, events, channel labels, marking color, time range, displayed channels, zoom toggle, scale display, and print/edit-figure equivalents where feasible.
  • Keyboard shortcuts matching EEGLAB navigation where practical.
  • Iterative visual parity using .agents/skills/eeglab-gui-visual-parity/SKILL.md.

Acceptance criteria

  • Side-by-side visual parity captures exist for continuous channel data, epoched data, event overlay, grid on/off, and channel labels.
  • Controls are aligned, spaced, enabled, disabled, and named like EEGLAB while using EEGPrep branding.
  • Browser remains responsive on sample_data/eeglab_data.set.
  • Tests cover button/menu state changes and visible state updates.
  • No runtime code depends on src/eegprep/eeglab.

Tests and evidence

  • GUI tests for navigation buttons, menu toggles, fields, scale controls, stack/spread, norm/denorm, and close/cancel behavior.
  • 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 the EEGBrowser/eegplot visual shell and navigation controls from this issue. Match EEGLAB UI layout, menus, keyboard navigation, scale/grid/event/channel-label controls, and visual behavior using iterative eeglab-gui-visual-parity captures. Verify with GUI tests, visual screenshots, sample_data, 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.md for GUI features
  • .agents/skills/gui-agent-flow-qa/SKILL.md for 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.m
  • src/eegprep/eeglab/functions/sigprocfunc/eegplotlegacy.m
  • src/eegprep/eeglab/functions/sigprocfunc/eegplot2event.m
  • src/eegprep/eeglab/functions/sigprocfunc/eegplot2trial.m
  • src/eegprep/eeglab/functions/sigprocfunc/trial2eegplot.m
  • src/eegprep/eeglab/functions/popfunc/pop_eegplot.m
  • src/eegprep/eeglab/functions/popfunc/eeg_rejmacro.m
  • src/eegprep/eeglab/functions/popfunc/eeg_multieegplot.m

Activity

  1. added
    phase
    on May 31, 2026
  2. claude commented on May 31, 2026

    @claude
    Contributor

    🤖 Plan:

    • Read issue and required skills (fix-issue, pull-request, eeglab-gui-visual-parity)
    • Duplicate-work preflight (no open PR for this phase or for feature/eegbrowser-completion; tip is STUDY work 5f38bff)
    • Verify dependency status
    • Survey current EEGPrep surface for eegplot/EEGBrowser
    • Post analysis (no PR — scope > 100 lines and Phase 1 not merged)

    Research

    Phase 2 is blocked: Phase 1 (#95) is still OPEN with no PR, and this issue explicitly says "Start after Phase 1 merges." There is no eegplot Python module yet — pop_eegplot is currently an explicit exclusion placeholder (src/eegprep/functions/guifunc/menu_placeholders.py:39, message at L62-66), so Phase 2 has nothing to build the visible shell on top of. Scope (visual shell + 4 menus + keyboard nav + scale/stack/spread + visual parity captures + GUI tests across continuous/epoched/event/grid/label) is multi-module and clearly >100 lines, so per the agent instructions this requires a human-reviewed design comment, not a PR.

    Also worth flagging: src/eegprep/eeglab is registered as a submodule (-420769355b4e...) but is empty in this checkout, so the EEGLAB .m references named in the issue (eegplot.m, eegplotlegacy.m, pop_eegplot.m, eeg_rejmacro.m, eeg_multieegplot.m) are not browsable from this workspace. Whoever picks this up will need the submodule populated for parity work.

    Relevant code

    • src/eegprep/functions/guifunc/menu_placeholders.py#L39 — current pop_eegplot exclusion to flip once Phase 1 lands
    • src/eegprep/functions/guifunc/main_window.py, menu_spec.py, menu_actions.py — where Figure/Display/Settings/Help menu wiring lives
    • src/eegprep/functions/guifunc/visual_capture.py — existing capture harness reused for visual parity loop
    • src/eegprep/functions/sigprocfunc/ — target dir for eegplot.py rendering helpers (no entry today)
    • src/eegprep/functions/popfunc/_rejection.py — existing rejection plumbing the eventual reject/update button will touch

    Proposed Approach (for human review)

    Treat this as a design checkpoint until Phase 1 merges. Recommended split when work starts:

    1. Window shell module src/eegprep/functions/guifunc/eegplot_window.py consuming the Phase 1 eegplot(...) data/state model. Top toolbar: time/channel labels, event-type legend, prev/next/page nav, position field, scale field, +/− scale, stack/spread, norm/denorm, cancel, reject/update. Layout owned by a single QGridLayout so visual-parity tweaks stay local. EEGLAB parity reference: eegplot.m figure + uicontrol block (button names/positions are the parity oracle).
    2. Menu factories in src/eegprep/functions/guifunc/eegplot_menus.py (Figure / Display / Settings / Help). Each item produced as a QAction with an action_id matching EEGLAB callback strings so future flow-QA can drive by name. Help wired to src/eegprep/resources/help/eegplot.md (new file owned by EEGPrep, not the EEGLAB checkout).
    3. Keyboard shortcuts: map left/right/page/home/end and scale +/− on the window via QShortcut. Keep the table in one constant dict for parity diffing.
    4. Tests added to tests/test_eegplot_window.py (button enable/disable per data shape, nav updates state, menu toggles flip rendered state, close/cancel exits without mutating EEG). Use pytestmark = pytest.mark.gui and the existing offscreen Qt fixtures.
    5. Visual parity: drive eeglab-gui-visual-parity for the five required cases (continuous, epoched, event overlay, grid on/off, channel labels) on sample_data/eeglab_data.set; attach screenshots as PR-comment user attachments per AGENTS.md (do not commit them).
    6. Flip the pop_eegplot placeholder from excluded_reason="eegbrowser" to a phase entry only once the window can actually open from the menu.

    Estimated change: ~600-900 LOC across ~6 new files plus the placeholder flip. That puts the eventual PR in spec-required territory (pull-request skill §Specifications >500 LOC) — the spec belongs in this issue body before implementation.

    Open Questions

    1. Should the window be a top-level QMainWindow or embed inside an existing EEGPrep dock? eegplot.m is always a standalone figure; EEGPrep currently has no dock equivalent.
    2. Rendering: stay Qt-native (QPainter/QGraphicsView) as Phase 1 mandates, or is pyqtgraph permitted if Qt-native fails the responsiveness bar on sample_data/eeglab_data.set (~30 channels, ~30 s windows)? Phase 1 reserves this decision but Phase 2 inherits it.
    3. EEGLAB "Edit figure" / "Print" menu items have no Qt-native analogue. Skip them, replace with EEGPrep equivalents (Export PNG / Copy to clipboard), or stub with placeholder messages?
    4. Keyboard map source of truth — is there an existing EEGPrep shortcut convention I should align with, or define a new constant table here?

    Not opening a PR. Recommend: land Phase 1 (#95), answer 1-4, then this becomes a spec'd implementation PR against feature/eegbrowser-completion.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

phase

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions