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
- 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.
- Update
handleRemoveLeft/handleRemoveRight in StreamComparePane.tsx to match the decided behavior.
- 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
Security notes
None; functional/UX correctness fix.
Guidelines
- Minimum 95% test coverage
- Timeframe: 96 hours
Description
src/components/StreamComparePane.tsxrenders a "Remove" button on each of the two comparison panes with a per-stream aria-label:but the two handlers wired to
onRemovefor each pane both do the same, whole-view-exiting thing:The button's
aria-labelandtitle("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 callsonExit()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
onExit().Suggested execution
ids[0]orids[1]and prompting to pick a replacement stream, keepingonExitreserved for the toolbar's "← Back" button only), or (b) if single-pane removal isn't supported by design, change the per-pane button'saria-label/titleto accurately describe "Exit comparison" instead of claiming to remove just one stream.handleRemoveLeft/handleRemoveRightinStreamComparePane.tsxto match the decided behavior.Acceptance criteria
aria-label/titleclaims.Security notes
None; functional/UX correctness fix.
Guidelines