Skip to content

Device details page: agent order device tab#2004

Merged
romanivan-flamingo merged 5 commits into
mainfrom
hotfix/agent-order-device-tab
Jun 26, 2026
Merged

Device details page: agent order device tab#2004
romanivan-flamingo merged 5 commits into
mainfrom
hotfix/agent-order-device-tab

Conversation

@romanivan-flamingo

@romanivan-flamingo romanivan-flamingo commented Jun 26, 2026

Copy link
Copy Markdown
Contributor

Description

Agent order device tab (sort by agentType)

Task

Agent Order Randomly Changes in Device Tab

Summary by CodeRabbit

  • Bug Fixes
    • Improved agent ordering in the Devices view by sorting consistently alphabetically by agent type.
    • Added a stable tie-break when multiple agents share the same type, using agent tool identifier (when available), reducing unexpected reordering across refreshes.

romanivan-flamingo and others added 2 commits June 26, 2026 13:07
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>
@coderabbitai

coderabbitai Bot commented Jun 26, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 01592842-c683-4523-ba72-9408e84b245e

📥 Commits

Reviewing files that changed from the base of the PR and between c1bdac6 and 6966013.

📒 Files selected for processing (1)
  • openframe/services/openframe-frontend/src/app/(app)/devices/components/tabs/agents-tab.tsx
🚧 Files skipped from review as they are similar to previous changes (1)
  • openframe/services/openframe-frontend/src/app/(app)/devices/components/tabs/agents-tab.tsx

📝 Walkthrough

Walkthrough

The devices agents tab now sorts the combined agent list by agentType, then by agentToolId when types match, using localeCompare for deterministic ordering.

Changes

Agents tab ordering

Layer / File(s) Summary
Combined agent sorting
openframe/services/openframe-frontend/src/app/(app)/devices/components/tabs/agents-tab.tsx
combinedAgents now sorts by agentType alphabetically with localeCompare, then by agentToolId as a tie-breaker with missing values treated as ''.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~5 minutes

Poem

🐇 I hopped through the list with a tidy little grin,
Sorting the agents from alpha to zen.
With a second small nudge when the types agree,
The order stays steady as steady can be.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title is related to the main change and clearly points to agent ordering in the device tab.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch hotfix/agent-order-device-tab

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@romanivan-flamingo romanivan-flamingo changed the title Hotfix/agent order device tab Device details page: agent order device tab Jun 26, 2026
@romanivan-flamingo romanivan-flamingo enabled auto-merge (squash) June 26, 2026 11:15
@romanivan-flamingo romanivan-flamingo self-assigned this Jun 26, 2026

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

📥 Commits

Reviewing files that changed from the base of the PR and between 71a9e6d and c1bdac6.

📒 Files selected for processing (1)
  • openframe/services/openframe-frontend/src/app/(app)/devices/components/tabs/agents-tab.tsx

romanivan-flamingo and others added 3 commits June 26, 2026 14:25
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>
@romanivan-flamingo romanivan-flamingo merged commit da02b7c into main Jun 26, 2026
29 checks passed
@romanivan-flamingo romanivan-flamingo deleted the hotfix/agent-order-device-tab branch June 26, 2026 13:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants