Skip to content

Commit 7854b99

Browse files
authored
fix(frontend/library): Truncate agent card title and description (#9658)
- Resolves #9631 ### Changes 🏗️ - Truncate library agent card title (2 lines) and description (3 lines) - Make "See runs" and "Open in builder" stick to bottom of card regardless of other content - Reduce number of grid columns (4 -> 3) in `lg` layout on `/library` to give items more horizontal space ![screenshot of library agent grid with the applied changes](https://github.com/user-attachments/assets/b27d5c97-33b8-4708-9f8c-fc67aad899c9) ### Checklist 📋 #### For code changes: - [x] I have clearly listed my changes in the PR description - [x] I have made a test plan - [x] I have tested my changes according to the test plan: - [x] Visually test the changes made on different screen sizes
1 parent ca5fb16 commit 7854b99

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

autogpt_platform/frontend/src/components/library/library-agent-card.tsx

+5-2
Original file line numberDiff line numberDiff line change
@@ -64,15 +64,18 @@ export default function LibraryAgentCard({
6464

6565
<div className="flex w-full flex-1 flex-col px-4 py-4">
6666
<Link href={`/library/agents/${id}`}>
67-
<h3 className="mb-2 font-poppins text-2xl font-semibold leading-tight text-[#272727] dark:text-neutral-100">
67+
<h3 className="mb-2 line-clamp-2 font-poppins text-2xl font-semibold leading-tight text-[#272727] dark:text-neutral-100">
6868
{name}
6969
</h3>
7070

71-
<p className="mb-4 flex-1 text-sm text-gray-600 dark:text-gray-400">
71+
<p className="line-clamp-3 flex-1 text-sm text-gray-600 dark:text-gray-400">
7272
{description}
7373
</p>
7474
</Link>
7575

76+
<div className="flex-grow" />
77+
{/* Spacer */}
78+
7679
<div className="items-between mt-4 flex w-full justify-between gap-3">
7780
<Link
7881
href={`/library/agents/${id}`}

autogpt_platform/frontend/src/components/library/library-agent-list.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ export default function LibraryAgentList(): React.ReactNode {
7878
</div>
7979
) : (
8080
<>
81-
<div className="grid grid-cols-1 gap-3 sm:grid-cols-2 md:grid-cols-2 lg:grid-cols-4 xl:grid-cols-4">
81+
<div className="grid grid-cols-1 gap-3 sm:grid-cols-2 md:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4">
8282
{agents.map((agent) => (
8383
<LibraryAgentCard key={agent.id} agent={agent} />
8484
))}

0 commit comments

Comments
 (0)