Skip to content

Fix: everyday ui bugs - #5194

Merged
mmabrouk merged 2 commits into
big-agentsfrom
minor-ui-fixes-agents
Jul 10, 2026
Merged

Fix: everyday ui bugs#5194
mmabrouk merged 2 commits into
big-agentsfrom
minor-ui-fixes-agents

Conversation

@ashrafchowdury

@ashrafchowdury ashrafchowdury commented Jul 10, 2026

Copy link
Copy Markdown
Contributor

Context

Three small AgentChat rough edges from QA:

  • The copy button on an agent message did nothing when the turn returned only an error (no answer text to copy).
  • Links inside markdown answers opened in the same tab, navigating you away from the chat.
  • The queued messages were displayed even after deleting them
  • Fixed trace drawer pretty data render issue

@vercel

vercel Bot commented Jul 10, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
agenta-documentation Ready Ready Preview, Comment Jul 10, 2026 8:47am

Request Review

@dosubot dosubot Bot added the size:M This PR changes 30-99 lines, ignoring generated files. label Jul 10, 2026
@coderabbitai

coderabbitai Bot commented Jul 10, 2026

Copy link
Copy Markdown
🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 inconclusive)

Check name Status Explanation Resolution
Title check ❓ Inconclusive The title is related to the change, but it is too vague to clearly convey the main AgentChat fixes. Use a specific title like "Fix AgentChat copy, markdown links, and queued message visibility".
✅ Passed checks (4 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
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.
Description check ✅ Passed The description matches the AgentChat UI fixes in the changeset.
✨ 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 minor-ui-fixes-agents

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.

@dosubot dosubot Bot added Bug Report Something isn't working Frontend UX labels Jul 10, 2026

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🧹 Nitpick comments (3)
web/oss/src/components/AgentChatSlice/AgentChatPanel.tsx (1)

1676-1680: 🩺 Stability & Availability | 🔵 Trivial | 💤 Low value

Collapse animation won't play when the queue empties.

QueuedMessages returns null when queued.length === 0, so when the last message is deleted or released, the RevealCollapse grid row height snaps to 0 instantly instead of animating from 1fr0fr over 300ms. The RevealCollapse component's own documentation notes: "Callers that render nothing when 'closed' should latch their last content so it persists through the leave."

This is an intentional trade-off per the PR objective (preventing deleted messages from lingering), so the instant disappearance is acceptable. If you want to preserve the animation without showing deleted messages, consider latching the last non-empty queued array but filtering out any individually removed message IDs from the latched copy.

web/oss/src/components/AgentChatSlice/assets/markdown.tsx (1)

134-139: 🔒 Security & Privacy | 🔵 Trivial | ⚡ Quick win

Move {...rest} before the security-critical attributes to prevent override.

Spreading {...rest} after target="_blank" and rel="noopener noreferrer" means any target or rel value from the markdown renderer would silently override the safe defaults. Reversing the order ensures the security attributes always win. Also consider replacing any with React.ComponentProps<'a'> for type safety.

♻️ Proposed fix
-const Anchor = ({href, children, ...rest}: any) => (
-    <a href={href} target="_blank" rel="noopener noreferrer" {...rest}>
+const Anchor = ({href, children, ...rest}: React.ComponentProps<"a">) => (
+    <a {...rest} href={href} target="_blank" rel="noopener noreferrer">
         {children}
     </a>
 )
web/oss/src/components/AgentChatSlice/components/AgentMessage.tsx (1)

305-319: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low value

Copy logic is correct and well-structured.

copyText properly combines answer and error text, and the early return when empty prevents no-op clipboard writes. The \n\n separator is consistent with how partial output + error is displayed in the bubble.

One minor guideline note: the comment at lines 305-306 spans two lines. As per coding guidelines, in-code comments should be kept to one short line maximum unless a genuinely surprising constraint requires a brief exception. Consider condensing:

📝 Condense comment to one line
-    // Copy the answer; append the error on a failed turn (and copy it alone on an answer-less
-    // failure) so the button isn't a no-op when the agent only returned an error.
+    // Copy answer + error (error alone on answer-less failure) so the button isn't a no-op.
     const copyText = [fullText, errorText].filter(Boolean).join("\n\n")

Source: Coding guidelines


ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: d9e74c12-04c3-46fa-ade8-e3057e358a9d

📥 Commits

Reviewing files that changed from the base of the PR and between ead0700 and ddd2c16.

📒 Files selected for processing (3)
  • web/oss/src/components/AgentChatSlice/AgentChatPanel.tsx
  • web/oss/src/components/AgentChatSlice/assets/markdown.tsx
  • web/oss/src/components/AgentChatSlice/components/AgentMessage.tsx

@mmabrouk

Copy link
Copy Markdown
Member

@ashrafchowdury please from now on One issue == One PR!

Each PR /write-pr-description please a screenshot. Set your goal to the max number of PRs per week. Think about how to automate this! Use gitbutler, it will help you work on multiple things in parallel

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Bug Report Something isn't working Frontend size:M This PR changes 30-99 lines, ignoring generated files. UX

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants