Skip to content

feat(ai-agents): add agent card tab and improve inspector UI#2166

Merged
birdayz merged 4 commits intomasterfrom
jb/ai-agent-ui-fixes
Jan 22, 2026
Merged

feat(ai-agents): add agent card tab and improve inspector UI#2166
birdayz merged 4 commits intomasterfrom
jb/ai-agent-ui-fixes

Conversation

@birdayz
Copy link
Contributor

@birdayz birdayz commented Jan 21, 2026

What

Add Agent Card tab to AI agent details page for viewing and editing A2A discovery metadata. Improve inspector UI with context ID display and copy functionality. Fix CopyButton hover animation issue.

Why

Users need to view and configure agent card metadata (skills, provider info, documentation URLs) for A2A protocol discovery. The existing UI lacked this capability entirely.

The CopyButton hover animation (scale 1.05) caused visual "jumping" on small icon buttons, degrading UX.

Implementation details

Agent Card Tab: New tab in agent details showing:

  • Basic metadata (icon URL, documentation URL)
  • Provider information (organization, URL)
  • Skills configuration with tags and examples
  • Edit mode with inline validation
  • Code snippet generation for Go, Node.js, Java, Python

Inspector improvements:

  • Context ID now displayed prominently with fingerprint icon
  • Copy button added for context ID (with hover animation disabled locally)
  • Header actions slot for additional controls (View Agent Card button)

Deferred work: Agent card configuration removed from create page. This requires a multi-step form wizard (stepper UI) to handle the complexity properly. Will be added in a follow-up PR.

References

recording_1769002671.mp4

- Add dedicated Agent Card tab to view and edit A2A discovery metadata
- Add context ID display with copy button in chat header
- Fix CopyButton hover animation causing visual shift
- Add StringArrayInput component for editing tag arrays
- Remove agent card config from create page (requires stepper UI)

Agent card configuration on create will be added later with a proper
multi-step form wizard to handle the complexity.
Fix multiple linting issues in agent chat and inspector components:

- Remove unnecessary fragment wrapper in context ID header
- Fix className ordering violations (Biome enforces alphabetical order)
- Move useState hooks to component top level before early returns (React rules)
- Replace nested ternary with explicit if-else for dialog content states
- Fix potential leaked render by using Boolean() instead of &&

The hook placement fix prevents potential bugs where React would lose
state tracking across renders. The nested ternary refactor improves
readability without changing behavior.
@birdayz birdayz marked this pull request as ready for review January 21, 2026 14:01
Replace hardcoded commit SHA with refs/heads/main now that the SDK
examples PR is merged. The code snippets are fetched from the
how-to-connect-code-snippets repository for display in the Agent Card tab.
Comment on lines 46 to 52
<button
className="ml-1 rounded-full p-0.5 hover:bg-muted"
onClick={() => removeItem(index)}
type="button"
>
<X className="h-3 w-3" />
</button>
Copy link
Contributor

Choose a reason for hiding this comment

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

Let's use a redpanda UI button component instead with the proper variant.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done. Using Button with variant="ghost" and size="icon".

import { Loader } from 'components/ai-elements/loader';
import { Badge } from 'components/redpanda-ui/components/badge';
import { CopyButton } from 'components/redpanda-ui/components/copy-button';
import { Fingerprint } from 'lucide-react';
Copy link
Contributor

@malinskibeniamin malinskibeniamin Jan 21, 2026

Choose a reason for hiding this comment

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

use components/icons barrel file that's acting as the source of truth for icons instead of importing directly from lucide-react

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done. Added FingerprintIcon to the barrel file and updated the import.

Comment on lines 708 to 714
create(AIAgent_AgentCard_SkillSchema, {
id: skill.id.trim(),
name: skill.name.trim(),
description: skill.description.trim(),
tags: skill.tags.filter((t: string) => t.trim()),
examples: skill.examples.filter((e: string) => e.trim()),
})
Copy link
Contributor

Choose a reason for hiding this comment

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

instead of having to trim every single part of the skill, can we have a transform function or some kind of sanitizer to ensure skill has the right format right away?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done. Added sanitizeSkill() helper that trims strings and filters empty array entries.

- Use Redpanda UI Button component in StringArrayInput instead of raw
  button element for consistent styling and behavior

- Import Fingerprint icon from components/icons barrel file instead of
  directly from lucide-react to follow project conventions

- Add sanitizeSkill() helper function to centralize skill data
  transformation instead of inline trimming in handleSave
@birdayz birdayz merged commit 9cec547 into master Jan 22, 2026
9 checks passed
@birdayz birdayz deleted the jb/ai-agent-ui-fixes branch January 22, 2026 08:31
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