Evals UI: maintaining page name change consistency#55
Conversation
📝 WalkthroughWalkthroughThis PR renames UI tab identifiers from "upload"/"results" to "datasets"/"evaluations" across the evaluations pages, updating navigation targets, component names, interface definitions, and user-facing labels accordingly. Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Possibly related PRs
Suggested labels
Suggested reviewers
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
🧹 Nitpick comments (2)
app/evaluations/page.tsx (2)
34-38: Consider preserving legacytabquery aliases for deep-link compatibility.
?tab=upload/?tab=resultslinks now fall back todatasets. Mapping legacy values prevents broken bookmarks and older shared links.Suggested patch
const [activeTab, setActiveTab] = useState<Tab>(() => { const tabParam = searchParams.get('tab'); - return (tabParam === 'evaluations' || tabParam === 'datasets') ? tabParam as Tab : 'datasets'; + const normalizedTab = + tabParam === 'upload' ? 'datasets' + : tabParam === 'results' ? 'evaluations' + : tabParam; + return (normalizedTab === 'evaluations' || normalizedTab === 'datasets') + ? normalizedTab + : 'datasets'; });🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@app/evaluations/page.tsx` around lines 34 - 38, activeTab initialization currently only accepts 'evaluations' or 'datasets' and treats any other value as 'datasets', which breaks legacy links; update the initializer for activeTab (the useState block referencing searchParams.get('tab')) to map legacy aliases: treat 'upload' as 'datasets' and 'results' as 'evaluations' (e.g., normalize tabParam via a small map or switch before the existing ternary), then cast/return the normalized value so setActiveTab and subsequent logic continue to work with 'datasets'/'evaluations'.
269-272: Sync URL when switching to the Evaluations tab after job creation.Line 271 updates only component state; URL can stay stale (
?tab=datasetsor no tab), which hurts refresh/share/back behavior.Suggested patch
- setActiveTab('evaluations'); + setActiveTab('evaluations'); + router.replace('/evaluations?tab=evaluations');🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@app/evaluations/page.tsx` around lines 269 - 272, After creating the job you only update component state with setIsEvaluating(false) and setActiveTab('evaluations') but don't update the URL, leaving the query stale; update the URL query to include tab=evaluations so refresh/share/back reflect the new tab. Use the router from Next (e.g., useRouter from next/navigation) or the project's route helper and call router.replace or router.push to set the current query param to tab=evaluations (preserving other query params) immediately after calling setActiveTab('evaluations'); ensure you preserve existing params and prefer replace if you don't want an extra history entry.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@app/evaluations/page.tsx`:
- Around line 483-485: Update the remaining UI copy that still uses “results” to
the new terminology “evaluations”: change the list item string "View detailed
results and metrics in the Evaluations tab" and the label "View Results" to use
"evaluations" (e.g., "View detailed evaluations and metrics in the Evaluations
tab" and "View Evaluations") so the rename is consistent across the page.tsx UI.
Locate these exact text literals in app/evaluations/page.tsx and update them
accordingly.
---
Nitpick comments:
In `@app/evaluations/page.tsx`:
- Around line 34-38: activeTab initialization currently only accepts
'evaluations' or 'datasets' and treats any other value as 'datasets', which
breaks legacy links; update the initializer for activeTab (the useState block
referencing searchParams.get('tab')) to map legacy aliases: treat 'upload' as
'datasets' and 'results' as 'evaluations' (e.g., normalize tabParam via a small
map or switch before the existing ternary), then cast/return the normalized
value so setActiveTab and subsequent logic continue to work with
'datasets'/'evaluations'.
- Around line 269-272: After creating the job you only update component state
with setIsEvaluating(false) and setActiveTab('evaluations') but don't update the
URL, leaving the query stale; update the URL query to include tab=evaluations so
refresh/share/back reflect the new tab. Use the router from Next (e.g.,
useRouter from next/navigation) or the project's route helper and call
router.replace or router.push to set the current query param to tab=evaluations
(preserving other query params) immediately after calling
setActiveTab('evaluations'); ensure you preserve existing params and prefer
replace if you don't want an extra history entry.
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: d6e10264-a0ce-4b06-a10b-d3cf05e731ef
📒 Files selected for processing (2)
app/evaluations/[id]/page.tsxapp/evaluations/page.tsx
| <li>Wait for processing to complete (automatic redirect to evaluations tab)</li> | ||
| <li>View detailed results and metrics in the Evaluations tab</li> | ||
| </ol> |
There was a problem hiding this comment.
Terminology consistency is still partial (results remains in UI copy).
Line 484 still says “View detailed results…”, and there is another remaining label at Line 1195 (“View Results”). If this PR’s goal is full rename consistency, these should be updated too.
Suggested patch
- <li>View detailed results and metrics in the Evaluations tab</li>
+ <li>View detailed evaluations and metrics in the Evaluations tab</li>- View Results
+ View Evaluation📝 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.
| <li>Wait for processing to complete (automatic redirect to evaluations tab)</li> | |
| <li>View detailed results and metrics in the Evaluations tab</li> | |
| </ol> | |
| <li>Wait for processing to complete (automatic redirect to evaluations tab)</li> | |
| <li>View detailed evaluations and metrics in the Evaluations tab</li> | |
| </ol> |
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.
In `@app/evaluations/page.tsx` around lines 483 - 485, Update the remaining UI
copy that still uses “results” to the new terminology “evaluations”: change the
list item string "View detailed results and metrics in the Evaluations tab" and
the label "View Results" to use "evaluations" (e.g., "View detailed evaluations
and metrics in the Evaluations tab" and "View Evaluations") so the rename is
consistent across the page.tsx UI. Locate these exact text literals in
app/evaluations/page.tsx and update them accordingly.
Target issue is #57
Notes
This PR addresses terminology inconsistencies in the text evaluation UI that were missed during the initial renaming from "upload" → "datasets" and "results" → "evaluations".
These changes ensure consistent naming across the entire text evaluation feature.
Changes made -
Context
These updates were deprioritized during the demo rush but are important for maintaining a consistent user experience.