webui: wire up topbar search and fetch foreign ID matches server-side#197
Conversation
The topbar search input had no handlers, so typing into it never triggered a request. It is now bound to the same foreign ID filter as the filter bar. The runs list only fetched the newest 500 records and filtered client-side, so any older run was unfindable by foreign ID. When a foreign ID is set, the frontend now also requests exact matches via filter_by_foreign_id and merges them into the result set. The refetch is debounced by 300ms to avoid a request per keystroke. Also corrects the search placeholder and shortcut hint: the input searches foreign IDs and the implemented focus shortcut is '/', not Cmd+K. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughThe Runs UI adds a controlled foreign-ID search input to the top bar. App debounces filter changes by 300 milliseconds before fetching and ignores stale asynchronous responses. Run-list fetching requests both the newest base list and a server-filtered list, then merges results by Estimated code review effort: 3 (Moderate) | ~20 minutes Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@adapters/webui/internal/frontend/home.html`:
- Around line 1906-1912: Update the doFetch callback to track the active request
with a useRef and assign each invocation a unique request identifier. Only apply
apiFetchRuns results or errors when the response belongs to the latest request,
while preserving loading cleanup for the active request; import useRef from
React if needed.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: 6eb9714c-cba2-4317-93f8-7e46bc1a08cc
📒 Files selected for processing (1)
adapters/webui/internal/frontend/home.html
Debounced search fetches can overlap with polling fetches, and a stale response resolving late would overwrite fresher results. Track the active request with a monotonic ID so only the latest response writes state. Addresses CodeRabbit review feedback. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
|



Summary
valueoronChangehandlers, so typing into it never sent a requestfilter_by_foreign_idand merge them into the base list byrun_id, so runs older than the newest 500 are findable by full foreign ID/(the implemented focus shortcut) instead of Cmd+KWhat changed
adapters/webui/internal/frontend/home.html: splitapiFetchRunsintoapiFetchListplus a merging wrapper, add debouncedfilters.foreignIdstate feedingdoFetch, wireTopbarsearch to the shared filter stateVerification
_examples/webui: typingCustomer 2into the topbar search sends{"filter_by_foreign_id":"Customer 2"}to the list endpoint and the table narrows to that run; the same interaction on the previous code sent no request at allgo build ./...andgo test ./...pass inadapters/webui; all embedded JSX blocks compile under BabelLimitations
🤖 Generated with Claude Code
Summary by CodeRabbit
New Features
Performance