Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions client/src/components/cos/tabs/AgentCard.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -548,9 +548,9 @@ export default function AgentCard({ agent, onPause, onKill, onDelete, onResume,
<div className={completed ? "p-3 [overflow-wrap:anywhere]" : "p-4"}>
{/* Top row: Agent ID, badges, and actions */}
<div className="flex flex-wrap items-start justify-between gap-x-2 gap-y-1 mb-2">
<div className="flex items-center gap-2 flex-wrap min-w-0 flex-1 basis-64">
<div className="flex items-center gap-2 flex-wrap min-w-0 flex-1 basis-0 sm:basis-64">
<Cpu size={16} aria-hidden="true" className={`shrink-0 ${inactive ? 'text-gray-500' : 'text-port-accent animate-pulse'}`} />
<span className="font-mono text-sm text-gray-400 truncate">{agent.id}</span>
<span className="font-mono text-sm text-gray-400 truncate min-w-0">{agent.id}</span>
<button
type="button"
onClick={(event) => {
Expand Down Expand Up @@ -611,7 +611,7 @@ export default function AgentCard({ agent, onPause, onKill, onDelete, onResume,
)}
</div>
{/* Actions - right side */}
<div className="flex items-center gap-2 shrink-0 ml-auto">
<div className="flex items-center gap-2 shrink-0 ml-0 sm:ml-auto">
{(output.length > 0 || inactive) && (
<button
onClick={() => setExpanded(!expanded)}
Expand Down
20 changes: 20 additions & 0 deletions client/src/components/cos/tabs/AgentCard.test.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -226,6 +226,26 @@ describe('AgentCard agent ID', () => {
});
});

describe('AgentCard responsive header', () => {
it('keeps the identity and actions rails flexible on narrow cards', () => {
const onDelete = vi.fn();
const onResume = vi.fn();

render(
<MemoryRouter>
<AgentCard agent={agent} completed onDelete={onDelete} onResume={onResume} />
</MemoryRouter>
);

const actions = screen.getByRole('button', { name: 'Show' }).parentElement;
const identity = actions.previousElementSibling;

expect(identity).toHaveClass('basis-0', 'sm:basis-64');
expect(screen.getByText(agent.id)).toHaveClass('min-w-0');
expect(actions).toHaveClass('ml-0', 'sm:ml-auto');
});
});

describe('AgentCard transcript truncation (#3498)', () => {
it('says the transcript was clipped when the server returns a capped tail', async () => {
const user = userEvent.setup();
Expand Down