Skip to content

StreamComparePane's per-pane "Remove" button actually exits the entire compare view instead of removing just that pane #1060

Description

@mikewheeleer

Description

src/components/StreamComparePane.tsx renders a "Remove" button on each of the two comparison panes with a per-stream aria-label:

<button
  type="button"
  className={styles.removeBtn}
  aria-label={`Remove ${stream?.name ?? streamId} from comparison`}
  onClick={onRemove}
  title="Remove pane"
/>

but the two handlers wired to onRemove for each pane both do the same, whole-view-exiting thing:

function handleRemoveLeft() {
  onExit();
}

function handleRemoveRight() {
  onExit();
}

The button's aria-label and title ("Remove pane") clearly communicate single-pane removal — replacing that one stream while keeping the other pane and staying in compare mode — but the actual behavior calls onExit() from either pane, which fully exits compare mode back to the streams table regardless of which "Remove" button was clicked. A user comparing streams A and B who clicks "Remove" intending to swap out just stream A loses their entire comparison session instead.

Requirements

  • Clicking "Remove" on one pane must remove only that pane's stream, keeping the user in compare mode with the other pane still shown (e.g. prompting for a replacement stream, or collapsing to a single-pane view), rather than calling onExit().
  • If genuinely removing a pane always requires exiting compare mode entirely in the current architecture (i.e. there's no single-pane compare state), the button's label/behavior must be made honest — e.g. relabel it "Exit comparison" — rather than implying partial removal it doesn't perform.

Suggested execution

  1. Decide the intended UX: either (a) implement real single-pane removal (e.g. clearing just ids[0] or ids[1] and prompting to pick a replacement stream, keeping onExit reserved for the toolbar's "← Back" button only), or (b) if single-pane removal isn't supported by design, change the per-pane button's aria-label/title to accurately describe "Exit comparison" instead of claiming to remove just one stream.
  2. Update handleRemoveLeft/handleRemoveRight in StreamComparePane.tsx to match the decided behavior.
  3. Add a test asserting clicking the left pane's Remove button does not equally exit when the right pane's Remove button is clicked (if single-pane removal is implemented), or asserting the label accurately reflects "exit" behavior (if not).

Acceptance criteria

  • The per-pane "Remove" button's actual behavior matches what its aria-label/title claims.
  • Compare-mode exit still works correctly via the toolbar's "← Back" button.
  • A test covers the corrected behavior.

Security notes

None; functional/UX correctness fix.

Guidelines

  • Minimum 95% test coverage
  • Timeframe: 96 hours

Metadata

Metadata

Assignees

No one assigned

    Labels

    GRANTFOX OSSGrantFox open-source campaign taskMAYBE REWARDEDMay be rewarded under the GrantFox campaignOfficial Campaign | FWC26GrantFox FWC26 official campaignbugSomething isn't workingfrontend

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions