fix(webui): File Browser row-click selects the file, not just preview#1734
Conversation
Row click on a file now toggles selection so Index Selected and Ask Agent become active without needing to find the checkbox. Preview is still available via the per-row Eye icon that appears on hover/focus. The shared toggleSelection helper DRYs up the checkbox handler.
Review: fix(webui): File Browser row-click selects the fileSummarySolid, well-scoped fix for a real discoverability bug (#1562): clicking a file row now selects it instead of opening a preview, so Index Selected / Ask Agent enable on the obvious gesture, and preview moves to an explicit eye icon. The change is small, the duplicated checkbox-toggle logic is correctly extracted into one Issues🟢 Row is click-only, not keyboard-operable ( 🟢 Unsupported files are now selectable by row-click ( Strengths
VerdictApprove. No blocking issues; the two notes are optional follow-ups. Test plan (RTL suite, Note: I couldn't execute the test suite in the review environment ( |
kovtcharov-amd
left a comment
There was a problem hiding this comment.
Clean, focused fix. Row click now toggles selection; preview correctly moved to an explicit eye icon with stopPropagation on both the checkbox and preview button so there's no double-toggle. Good RTL coverage (row-select, preview-without-select, checkbox regression guard). All checks green. LGTM.
Closes #1562
Why this matters
Before: in the Agent UI File Browser, clicking a file row only opened a preview — it never selected the file. Selection was possible only through the tiny per-row checkbox, so a user who clicked a file the natural way saw a preview, assumed the file was selected, and found Index Selected and Ask Agent greyed out with no hint why. The core index→ask workflow was effectively undiscoverable unless you guessed the checkbox or used drag-and-drop.
After: clicking a file row selects it — the obvious gesture — so the action buttons enable immediately. Preview moves to an explicit per-row eye icon: still one click, just no longer conflated with selection.
Real-world verification
Production build served by
gaia.ui.serverand driven in a real browser on an AMD Ryzen AI box.Before — nothing selected, both buttons disabled:
After clicking the file row — file selected (checkbox ticked, "1 item(s) selected"), Index Selected + Ask Agent enabled:
The new eye icon previews without selecting — the previewed file stays unchecked and the selection count is unchanged:
Test plan
cd src/gaia/apps/webui && npm run test -- FileBrowser— new RTL test, 3 cases: row-click selects → buttons enable; eye icon previews without selecting; checkbox still togglesnpm test— full suite green (65 tests, +3 new)npx tsc --noEmit— clean