Device details page: agent order device tab#2004
Conversation
Agent cards in the device tab changed order randomly on each reload because the sort relied on agentToolId grouping with no stable tiebreaker. Sort agents alphabetically by agentType so the list is stable and predictable. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
📝 WalkthroughWalkthroughThe devices agents tab now sorts the combined agent list by ChangesAgents tab ordering
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~5 minutes Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 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
`@openframe/services/openframe-frontend/src/app/`(app)/devices/components/tabs/agents-tab.tsx:
- Around line 107-108: The sorting in agents-tab.tsx only uses agentType in the
combinedAgents.sort comparator, so equal types can still reorder based on API
response order. Update the combinedAgents construction to carry a stable
upstream identifier, then revise the sort logic in the agents-tab component to
compare agentType first and that stable id second, ensuring deterministic
ordering across reloads even when agentType matches.
🪄 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: defaults
Review profile: CHILL
Plan: Pro Plus
Run ID: 5078d20a-b419-4208-b4fe-493c59723685
📒 Files selected for processing (1)
openframe/services/openframe-frontend/src/app/(app)/devices/components/tabs/agents-tab.tsx
Equal agentType values could still reorder by API response order. Add agentToolId as a deterministic secondary sort key so the agent list is fully stable across reloads. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Description
Agent order device tab (sort by agentType)
Task
Agent Order Randomly Changes in Device Tab
Summary by CodeRabbit