Config Listing Page: Show All Vector Stores in the Config Card Listing Page#34
Config Listing Page: Show All Vector Stores in the Config Card Listing Page#34Prajna1999 merged 2 commits intomainfrom
Conversation
📝 WalkthroughWalkthroughA React component has been enhanced to display Tools and Vector Stores sections within ConfigCard. The update introduces state hooks to toggle visibility of Tools dropdown and a nested Vector Stores subsection, while aggregating knowledge base IDs from all configured tools for display. Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~12 minutes Poem
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ 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
🤖 Fix all issues with AI agents
In `@app/components/ConfigCard.tsx`:
- Around line 148-151: The conditional rendering for tool.max_num_results
currently uses a truthy check which hides valid zero values; update the check in
ConfigCard (where it reads {tool.max_num_results && (...)}) to explicitly test
for null/undefined (e.g., tool.max_num_results != null or typeof
tool.max_num_results !== 'undefined') so that 0 is rendered correctly while
still omitting absent values.
🧹 Nitpick comments (1)
app/components/ConfigCard.tsx (1)
109-118: Use functional toggle updates and expose state via ARIA.
Functional updates prevent stale state in React's batching and concurrent rendering, and ARIA attributes improve accessibility for screen readers on collapsible sections.✅ Suggested patch
- <button - onClick={() => setShowTools(!showTools)} + <button + onClick={() => setShowTools(prev => !prev)} + aria-expanded={showTools} + aria-controls={`config-${latestVersion.config_id}-tools`} className="w-full flex items-center justify-between px-2.5 py-1.5 rounded-md text-xs transition-colors" style={{ backgroundColor: colors.bg.secondary, border: `1px solid ${colors.border}`, }} > @@ - {showTools && ( - <div + {showTools && ( + <div + id={`config-${latestVersion.config_id}-tools`} className="mt-1 p-2 rounded-md text-xs space-y-2" style={{ backgroundColor: colors.bg.secondary, border: `1px solid ${colors.border}`, }} > @@ - <button - onClick={() => setShowVectorStores(!showVectorStores)} + <button + onClick={() => setShowVectorStores(prev => !prev)} + aria-expanded={showVectorStores} + aria-controls={`config-${latestVersion.config_id}-vector-stores`} className="w-full flex items-center justify-between px-2 py-1 rounded-md transition-colors" style={{ backgroundColor: colors.bg.primary, }} > @@ - {showVectorStores && ( - <div + {showVectorStores && ( + <div + id={`config-${latestVersion.config_id}-vector-stores`} className="mt-1 p-2 rounded-md space-y-1" style={{ backgroundColor: colors.bg.primary, color: colors.text.primary, }} >Also applies to: 131-137, 165-174, 186-192
| {tool.max_num_results && ( | ||
| <div style={{ color: colors.text.secondary }}> | ||
| Max Results: {tool.max_num_results} | ||
| </div> |
There was a problem hiding this comment.
Render max_num_results when the value is 0.
The current truthy check hides valid zero values. Use a null/undefined check instead.
✅ Suggested patch
- {tool.max_num_results && (
+ {tool.max_num_results != null && (
<div style={{ color: colors.text.secondary }}>
Max Results: {tool.max_num_results}
</div>
)}📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| {tool.max_num_results && ( | |
| <div style={{ color: colors.text.secondary }}> | |
| Max Results: {tool.max_num_results} | |
| </div> | |
| {tool.max_num_results != null && ( | |
| <div style={{ color: colors.text.secondary }}> | |
| Max Results: {tool.max_num_results} | |
| </div> | |
| )} |
🤖 Prompt for AI Agents
In `@app/components/ConfigCard.tsx` around lines 148 - 151, The conditional
rendering for tool.max_num_results currently uses a truthy check which hides
valid zero values; update the check in ConfigCard (where it reads
{tool.max_num_results && (...)}) to explicitly test for null/undefined (e.g.,
tool.max_num_results != null or typeof tool.max_num_results !== 'undefined') so
that 0 is rendered correctly while still omitting absent values.
Target issue #38
Earlier, in the config card listing page, tools and their corresponding vector store ids were not visible. It was creating issues for the user to ascertain which vector stores the config is taking in.
Summary by CodeRabbit