Skip to content

The fastest, cheapest, most efficient open-source agent harness. Run more than 500 agents on a $10 VPS.

fix(ui): add explicit onClick handler to ChipTabs for test compatibility

Steven Enamakela23c7e93802e
diff --git a/app/src/components/layout/ChipTabs.tsx b/app/src/components/layout/ChipTabs.tsx
index 2d8f7c474d..f4dde6de8a 100644
--- a/app/src/components/layout/ChipTabs.tsx
+++ b/app/src/components/layout/ChipTabs.tsx
@@ -160,6 +160,18 @@ export default function ChipTabs<T extends string>({
data-testid={chipTestId}
id={item.labelledBy}
aria-controls={item.controls}
+ // Radix selects on `onMouseDown` (real pointer interaction), not
+ // `onClick` — `fireEvent.click()` in RTL fires only a `click`
+ // event with no preceding `mousedown`, so relying on Radix's
+ // built-in activation alone leaves every `fireEvent.click(chip)`
+ // test across the app selecting nothing. Firing `onChange`
+ // directly here covers both: real pointer users hit
+ // `onMouseDown` (redundant, same value) and `click`-only
+ // dispatchers hit this.
+ onClick={() => {
+ debug('select', { id: item.id });
+ onChange(item.id);
+ }}
className={cn(baseChipClass, spacingClass, inactiveChipClass, activeChipClass)}>
{item.label}
</TabsTrigger>