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
21 changes: 21 additions & 0 deletions src/web-ui/src/app/scenes/agents/AgentsScene.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -232,6 +232,27 @@ describeWithJsdom('AgentsScene', () => {
expect(stylesheet).toContain('min-width: 0;');
});

it('uses the shared responsive gallery grid and lets agent cards fill each track', () => {
const sceneSource = readFileSync(
fileURLToPath(new URL('./AgentsScene.tsx', import.meta.url)),
'utf8',
);
const agentCardStyles = readFileSync(
fileURLToPath(new URL('./components/AgentCard.scss', import.meta.url)),
'utf8',
);
const coreCardSurfaceStyles = readFileSync(
fileURLToPath(new URL('./components/_AgentSurfaceCard.scss', import.meta.url)),
'utf8',
);

expect(sceneSource.match(/<GalleryGrid minCardWidth=\{360\}>/g)).toHaveLength(2);
expect(agentCardStyles).toMatch(/\.agent-card \{\s+width: 100%;\s+min-width: 0;/);
expect(coreCardSurfaceStyles).toMatch(/width: 100%;\s+min-width: 0;/);
expect(agentCardStyles).not.toContain('width: 360px;');
expect(coreCardSurfaceStyles).not.toContain('width: 360px;');
});

it('shows skill grouping and editing for a custom subagent with the Skill tool', async () => {
const subagent = {
key: 'user::skill-worker',
Expand Down
11 changes: 8 additions & 3 deletions src/web-ui/src/app/scenes/agents/AgentsScene.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -656,15 +656,20 @@ const AgentsHomeView: React.FC = () => {
)}
>
{loading ? (
<GallerySkeleton count={3} cardHeight={160} className="core-agent-skeleton" />
<GallerySkeleton
count={3}
cardHeight={160}
minCardWidth={360}
className="core-agent-skeleton"
/>
) : coreAgents.length === 0 ? (
<GalleryEmpty
icon={<Cpu size={32} strokeWidth={1.5} />}
message={t('coreAgentsZone.empty')}
testId="agent-list-empty"
/>
) : (
<div className="core-agents-grid">
<GalleryGrid minCardWidth={360}>
{coreAgents.map((agent, index) => (
<CoreAgentCard
key={agent.id}
Expand All @@ -690,7 +695,7 @@ const AgentsHomeView: React.FC = () => {
}
/>
))}
</div>
</GalleryGrid>
)}
</GalleryZone>

Expand Down
3 changes: 2 additions & 1 deletion src/web-ui/src/app/scenes/agents/components/AgentCard.scss
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@
@use '../../../styles/surface-stagger';

.agent-card {
width: 360px;
width: 100%;
min-width: 0;
height: 200px;
border-radius: 15px;
background: var(--element-bg-soft);
Expand Down
23 changes: 0 additions & 23 deletions src/web-ui/src/app/scenes/agents/components/CoreAgentCard.scss
Original file line number Diff line number Diff line change
Expand Up @@ -152,15 +152,6 @@
}
}

// ── Grid wrapper (3-col max for core section) ─────────────────────

.core-agents-grid {
display: grid;
grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
gap: $size-gap-2;
width: 100%;
}

// ── Animation ─────────────────────────────────────────────────────

@media (prefers-reduced-motion: reduce) {
Expand All @@ -169,17 +160,3 @@
transition: none;
}
}

// ── Responsive ────────────────────────────────────────────────────

@media (max-width: 1080px) {
.core-agents-grid {
grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
}
}

@media (max-width: 640px) {
.core-agents-grid {
grid-template-columns: 1fr;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@
@mixin agent-surface-card($gradient, $accent) {
--agent-surface-shadow-color: rgb(var(--color-overlay-slate-rgb));

width: 360px;
width: 100%;
min-width: 0;
height: 200px;
border-radius: 15px;
background: var(--element-bg-soft);
Expand Down
Loading