Skip to content

fix(frontend): agent favorites layout - #11733

Merged
0ubbe merged 4 commits into
devfrom
fix/library-layout
Jan 9, 2026
Merged

fix(frontend): agent favorites layout#11733
0ubbe merged 4 commits into
devfrom
fix/library-layout

Conversation

@0ubbe

@0ubbe 0ubbe commented Jan 9, 2026

Copy link
Copy Markdown
Contributor

Changes 🏗️

Screenshot 2026-01-09 at 16 07 08
  • Remove feature flag for agent favourites ( keep it always visible )
  • Fix the layout on the card so the ❤️ icon appears next to the ... menu
  • Remove icons on toasts

Checklist 📋

For code changes:

  • I have clearly listed my changes in the PR description
  • I have made a test plan
  • I have tested my changes according to the test plan:
    • Run the app locally and check the above

Summary by CodeRabbit

  • New Features

    • Favorites now respond to the current search term and are available to all users (no feature-flag).
  • UI/UX Improvements

    • Redesigned Favorites section with simplified header, inline agent counts, updated spacing/dividers, and removal of skeleton placeholders.
    • Favorite button repositioned and visually simplified on agent cards.
    • Toast visuals simplified by removing per-type icons and adjusting close-button positioning.

✏️ Tip: You can customize this high-level summary in your review settings.

@0ubbe
0ubbe requested review from Abhi1992002 and ntindle January 9, 2026 09:44
@0ubbe
0ubbe requested a review from a team as a code owner January 9, 2026 09:44
@0ubbe
0ubbe requested review from majdyz and removed request for a team January 9, 2026 09:44
@github-project-automation github-project-automation Bot moved this to 🆕 Needs initial review in AutoGPT development kanban Jan 9, 2026
@github-actions github-actions Bot added the platform/frontend AutoGPT Platform - Front end label Jan 9, 2026
@github-actions github-actions Bot added the size/m label Jan 9, 2026
@coderabbitai

coderabbitai Bot commented Jan 9, 2026

Copy link
Copy Markdown
Contributor

Walkthrough

Favorites favoriting logic un-gated by feature flag; FavoriteButton moved out of link wrappers and accepts an optional className; useFavoriteAgents and FavoritesSection now accept/search by a searchTerm prop; toast per-type icons removed and toast close-button positioning CSS deleted.

Changes

Cohort / File(s) Summary
Favorites UI
autogpt_platform/frontend/src/app/(platform)/library/components/FavoritesSection/FavoritesSection.tsx
Component now accepts searchTerm prop; uses useFavoriteAgents({ searchTerm }); removed AGENT_FAVORITING gating; unified loading/empty guard to return null when loading or no favorites; simplified header to Text + HeartIcon and added data-testid="agents-count"; layout spacing and divider class tweaks; removed skeleton branch and always render InfiniteScroll.
Favorite agents hook
autogpt_platform/frontend/src/app/(platform)/library/hooks/useFavoriteAgents.ts
Hook signature changed to useFavoriteAgents({ searchTerm }); adds client-side filtering (memoized) of agents by searchTerm; agentCount computed from filtered list; exposes isFetchingNextPage/fetchNextPage.
Agent Card & Favorite control
autogpt_platform/frontend/src/app/(platform)/library/components/LibraryAgentCard/LibraryAgentCard.tsx, .../components/FavoriteButton.tsx, .../useLibraryAgentCard.ts
Removed feature-flag checks for favoriting; moved FavoriteButton and AgentCardMenu out of the NextLink (avatar/name remains linked); FavoriteButton gained optional className?: string prop and its onClick type narrowed to MouseEvent<HTMLButtonElement>; styling simplified and button absolutely positioned; useLibraryAgentCard no longer returns isAgentFavoritingEnabled.
Page-level prop plumbing
autogpt_platform/frontend/src/app/(platform)/library/page.tsx
FavoritesSection now receives searchTerm from parent; LibraryAgentList gains setLibrarySort prop in its public signature.
Toast styling & icons
autogpt_platform/frontend/src/components/molecules/Toast/toaster.tsx, autogpt_platform/frontend/src/components/molecules/Toast/styles.module.css
Removed phosphor icon imports and replaced per-type toast icons with null (disables per-type icons); deleted CSS rules that repositioned Sonner toast close button.

Sequence Diagram(s)

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

Suggested reviewers

  • ntindle

Poem

🐰 I hop where hearts no longer hide,
Buttons perch outside the ride,
Counts and searches keep their tune,
Toasts sit quiet—no icon moon,
I nibble code and dance with joy. 🥕✨

🚥 Pre-merge checks | ✅ 2 | ❌ 1
❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly summarizes the main focus of the changeset: fixing the layout of agent favorites by repositioning the heart icon and removing the feature flag.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
  • 📝 Generate docstrings

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 and usage tips.

@qodo-code-review

Copy link
Copy Markdown

PR Reviewer Guide 🔍

Here are some key observations to aid the review process:

⏱️ Estimated effort to review: 3 🔵🔵🔵⚪⚪
🧪 No relevant tests
🔒 No security concerns identified
⚡ Recommended focus areas for review

UX Regression

The section now returns null when loading or when there are no favorites, which likely prevents showing the loading skeleton/placeholder during fetch and can make the UI “pop in” later or appear broken while loading.

if (isLoading || favoriteAgents.length === 0) {
  return null;
}

return (
  <div className="!mb-8">
    <div className="pb mb-3 flex items-center gap-2 p-2">
      <HeartIcon className="h-5 w-5" weight="fill" />
      <div className="flex items-baseline gap-2">
        <Text variant="h4">Favorites</Text>
        {!isLoading && (
          <Text
            variant="body"
            data-testid="agents-count"
            className="relative bottom-px text-zinc-500"
          >
            {agentCount}
          </Text>
        )}
      </div>
    </div>
Click Behavior

The favorite control is now positioned absolutely near the card header while the header content is wrapped in a link; confirm the favorite button click does not trigger navigation (e.g., via event bubbling) and that its z-index/hitbox doesn’t interfere with the link/menu interactions.

<NextLink href={`/library/agents/${id}`} className="flex-shrink-0">
  <div className="relative flex items-center gap-2 px-4 pt-3">
    <Avatar className="h-4 w-4 rounded-full">
      <AvatarImage
        src={
          isFromMarketplace
            ? creator_image_url || "/avatar-placeholder.png"
            : profile?.avatar_url || "/avatar-placeholder.png"
        }
        alt={`${name} creator avatar`}
      />
      <AvatarFallback size={48}>{name.charAt(0)}</AvatarFallback>
    </Avatar>
    <Text
      variant="small-medium"
      className="uppercase tracking-wide text-zinc-400"
    >
      {isFromMarketplace ? "FROM MARKETPLACE" : "Built by you"}
    </Text>
  </div>
</NextLink>
<FavoriteButton
  isFavorite={isFavorite}
  onClick={handleToggleFavorite}
  className="absolute right-10 top-0"
/>
<AgentCardMenu agent={agent} />
Accessibility

The button styling removed background/backdrop and focus ring styles and added hover scaling; validate keyboard focus visibility, contrast, and that the control remains discoverable/usable without hover (especially when not favorited and opacity is 0 until group hover).

  className?: string;
}

export function FavoriteButton({
  isFavorite,
  onClick,
  className,
}: FavoriteButtonProps) {
  return (
    <button
      onClick={onClick}
      className={cn(
        "rounded-full p-2 transition-all duration-200",
        "hover:scale-110",
        !isFavorite && "opacity-0 group-hover:opacity-100",
        className,
      )}
      aria-label={isFavorite ? "Remove from favorites" : "Add to favorites"}
    >

Swiftyos
Swiftyos previously approved these changes Jan 9, 2026
@github-project-automation github-project-automation Bot moved this from 🆕 Needs initial review to 👍🏼 Mergeable in AutoGPT development kanban Jan 9, 2026
@AutoGPT-Agent

Copy link
Copy Markdown
Contributor

Thank you for submitting this PR to fix the agent favorites layout! The code changes look good and align with your description.

However, before we can merge this PR, you need to complete the checklist in the PR description. Please:

  1. Check the box for "I have clearly listed my changes in the PR description" since you've done this
  2. Check the box for "I have made a test plan"
  3. Fill out and check the test plan items that apply to your changes

Your changes seem straightforward, but it's still important to document how you've tested these UI changes. A simple test plan might include checking that:

  • The heart icon appears correctly next to the menu
  • Favorites functionality works (adding/removing favorites)
  • The favorites section displays correctly
  • Toast notifications display properly without icons

Once you've completed the checklist, we can proceed with merging your PR.

@AutoGPT-Agent

Copy link
Copy Markdown
Contributor

Thank you for your PR to fix the agent favorites layout! The changes look good and are well-focused on the issue:

  • Removing the feature flag to keep favorites always visible
  • Fixing the layout of the heart icon to appear next to the menu
  • Removing icons from toasts

However, before we can merge this PR, please complete the checklist in the PR description. Specifically:

  1. Check the box confirming you've clearly listed your changes (which you have done)
  2. Add a test plan describing how you've tested these changes
  3. Check the box confirming you've tested according to that plan

Once you've completed the checklist, we can proceed with the review process. The actual code changes look good and focused on the layout improvements described.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 4

🤖 Fix all issues with AI agents
In
@autogpt_platform/frontend/src/app/(platform)/library/components/FavoritesSection/FavoritesSection.tsx:
- Around line 21-23: The current render guard in FavoritesSection returns null
whenever isLoading is true, preventing the skeleton grid from ever showing;
update the conditional so that the component only returns null when not
isLoading AND favoriteAgents.length === 0, and when isLoading is true render the
existing skeleton grid markup instead; locate the check using isLoading and
favoriteAgents in the FavoritesSection component and adjust the logic so the
skeleton path (the skeleton grid JSX within FavoritesSection) is reachable while
loading.
- Around line 26-41: The outer header div in the FavoritesSection component uses
an invalid Tailwind token "pb" in className ("pb mb-3 flex items-center...");
replace "pb" with the intended padding class (e.g., "pb-2" or another correct
pb-* value) or remove it if no bottom padding was intended so Tailwind applies
styles correctly; update the className on the div that contains the HeartIcon
and Title in FavoritesSection.tsx accordingly.

In
@autogpt_platform/frontend/src/app/(platform)/library/components/LibraryAgentCard/components/FavoriteButton.tsx:
- Around line 6-26: The FavoriteButton currently becomes visually hidden when
!isFavorite but remains keyboard-focusable and has no focus-visible affordance;
update the component so the hidden state restores visibility when focused and
adds clear focus-visible styling: when composing className in FavoriteButton
include the conditional fragment for the hidden state as "!isFavorite &&
'opacity-0 group-hover:opacity-100 focus-visible:opacity-100'" and add explicit
focus-visible classes (e.g., focus-visible:ring-2, focus-visible:ring-offset-2,
focus-visible:outline-none or similar) so keyboard users get a visible
ring/outline; keep onClick and aria-label unchanged.
- Around line 8-10: Update the FavoriteButton props to use a type import for the
click event: add an import type for MouseEvent from "react" and change the
onClick prop signature from (e: React.MouseEvent) => void to (e:
MouseEvent<HTMLButtonElement>) => void so the handler uses the explicit imported
MouseEvent type for the button element.
🧹 Nitpick comments (1)
autogpt_platform/frontend/src/app/(platform)/library/components/FavoritesSection/FavoritesSection.tsx (1)

31-40: Redundant conditions after the new early-return (minor cleanup).

  • !isLoading && (...) is always true after the guard at Line 21.
  • {favoriteAgents.length > 0 && ...} is also redundant for the same reason.

(Also: this file still relies on @/components/__legacy__/ui/skeleton; worth migrating when convenient, per frontend guidelines.) Based on coding guidelines, avoid src/components/__legacy__/*.

Also applies to: 70-70

📜 Review details

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Disabled knowledge base sources:

  • Linear integration is disabled by default for public repositories

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between 36fb1ea and 5221fa8.

📒 Files selected for processing (5)
  • autogpt_platform/frontend/src/app/(platform)/library/components/FavoritesSection/FavoritesSection.tsx
  • autogpt_platform/frontend/src/app/(platform)/library/components/LibraryAgentCard/LibraryAgentCard.tsx
  • autogpt_platform/frontend/src/app/(platform)/library/components/LibraryAgentCard/components/FavoriteButton.tsx
  • autogpt_platform/frontend/src/components/molecules/Toast/styles.module.css
  • autogpt_platform/frontend/src/components/molecules/Toast/toaster.tsx
💤 Files with no reviewable changes (1)
  • autogpt_platform/frontend/src/components/molecules/Toast/styles.module.css
🧰 Additional context used
📓 Path-based instructions (10)
autogpt_platform/frontend/**/*.{ts,tsx}

📄 CodeRabbit inference engine (.github/copilot-instructions.md)

autogpt_platform/frontend/**/*.{ts,tsx}: Always run pnpm install before frontend development, then use pnpm dev to start development server on port 3000
For frontend code formatting and linting, always run pnpm format

If adding protected frontend routes, update frontend/lib/supabase/middleware.ts

autogpt_platform/frontend/**/*.{ts,tsx}: Use generated API hooks from @/app/api/__generated__/endpoints/ for data fetching in frontend
Use function declarations (not arrow functions) for components and handlers in frontend
Only use Phosphor Icons in frontend; never use other icon libraries
Never use src/components/__legacy__/* or deprecated BackendAPI in frontend

Files:

  • autogpt_platform/frontend/src/components/molecules/Toast/toaster.tsx
  • autogpt_platform/frontend/src/app/(platform)/library/components/LibraryAgentCard/components/FavoriteButton.tsx
  • autogpt_platform/frontend/src/app/(platform)/library/components/LibraryAgentCard/LibraryAgentCard.tsx
  • autogpt_platform/frontend/src/app/(platform)/library/components/FavoritesSection/FavoritesSection.tsx
autogpt_platform/frontend/**/*.{ts,tsx,json}

📄 CodeRabbit inference engine (.github/copilot-instructions.md)

Use Node.js 21+ with pnpm package manager for frontend development

Files:

  • autogpt_platform/frontend/src/components/molecules/Toast/toaster.tsx
  • autogpt_platform/frontend/src/app/(platform)/library/components/LibraryAgentCard/components/FavoriteButton.tsx
  • autogpt_platform/frontend/src/app/(platform)/library/components/LibraryAgentCard/LibraryAgentCard.tsx
  • autogpt_platform/frontend/src/app/(platform)/library/components/FavoritesSection/FavoritesSection.tsx
autogpt_platform/frontend/src/components/**/*.tsx

📄 CodeRabbit inference engine (.github/copilot-instructions.md)

autogpt_platform/frontend/src/components/**/*.tsx: Separate frontend component render logic from data/behavior. Structure: ComponentName/ComponentName.tsx + useComponentName.ts + helpers.ts. Small components (3-4 lines) can be inline. Render-only components can be direct files without folders
Use Tailwind CSS utilities only for styling in frontend. Use design system components from src/components/ (atoms, molecules, organisms). Never use src/components/legacy/*
Only use Phosphor Icons (@phosphor-icons/react) for icon components in frontend
Prefer design tokens over hardcoded values in frontend styling

Files:

  • autogpt_platform/frontend/src/components/molecules/Toast/toaster.tsx
autogpt_platform/frontend/src/**/*.{ts,tsx}

📄 CodeRabbit inference engine (.github/copilot-instructions.md)

autogpt_platform/frontend/src/**/*.{ts,tsx}: Use generated API hooks from @/app/api/generated/endpoints/ (generated via Orval from backend OpenAPI spec). Pattern: use{Method}{Version}{OperationName} (e.g., useGetV2ListLibraryAgents). Regenerate with: pnpm generate:api. Never use deprecated BackendAPI or src/lib/autogpt-server-api/*
Use function declarations for components and handlers (not arrow functions). Only arrow functions for small inline lambdas (map, filter, etc.)
Use PascalCase for components, camelCase with use prefix for hooks
No barrel files or index.ts re-exports in frontend
For frontend render errors, use component. For mutation errors, display with toast notifications. For manual exceptions, use Sentry.captureException()
Default to client components (use client). Use server components only for SEO or extreme TTFB needs. Use React Query for server state via generated hooks. Co-locate UI state in components/hooks

Files:

  • autogpt_platform/frontend/src/components/molecules/Toast/toaster.tsx
  • autogpt_platform/frontend/src/app/(platform)/library/components/LibraryAgentCard/components/FavoriteButton.tsx
  • autogpt_platform/frontend/src/app/(platform)/library/components/LibraryAgentCard/LibraryAgentCard.tsx
  • autogpt_platform/frontend/src/app/(platform)/library/components/FavoritesSection/FavoritesSection.tsx
autogpt_platform/frontend/**/*.{js,ts,jsx,tsx}

📄 CodeRabbit inference engine (AGENTS.md)

Format frontend code using pnpm format

Files:

  • autogpt_platform/frontend/src/components/molecules/Toast/toaster.tsx
  • autogpt_platform/frontend/src/app/(platform)/library/components/LibraryAgentCard/components/FavoriteButton.tsx
  • autogpt_platform/frontend/src/app/(platform)/library/components/LibraryAgentCard/LibraryAgentCard.tsx
  • autogpt_platform/frontend/src/app/(platform)/library/components/FavoritesSection/FavoritesSection.tsx
autogpt_platform/frontend/**

📄 CodeRabbit inference engine (autogpt_platform/CLAUDE.md)

autogpt_platform/frontend/**: Install frontend dependencies using pnpm i instead of npm
Generate API client from OpenAPI spec using pnpm generate:api
Regenerate API client hooks using pnpm generate:api when OpenAPI spec changes

Files:

  • autogpt_platform/frontend/src/components/molecules/Toast/toaster.tsx
  • autogpt_platform/frontend/src/app/(platform)/library/components/LibraryAgentCard/components/FavoriteButton.tsx
  • autogpt_platform/frontend/src/app/(platform)/library/components/LibraryAgentCard/LibraryAgentCard.tsx
  • autogpt_platform/frontend/src/app/(platform)/library/components/FavoritesSection/FavoritesSection.tsx
autogpt_platform/frontend/src/components/**/*.{ts,tsx}

📄 CodeRabbit inference engine (autogpt_platform/CLAUDE.md)

autogpt_platform/frontend/src/components/**/*.{ts,tsx}: Separate render logic from data/behavior in components
Structure frontend components as ComponentName/ComponentName.tsx plus useComponentName.ts hook plus helpers.ts file

Files:

  • autogpt_platform/frontend/src/components/molecules/Toast/toaster.tsx
autogpt_platform/frontend/src/**/*.tsx

📄 CodeRabbit inference engine (autogpt_platform/CLAUDE.md)

Use design system components from src/components/ (atoms, molecules, organisms) in frontend

Files:

  • autogpt_platform/frontend/src/components/molecules/Toast/toaster.tsx
  • autogpt_platform/frontend/src/app/(platform)/library/components/LibraryAgentCard/components/FavoriteButton.tsx
  • autogpt_platform/frontend/src/app/(platform)/library/components/LibraryAgentCard/LibraryAgentCard.tsx
  • autogpt_platform/frontend/src/app/(platform)/library/components/FavoritesSection/FavoritesSection.tsx
autogpt_platform/frontend/**/*.{ts,tsx,css}

📄 CodeRabbit inference engine (autogpt_platform/CLAUDE.md)

Use only Tailwind CSS for styling in frontend, with design tokens and Phosphor Icons

Files:

  • autogpt_platform/frontend/src/components/molecules/Toast/toaster.tsx
  • autogpt_platform/frontend/src/app/(platform)/library/components/LibraryAgentCard/components/FavoriteButton.tsx
  • autogpt_platform/frontend/src/app/(platform)/library/components/LibraryAgentCard/LibraryAgentCard.tsx
  • autogpt_platform/frontend/src/app/(platform)/library/components/FavoritesSection/FavoritesSection.tsx
autogpt_platform/frontend/src/app/**/*.tsx

📄 CodeRabbit inference engine (autogpt_platform/CLAUDE.md)

Create frontend pages in src/app/(platform)/feature-name/page.tsx with corresponding usePageName.ts hook and local components/ subfolder

Files:

  • autogpt_platform/frontend/src/app/(platform)/library/components/LibraryAgentCard/components/FavoriteButton.tsx
  • autogpt_platform/frontend/src/app/(platform)/library/components/LibraryAgentCard/LibraryAgentCard.tsx
  • autogpt_platform/frontend/src/app/(platform)/library/components/FavoritesSection/FavoritesSection.tsx
🧠 Learnings (12)
📚 Learning: 2025-11-25T08:48:33.246Z
Learnt from: CR
Repo: Significant-Gravitas/AutoGPT PR: 0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-11-25T08:48:33.246Z
Learning: Applies to autogpt_platform/frontend/src/components/**/*.tsx : Only use Phosphor Icons (phosphor-icons/react) for icon components in frontend

Applied to files:

  • autogpt_platform/frontend/src/components/molecules/Toast/toaster.tsx
📚 Learning: 2025-11-25T08:49:03.583Z
Learnt from: CR
Repo: Significant-Gravitas/AutoGPT PR: 0
File: autogpt_platform/CLAUDE.md:0-0
Timestamp: 2025-11-25T08:49:03.583Z
Learning: Applies to autogpt_platform/frontend/**/*.{ts,tsx} : Only use Phosphor Icons in frontend; never use other icon libraries

Applied to files:

  • autogpt_platform/frontend/src/components/molecules/Toast/toaster.tsx
📚 Learning: 2025-11-25T08:49:03.583Z
Learnt from: CR
Repo: Significant-Gravitas/AutoGPT PR: 0
File: autogpt_platform/CLAUDE.md:0-0
Timestamp: 2025-11-25T08:49:03.583Z
Learning: Applies to autogpt_platform/frontend/**/*.{ts,tsx,css} : Use only Tailwind CSS for styling in frontend, with design tokens and Phosphor Icons

Applied to files:

  • autogpt_platform/frontend/src/components/molecules/Toast/toaster.tsx
📚 Learning: 2025-11-25T08:48:33.246Z
Learnt from: CR
Repo: Significant-Gravitas/AutoGPT PR: 0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-11-25T08:48:33.246Z
Learning: Applies to autogpt_platform/frontend/src/components/**/*.tsx : Prefer design tokens over hardcoded values in frontend styling

Applied to files:

  • autogpt_platform/frontend/src/components/molecules/Toast/toaster.tsx
  • autogpt_platform/frontend/src/app/(platform)/library/components/LibraryAgentCard/components/FavoriteButton.tsx
📚 Learning: 2025-11-25T08:48:33.246Z
Learnt from: CR
Repo: Significant-Gravitas/AutoGPT PR: 0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-11-25T08:48:33.246Z
Learning: Applies to autogpt_platform/frontend/src/**/*.{ts,tsx} : No barrel files or index.ts re-exports in frontend

Applied to files:

  • autogpt_platform/frontend/src/components/molecules/Toast/toaster.tsx
📚 Learning: 2025-11-25T08:49:03.583Z
Learnt from: CR
Repo: Significant-Gravitas/AutoGPT PR: 0
File: autogpt_platform/CLAUDE.md:0-0
Timestamp: 2025-11-25T08:49:03.583Z
Learning: Applies to autogpt_platform/frontend/**/*.{ts,tsx} : Never use `src/components/__legacy__/*` or deprecated `BackendAPI` in frontend

Applied to files:

  • autogpt_platform/frontend/src/components/molecules/Toast/toaster.tsx
📚 Learning: 2025-11-25T08:49:03.583Z
Learnt from: CR
Repo: Significant-Gravitas/AutoGPT PR: 0
File: autogpt_platform/CLAUDE.md:0-0
Timestamp: 2025-11-25T08:49:03.583Z
Learning: Applies to autogpt_platform/frontend/src/**/*.tsx : Use design system components from `src/components/` (atoms, molecules, organisms) in frontend

Applied to files:

  • autogpt_platform/frontend/src/components/molecules/Toast/toaster.tsx
📚 Learning: 2025-11-25T08:48:33.246Z
Learnt from: CR
Repo: Significant-Gravitas/AutoGPT PR: 0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-11-25T08:48:33.246Z
Learning: Applies to autogpt_platform/frontend/src/components/**/*.tsx : Use Tailwind CSS utilities only for styling in frontend. Use design system components from src/components/ (atoms, molecules, organisms). Never use src/components/__legacy__/*

Applied to files:

  • autogpt_platform/frontend/src/components/molecules/Toast/toaster.tsx
📚 Learning: 2025-11-25T08:48:33.246Z
Learnt from: CR
Repo: Significant-Gravitas/AutoGPT PR: 0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-11-25T08:48:33.246Z
Learning: Applies to autogpt_platform/frontend/src/**/*.{ts,tsx} : For frontend render errors, use <ErrorCard /> component. For mutation errors, display with toast notifications. For manual exceptions, use Sentry.captureException()

Applied to files:

  • autogpt_platform/frontend/src/components/molecules/Toast/toaster.tsx
📚 Learning: 2025-11-25T08:49:03.583Z
Learnt from: CR
Repo: Significant-Gravitas/AutoGPT PR: 0
File: autogpt_platform/CLAUDE.md:0-0
Timestamp: 2025-11-25T08:49:03.583Z
Learning: Applies to autogpt_platform/frontend/**/*.{ts,tsx} : Use function declarations (not arrow functions) for components and handlers in frontend

Applied to files:

  • autogpt_platform/frontend/src/components/molecules/Toast/toaster.tsx
📚 Learning: 2025-11-25T08:48:33.246Z
Learnt from: CR
Repo: Significant-Gravitas/AutoGPT PR: 0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-11-25T08:48:33.246Z
Learning: Applies to autogpt_platform/frontend/src/**/*.{ts,tsx} : Default to client components (use client). Use server components only for SEO or extreme TTFB needs. Use React Query for server state via generated hooks. Co-locate UI state in components/hooks

Applied to files:

  • autogpt_platform/frontend/src/components/molecules/Toast/toaster.tsx
📚 Learning: 2025-11-25T08:48:33.246Z
Learnt from: CR
Repo: Significant-Gravitas/AutoGPT PR: 0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-11-25T08:48:33.246Z
Learning: Applies to autogpt_platform/frontend/src/components/**/*.tsx : Separate frontend component render logic from data/behavior. Structure: ComponentName/ComponentName.tsx + useComponentName.ts + helpers.ts. Small components (3-4 lines) can be inline. Render-only components can be direct files without folders

Applied to files:

  • autogpt_platform/frontend/src/app/(platform)/library/components/LibraryAgentCard/LibraryAgentCard.tsx
🧬 Code graph analysis (1)
autogpt_platform/frontend/src/app/(platform)/library/components/LibraryAgentCard/LibraryAgentCard.tsx (2)
autogpt_platform/frontend/src/app/(platform)/library/components/LibraryAgentCard/components/FavoriteButton.tsx (1)
  • FavoriteButton (12-38)
autogpt_platform/frontend/src/app/(platform)/library/components/LibraryAgentCard/components/AgentCardMenu.tsx (1)
  • AgentCardMenu (30-188)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (6)
  • GitHub Check: types
  • GitHub Check: test
  • GitHub Check: chromatic
  • GitHub Check: Seer Code Review
  • GitHub Check: Check PR Status
  • GitHub Check: Analyze (python)
🔇 Additional comments (2)
autogpt_platform/frontend/src/app/(platform)/library/components/LibraryAgentCard/LibraryAgentCard.tsx (1)

40-67: Good: controls moved out of the link; please visually verify no overlap with the kebab menu across breakpoints.

This restructuring should prevent nested-interactive/link click issues and matches the PR goal (heart next to menu).
Please sanity-check in UI that FavoriteButton (absolute right-10 top-0) and AgentCardMenu (absolute right-2 top-1 in its component) don’t overlap on small widths and that the heart remains discoverable on hover/focus.

autogpt_platform/frontend/src/components/molecules/Toast/toaster.tsx (1)

24-29: No action needed—Sonner v2.0.7 explicitly supports null to disable icons.

Sonner added support for fully hiding icons with null (as of v2.0.2). Passing null for icon keys does not fall back to defaults; it is the documented, intended way to disable icons. The code is correct as written.

Likely an incorrect or invalid review comment.

@0ubbe
0ubbe force-pushed the fix/library-layout branch from 5221fa8 to 38dba36 Compare January 9, 2026 09:58

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Fix all issues with AI agents
In
@autogpt_platform/frontend/src/app/(platform)/library/components/FavoritesSection/FavoritesSection.tsx:
- Around line 21-23: The early return in the FavoritesSection component
incorrectly includes isLoading so the skeleton never renders; update the
early-return logic (referencing FavoritesSection, isLoading and favoriteAgents)
to only return null when there are truly no favorites after loading finishes
(e.g., only return when favoriteAgents.length === 0 AND isLoading is false), so
the skeleton block remains reachable while isLoading is true.
📜 Review details

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Disabled knowledge base sources:

  • Linear integration is disabled by default for public repositories

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between 5221fa8 and 38dba36.

📒 Files selected for processing (5)
  • autogpt_platform/frontend/src/app/(platform)/library/components/FavoritesSection/FavoritesSection.tsx
  • autogpt_platform/frontend/src/app/(platform)/library/components/LibraryAgentCard/LibraryAgentCard.tsx
  • autogpt_platform/frontend/src/app/(platform)/library/components/LibraryAgentCard/components/FavoriteButton.tsx
  • autogpt_platform/frontend/src/components/molecules/Toast/styles.module.css
  • autogpt_platform/frontend/src/components/molecules/Toast/toaster.tsx
💤 Files with no reviewable changes (1)
  • autogpt_platform/frontend/src/components/molecules/Toast/styles.module.css
🚧 Files skipped from review as they are similar to previous changes (1)
  • autogpt_platform/frontend/src/app/(platform)/library/components/LibraryAgentCard/components/FavoriteButton.tsx
🧰 Additional context used
📓 Path-based instructions (10)
autogpt_platform/frontend/**/*.{ts,tsx}

📄 CodeRabbit inference engine (.github/copilot-instructions.md)

autogpt_platform/frontend/**/*.{ts,tsx}: Always run pnpm install before frontend development, then use pnpm dev to start development server on port 3000
For frontend code formatting and linting, always run pnpm format

If adding protected frontend routes, update frontend/lib/supabase/middleware.ts

autogpt_platform/frontend/**/*.{ts,tsx}: Use generated API hooks from @/app/api/__generated__/endpoints/ for data fetching in frontend
Use function declarations (not arrow functions) for components and handlers in frontend
Only use Phosphor Icons in frontend; never use other icon libraries
Never use src/components/__legacy__/* or deprecated BackendAPI in frontend

Files:

  • autogpt_platform/frontend/src/app/(platform)/library/components/FavoritesSection/FavoritesSection.tsx
  • autogpt_platform/frontend/src/components/molecules/Toast/toaster.tsx
  • autogpt_platform/frontend/src/app/(platform)/library/components/LibraryAgentCard/LibraryAgentCard.tsx
autogpt_platform/frontend/**/*.{ts,tsx,json}

📄 CodeRabbit inference engine (.github/copilot-instructions.md)

Use Node.js 21+ with pnpm package manager for frontend development

Files:

  • autogpt_platform/frontend/src/app/(platform)/library/components/FavoritesSection/FavoritesSection.tsx
  • autogpt_platform/frontend/src/components/molecules/Toast/toaster.tsx
  • autogpt_platform/frontend/src/app/(platform)/library/components/LibraryAgentCard/LibraryAgentCard.tsx
autogpt_platform/frontend/src/**/*.{ts,tsx}

📄 CodeRabbit inference engine (.github/copilot-instructions.md)

autogpt_platform/frontend/src/**/*.{ts,tsx}: Use generated API hooks from @/app/api/generated/endpoints/ (generated via Orval from backend OpenAPI spec). Pattern: use{Method}{Version}{OperationName} (e.g., useGetV2ListLibraryAgents). Regenerate with: pnpm generate:api. Never use deprecated BackendAPI or src/lib/autogpt-server-api/*
Use function declarations for components and handlers (not arrow functions). Only arrow functions for small inline lambdas (map, filter, etc.)
Use PascalCase for components, camelCase with use prefix for hooks
No barrel files or index.ts re-exports in frontend
For frontend render errors, use component. For mutation errors, display with toast notifications. For manual exceptions, use Sentry.captureException()
Default to client components (use client). Use server components only for SEO or extreme TTFB needs. Use React Query for server state via generated hooks. Co-locate UI state in components/hooks

Files:

  • autogpt_platform/frontend/src/app/(platform)/library/components/FavoritesSection/FavoritesSection.tsx
  • autogpt_platform/frontend/src/components/molecules/Toast/toaster.tsx
  • autogpt_platform/frontend/src/app/(platform)/library/components/LibraryAgentCard/LibraryAgentCard.tsx
autogpt_platform/frontend/**/*.{js,ts,jsx,tsx}

📄 CodeRabbit inference engine (AGENTS.md)

Format frontend code using pnpm format

Files:

  • autogpt_platform/frontend/src/app/(platform)/library/components/FavoritesSection/FavoritesSection.tsx
  • autogpt_platform/frontend/src/components/molecules/Toast/toaster.tsx
  • autogpt_platform/frontend/src/app/(platform)/library/components/LibraryAgentCard/LibraryAgentCard.tsx
autogpt_platform/frontend/**

📄 CodeRabbit inference engine (autogpt_platform/CLAUDE.md)

autogpt_platform/frontend/**: Install frontend dependencies using pnpm i instead of npm
Generate API client from OpenAPI spec using pnpm generate:api
Regenerate API client hooks using pnpm generate:api when OpenAPI spec changes

Files:

  • autogpt_platform/frontend/src/app/(platform)/library/components/FavoritesSection/FavoritesSection.tsx
  • autogpt_platform/frontend/src/components/molecules/Toast/toaster.tsx
  • autogpt_platform/frontend/src/app/(platform)/library/components/LibraryAgentCard/LibraryAgentCard.tsx
autogpt_platform/frontend/src/**/*.tsx

📄 CodeRabbit inference engine (autogpt_platform/CLAUDE.md)

Use design system components from src/components/ (atoms, molecules, organisms) in frontend

Files:

  • autogpt_platform/frontend/src/app/(platform)/library/components/FavoritesSection/FavoritesSection.tsx
  • autogpt_platform/frontend/src/components/molecules/Toast/toaster.tsx
  • autogpt_platform/frontend/src/app/(platform)/library/components/LibraryAgentCard/LibraryAgentCard.tsx
autogpt_platform/frontend/src/app/**/*.tsx

📄 CodeRabbit inference engine (autogpt_platform/CLAUDE.md)

Create frontend pages in src/app/(platform)/feature-name/page.tsx with corresponding usePageName.ts hook and local components/ subfolder

Files:

  • autogpt_platform/frontend/src/app/(platform)/library/components/FavoritesSection/FavoritesSection.tsx
  • autogpt_platform/frontend/src/app/(platform)/library/components/LibraryAgentCard/LibraryAgentCard.tsx
autogpt_platform/frontend/**/*.{ts,tsx,css}

📄 CodeRabbit inference engine (autogpt_platform/CLAUDE.md)

Use only Tailwind CSS for styling in frontend, with design tokens and Phosphor Icons

Files:

  • autogpt_platform/frontend/src/app/(platform)/library/components/FavoritesSection/FavoritesSection.tsx
  • autogpt_platform/frontend/src/components/molecules/Toast/toaster.tsx
  • autogpt_platform/frontend/src/app/(platform)/library/components/LibraryAgentCard/LibraryAgentCard.tsx
autogpt_platform/frontend/src/components/**/*.tsx

📄 CodeRabbit inference engine (.github/copilot-instructions.md)

autogpt_platform/frontend/src/components/**/*.tsx: Separate frontend component render logic from data/behavior. Structure: ComponentName/ComponentName.tsx + useComponentName.ts + helpers.ts. Small components (3-4 lines) can be inline. Render-only components can be direct files without folders
Use Tailwind CSS utilities only for styling in frontend. Use design system components from src/components/ (atoms, molecules, organisms). Never use src/components/legacy/*
Only use Phosphor Icons (@phosphor-icons/react) for icon components in frontend
Prefer design tokens over hardcoded values in frontend styling

Files:

  • autogpt_platform/frontend/src/components/molecules/Toast/toaster.tsx
autogpt_platform/frontend/src/components/**/*.{ts,tsx}

📄 CodeRabbit inference engine (autogpt_platform/CLAUDE.md)

autogpt_platform/frontend/src/components/**/*.{ts,tsx}: Separate render logic from data/behavior in components
Structure frontend components as ComponentName/ComponentName.tsx plus useComponentName.ts hook plus helpers.ts file

Files:

  • autogpt_platform/frontend/src/components/molecules/Toast/toaster.tsx
🧠 Learnings (12)
📚 Learning: 2025-11-25T08:48:33.246Z
Learnt from: CR
Repo: Significant-Gravitas/AutoGPT PR: 0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-11-25T08:48:33.246Z
Learning: Applies to autogpt_platform/frontend/src/components/**/*.tsx : Separate frontend component render logic from data/behavior. Structure: ComponentName/ComponentName.tsx + useComponentName.ts + helpers.ts. Small components (3-4 lines) can be inline. Render-only components can be direct files without folders

Applied to files:

  • autogpt_platform/frontend/src/app/(platform)/library/components/FavoritesSection/FavoritesSection.tsx
📚 Learning: 2025-11-25T08:48:33.246Z
Learnt from: CR
Repo: Significant-Gravitas/AutoGPT PR: 0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-11-25T08:48:33.246Z
Learning: Applies to autogpt_platform/frontend/src/components/**/*.tsx : Prefer design tokens over hardcoded values in frontend styling

Applied to files:

  • autogpt_platform/frontend/src/app/(platform)/library/components/FavoritesSection/FavoritesSection.tsx
  • autogpt_platform/frontend/src/components/molecules/Toast/toaster.tsx
📚 Learning: 2025-11-25T08:48:33.246Z
Learnt from: CR
Repo: Significant-Gravitas/AutoGPT PR: 0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-11-25T08:48:33.246Z
Learning: Applies to autogpt_platform/frontend/src/components/**/*.tsx : Use Tailwind CSS utilities only for styling in frontend. Use design system components from src/components/ (atoms, molecules, organisms). Never use src/components/__legacy__/*

Applied to files:

  • autogpt_platform/frontend/src/app/(platform)/library/components/FavoritesSection/FavoritesSection.tsx
  • autogpt_platform/frontend/src/components/molecules/Toast/toaster.tsx
📚 Learning: 2025-11-25T08:49:03.583Z
Learnt from: CR
Repo: Significant-Gravitas/AutoGPT PR: 0
File: autogpt_platform/CLAUDE.md:0-0
Timestamp: 2025-11-25T08:49:03.583Z
Learning: Applies to autogpt_platform/frontend/**/*.{ts,tsx,css} : Use only Tailwind CSS for styling in frontend, with design tokens and Phosphor Icons

Applied to files:

  • autogpt_platform/frontend/src/app/(platform)/library/components/FavoritesSection/FavoritesSection.tsx
  • autogpt_platform/frontend/src/components/molecules/Toast/toaster.tsx
📚 Learning: 2025-11-25T08:48:33.246Z
Learnt from: CR
Repo: Significant-Gravitas/AutoGPT PR: 0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-11-25T08:48:33.246Z
Learning: Applies to autogpt_platform/frontend/src/components/**/*.tsx : Only use Phosphor Icons (phosphor-icons/react) for icon components in frontend

Applied to files:

  • autogpt_platform/frontend/src/components/molecules/Toast/toaster.tsx
📚 Learning: 2025-11-25T08:49:03.583Z
Learnt from: CR
Repo: Significant-Gravitas/AutoGPT PR: 0
File: autogpt_platform/CLAUDE.md:0-0
Timestamp: 2025-11-25T08:49:03.583Z
Learning: Applies to autogpt_platform/frontend/**/*.{ts,tsx} : Only use Phosphor Icons in frontend; never use other icon libraries

Applied to files:

  • autogpt_platform/frontend/src/components/molecules/Toast/toaster.tsx
📚 Learning: 2025-11-25T08:49:03.583Z
Learnt from: CR
Repo: Significant-Gravitas/AutoGPT PR: 0
File: autogpt_platform/CLAUDE.md:0-0
Timestamp: 2025-11-25T08:49:03.583Z
Learning: Applies to autogpt_platform/frontend/src/**/*.tsx : Use design system components from `src/components/` (atoms, molecules, organisms) in frontend

Applied to files:

  • autogpt_platform/frontend/src/components/molecules/Toast/toaster.tsx
📚 Learning: 2025-11-25T08:48:33.246Z
Learnt from: CR
Repo: Significant-Gravitas/AutoGPT PR: 0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-11-25T08:48:33.246Z
Learning: Applies to autogpt_platform/frontend/src/**/*.{ts,tsx} : No barrel files or index.ts re-exports in frontend

Applied to files:

  • autogpt_platform/frontend/src/components/molecules/Toast/toaster.tsx
📚 Learning: 2025-11-25T08:49:03.583Z
Learnt from: CR
Repo: Significant-Gravitas/AutoGPT PR: 0
File: autogpt_platform/CLAUDE.md:0-0
Timestamp: 2025-11-25T08:49:03.583Z
Learning: Applies to autogpt_platform/frontend/**/*.{ts,tsx} : Never use `src/components/__legacy__/*` or deprecated `BackendAPI` in frontend

Applied to files:

  • autogpt_platform/frontend/src/components/molecules/Toast/toaster.tsx
📚 Learning: 2025-11-25T08:49:03.583Z
Learnt from: CR
Repo: Significant-Gravitas/AutoGPT PR: 0
File: autogpt_platform/CLAUDE.md:0-0
Timestamp: 2025-11-25T08:49:03.583Z
Learning: Applies to autogpt_platform/frontend/**/*.{ts,tsx} : Use function declarations (not arrow functions) for components and handlers in frontend

Applied to files:

  • autogpt_platform/frontend/src/components/molecules/Toast/toaster.tsx
📚 Learning: 2025-11-25T08:48:33.246Z
Learnt from: CR
Repo: Significant-Gravitas/AutoGPT PR: 0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-11-25T08:48:33.246Z
Learning: Applies to autogpt_platform/frontend/src/**/*.{ts,tsx} : Use function declarations for components and handlers (not arrow functions). Only arrow functions for small inline lambdas (map, filter, etc.)

Applied to files:

  • autogpt_platform/frontend/src/components/molecules/Toast/toaster.tsx
📚 Learning: 2025-11-25T08:48:33.246Z
Learnt from: CR
Repo: Significant-Gravitas/AutoGPT PR: 0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-11-25T08:48:33.246Z
Learning: Applies to autogpt_platform/frontend/src/**/*.{ts,tsx} : Default to client components (use client). Use server components only for SEO or extreme TTFB needs. Use React Query for server state via generated hooks. Co-locate UI state in components/hooks

Applied to files:

  • autogpt_platform/frontend/src/components/molecules/Toast/toaster.tsx
🧬 Code graph analysis (2)
autogpt_platform/frontend/src/app/(platform)/library/components/FavoritesSection/FavoritesSection.tsx (1)
autogpt_platform/frontend/src/components/atoms/Text/Text.tsx (1)
  • Text (15-35)
autogpt_platform/frontend/src/app/(platform)/library/components/LibraryAgentCard/LibraryAgentCard.tsx (2)
autogpt_platform/frontend/src/app/(platform)/library/components/LibraryAgentCard/components/FavoriteButton.tsx (1)
  • FavoriteButton (12-38)
autogpt_platform/frontend/src/app/(platform)/library/components/LibraryAgentCard/components/AgentCardMenu.tsx (1)
  • AgentCardMenu (30-188)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (6)
  • GitHub Check: chromatic
  • GitHub Check: test
  • GitHub Check: types
  • GitHub Check: Seer Code Review
  • GitHub Check: Check PR Status
  • GitHub Check: Analyze (python)
🔇 Additional comments (5)
autogpt_platform/frontend/src/components/molecules/Toast/toaster.tsx (1)

25-28: LGTM - Toast icons successfully removed.

The icons are now set to null, removing visual indicators from toast notifications as intended. The implementation preserves the Sonner configuration while cleanly disabling per-type icons.

autogpt_platform/frontend/src/app/(platform)/library/components/FavoritesSection/FavoritesSection.tsx (2)

26-41: LGTM - Header restructure with Text components.

The new header structure using Text components follows design system patterns correctly. The HeartIcon with weight="fill" and the count display provide clear visual feedback.


4-4: Replace legacy Skeleton import with design system component.

This imports from __legacy__, which violates coding guidelines. Use the Skeleton component from the design system instead.

As per coding guidelines: "Never use src/components/legacy/*"

autogpt_platform/frontend/src/app/(platform)/library/components/LibraryAgentCard/LibraryAgentCard.tsx (2)

40-66: LGTM - Layout restructure successfully places favorite button next to menu.

The changes correctly position the FavoriteButton and AgentCardMenu outside the NextLink wrapper with absolute positioning. This achieves the PR objective of placing the heart icon next to the kebab menu while keeping the avatar/name area clickable.

Layout verification:

  • Parent container has relative positioning (line 38) ✓
  • FavoriteButton positioned at right-10 top-0 (line 64) ✓
  • AgentCardMenu positioned at right-2 top-1 (from relevant code) ✓
  • Both buttons properly isolated from link navigation ✓

27-27: Remove unused isAgentFavoritingEnabled variable.

The isAgentFavoritingEnabled variable is destructured from the hook but never used in the component. This is dead code left over from removing the feature flag conditional rendering.

@github-actions github-actions Bot added the size/l label Jan 9, 2026
Swiftyos
Swiftyos previously approved these changes Jan 9, 2026

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 0

🧹 Nitpick comments (3)
autogpt_platform/frontend/src/app/(platform)/library/components/FavoritesSection/FavoritesSection.tsx (3)

34-42: Redundant !isLoading check.

Since line 24 already returns null when isLoading is true, this condition will always be true when reached. You can simplify by removing the conditional wrapper.

♻️ Suggested simplification
-          {!isLoading && (
-            <Text
-              variant="body"
-              data-testid="agents-count"
-              className="relative bottom-px text-zinc-500"
-            >
-              {agentCount}
-            </Text>
-          )}
+          <Text
+            variant="body"
+            data-testid="agents-count"
+            className="relative bottom-px text-zinc-500"
+          >
+            {agentCount}
+          </Text>

51-55: Consider using the design system's LoadingSpinner for consistency.

The custom spinner works, but the InfiniteScroll component already has a default loader using LoadingSpinner. Using the design system component would ensure visual consistency across the app.


65-65: Redundant condition check.

The condition favoriteAgents.length > 0 is always true at this point because line 24 returns null when favoriteAgents.length === 0. The divider will always render when the component renders.

♻️ Suggested simplification
-      {favoriteAgents.length > 0 && <div className="!mt-10 border-t" />}
+      <div className="!mt-10 border-t" />
📜 Review details

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Disabled knowledge base sources:

  • Linear integration is disabled by default for public repositories

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between 4d6b573 and 094990c.

📒 Files selected for processing (3)
  • autogpt_platform/frontend/src/app/(platform)/library/components/FavoritesSection/FavoritesSection.tsx
  • autogpt_platform/frontend/src/app/(platform)/library/hooks/useFavoriteAgents.ts
  • autogpt_platform/frontend/src/app/(platform)/library/page.tsx
🧰 Additional context used
📓 Path-based instructions (8)
autogpt_platform/frontend/**/*.{ts,tsx}

📄 CodeRabbit inference engine (.github/copilot-instructions.md)

autogpt_platform/frontend/**/*.{ts,tsx}: Always run pnpm install before frontend development, then use pnpm dev to start development server on port 3000
For frontend code formatting and linting, always run pnpm format

If adding protected frontend routes, update frontend/lib/supabase/middleware.ts

autogpt_platform/frontend/**/*.{ts,tsx}: Use generated API hooks from @/app/api/__generated__/endpoints/ for data fetching in frontend
Use function declarations (not arrow functions) for components and handlers in frontend
Only use Phosphor Icons in frontend; never use other icon libraries
Never use src/components/__legacy__/* or deprecated BackendAPI in frontend

Files:

  • autogpt_platform/frontend/src/app/(platform)/library/page.tsx
  • autogpt_platform/frontend/src/app/(platform)/library/components/FavoritesSection/FavoritesSection.tsx
  • autogpt_platform/frontend/src/app/(platform)/library/hooks/useFavoriteAgents.ts
autogpt_platform/frontend/**/*.{ts,tsx,json}

📄 CodeRabbit inference engine (.github/copilot-instructions.md)

Use Node.js 21+ with pnpm package manager for frontend development

Files:

  • autogpt_platform/frontend/src/app/(platform)/library/page.tsx
  • autogpt_platform/frontend/src/app/(platform)/library/components/FavoritesSection/FavoritesSection.tsx
  • autogpt_platform/frontend/src/app/(platform)/library/hooks/useFavoriteAgents.ts
autogpt_platform/frontend/src/**/*.{ts,tsx}

📄 CodeRabbit inference engine (.github/copilot-instructions.md)

autogpt_platform/frontend/src/**/*.{ts,tsx}: Use generated API hooks from @/app/api/generated/endpoints/ (generated via Orval from backend OpenAPI spec). Pattern: use{Method}{Version}{OperationName} (e.g., useGetV2ListLibraryAgents). Regenerate with: pnpm generate:api. Never use deprecated BackendAPI or src/lib/autogpt-server-api/*
Use function declarations for components and handlers (not arrow functions). Only arrow functions for small inline lambdas (map, filter, etc.)
Use PascalCase for components, camelCase with use prefix for hooks
No barrel files or index.ts re-exports in frontend
For frontend render errors, use component. For mutation errors, display with toast notifications. For manual exceptions, use Sentry.captureException()
Default to client components (use client). Use server components only for SEO or extreme TTFB needs. Use React Query for server state via generated hooks. Co-locate UI state in components/hooks

Files:

  • autogpt_platform/frontend/src/app/(platform)/library/page.tsx
  • autogpt_platform/frontend/src/app/(platform)/library/components/FavoritesSection/FavoritesSection.tsx
  • autogpt_platform/frontend/src/app/(platform)/library/hooks/useFavoriteAgents.ts
autogpt_platform/frontend/**/*.{js,ts,jsx,tsx}

📄 CodeRabbit inference engine (AGENTS.md)

Format frontend code using pnpm format

Files:

  • autogpt_platform/frontend/src/app/(platform)/library/page.tsx
  • autogpt_platform/frontend/src/app/(platform)/library/components/FavoritesSection/FavoritesSection.tsx
  • autogpt_platform/frontend/src/app/(platform)/library/hooks/useFavoriteAgents.ts
autogpt_platform/frontend/**

📄 CodeRabbit inference engine (autogpt_platform/CLAUDE.md)

autogpt_platform/frontend/**: Install frontend dependencies using pnpm i instead of npm
Generate API client from OpenAPI spec using pnpm generate:api
Regenerate API client hooks using pnpm generate:api when OpenAPI spec changes

Files:

  • autogpt_platform/frontend/src/app/(platform)/library/page.tsx
  • autogpt_platform/frontend/src/app/(platform)/library/components/FavoritesSection/FavoritesSection.tsx
  • autogpt_platform/frontend/src/app/(platform)/library/hooks/useFavoriteAgents.ts
autogpt_platform/frontend/src/**/*.tsx

📄 CodeRabbit inference engine (autogpt_platform/CLAUDE.md)

Use design system components from src/components/ (atoms, molecules, organisms) in frontend

Files:

  • autogpt_platform/frontend/src/app/(platform)/library/page.tsx
  • autogpt_platform/frontend/src/app/(platform)/library/components/FavoritesSection/FavoritesSection.tsx
autogpt_platform/frontend/src/app/**/*.tsx

📄 CodeRabbit inference engine (autogpt_platform/CLAUDE.md)

Create frontend pages in src/app/(platform)/feature-name/page.tsx with corresponding usePageName.ts hook and local components/ subfolder

Files:

  • autogpt_platform/frontend/src/app/(platform)/library/page.tsx
  • autogpt_platform/frontend/src/app/(platform)/library/components/FavoritesSection/FavoritesSection.tsx
autogpt_platform/frontend/**/*.{ts,tsx,css}

📄 CodeRabbit inference engine (autogpt_platform/CLAUDE.md)

Use only Tailwind CSS for styling in frontend, with design tokens and Phosphor Icons

Files:

  • autogpt_platform/frontend/src/app/(platform)/library/page.tsx
  • autogpt_platform/frontend/src/app/(platform)/library/components/FavoritesSection/FavoritesSection.tsx
  • autogpt_platform/frontend/src/app/(platform)/library/hooks/useFavoriteAgents.ts
🧠 Learnings (8)
📚 Learning: 2025-11-25T08:48:33.246Z
Learnt from: CR
Repo: Significant-Gravitas/AutoGPT PR: 0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-11-25T08:48:33.246Z
Learning: Applies to autogpt_platform/frontend/src/components/**/*.tsx : Prefer design tokens over hardcoded values in frontend styling

Applied to files:

  • autogpt_platform/frontend/src/app/(platform)/library/components/FavoritesSection/FavoritesSection.tsx
📚 Learning: 2025-11-25T08:48:33.246Z
Learnt from: CR
Repo: Significant-Gravitas/AutoGPT PR: 0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-11-25T08:48:33.246Z
Learning: Applies to autogpt_platform/frontend/src/components/**/*.tsx : Use Tailwind CSS utilities only for styling in frontend. Use design system components from src/components/ (atoms, molecules, organisms). Never use src/components/__legacy__/*

Applied to files:

  • autogpt_platform/frontend/src/app/(platform)/library/components/FavoritesSection/FavoritesSection.tsx
📚 Learning: 2025-11-25T08:49:03.583Z
Learnt from: CR
Repo: Significant-Gravitas/AutoGPT PR: 0
File: autogpt_platform/CLAUDE.md:0-0
Timestamp: 2025-11-25T08:49:03.583Z
Learning: Applies to autogpt_platform/frontend/**/*.{ts,tsx,css} : Use only Tailwind CSS for styling in frontend, with design tokens and Phosphor Icons

Applied to files:

  • autogpt_platform/frontend/src/app/(platform)/library/components/FavoritesSection/FavoritesSection.tsx
📚 Learning: 2025-11-25T08:48:33.246Z
Learnt from: CR
Repo: Significant-Gravitas/AutoGPT PR: 0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-11-25T08:48:33.246Z
Learning: Applies to autogpt_platform/frontend/src/**/*.{ts,tsx} : Use generated API hooks from @/app/api/__generated__/endpoints/ (generated via Orval from backend OpenAPI spec). Pattern: use{Method}{Version}{OperationName} (e.g., useGetV2ListLibraryAgents). Regenerate with: pnpm generate:api. Never use deprecated BackendAPI or src/lib/autogpt-server-api/*

Applied to files:

  • autogpt_platform/frontend/src/app/(platform)/library/hooks/useFavoriteAgents.ts
📚 Learning: 2025-11-25T08:48:33.246Z
Learnt from: CR
Repo: Significant-Gravitas/AutoGPT PR: 0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-11-25T08:48:33.246Z
Learning: Applies to autogpt_platform/frontend/src/**/*.{ts,tsx} : Use PascalCase for components, camelCase with use prefix for hooks

Applied to files:

  • autogpt_platform/frontend/src/app/(platform)/library/hooks/useFavoriteAgents.ts
📚 Learning: 2025-11-25T08:49:03.583Z
Learnt from: CR
Repo: Significant-Gravitas/AutoGPT PR: 0
File: autogpt_platform/CLAUDE.md:0-0
Timestamp: 2025-11-25T08:49:03.583Z
Learning: Applies to autogpt_platform/frontend/**/*.{ts,tsx} : Use generated API hooks from `@/app/api/__generated__/endpoints/` for data fetching in frontend

Applied to files:

  • autogpt_platform/frontend/src/app/(platform)/library/hooks/useFavoriteAgents.ts
📚 Learning: 2025-11-25T08:48:33.246Z
Learnt from: CR
Repo: Significant-Gravitas/AutoGPT PR: 0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-11-25T08:48:33.246Z
Learning: Applies to autogpt_platform/frontend/src/**/*.{ts,tsx} : Default to client components (use client). Use server components only for SEO or extreme TTFB needs. Use React Query for server state via generated hooks. Co-locate UI state in components/hooks

Applied to files:

  • autogpt_platform/frontend/src/app/(platform)/library/hooks/useFavoriteAgents.ts
📚 Learning: 2025-11-25T08:49:03.583Z
Learnt from: CR
Repo: Significant-Gravitas/AutoGPT PR: 0
File: autogpt_platform/CLAUDE.md:0-0
Timestamp: 2025-11-25T08:49:03.583Z
Learning: Applies to autogpt_platform/frontend/**/*.{ts,tsx} : Use function declarations (not arrow functions) for components and handlers in frontend

Applied to files:

  • autogpt_platform/frontend/src/app/(platform)/library/hooks/useFavoriteAgents.ts
🧬 Code graph analysis (2)
autogpt_platform/frontend/src/app/(platform)/library/page.tsx (1)
autogpt_platform/frontend/src/app/(platform)/library/components/FavoritesSection/FavoritesSection.tsx (1)
  • FavoritesSection (14-68)
autogpt_platform/frontend/src/app/(platform)/library/components/FavoritesSection/FavoritesSection.tsx (5)
autogpt_platform/frontend/src/app/(platform)/library/hooks/useFavoriteAgents.ts (1)
  • useFavoriteAgents (12-48)
autogpt_platform/frontend/src/components/atoms/Text/Text.tsx (1)
  • Text (15-35)
autogpt_platform/frontend/src/components/contextual/InfiniteScroll/InfiniteScroll.tsx (1)
  • InfiniteScroll (29-73)
autogpt_platform/frontend/src/lib/autogpt-server-api/types.ts (1)
  • LibraryAgent (488-517)
autogpt_platform/frontend/src/app/(platform)/library/components/LibraryAgentCard/LibraryAgentCard.tsx (1)
  • LibraryAgentCard (22-130)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (7)
  • GitHub Check: chromatic
  • GitHub Check: test
  • GitHub Check: lint
  • GitHub Check: types
  • GitHub Check: Check PR Status
  • GitHub Check: Analyze (python)
  • GitHub Check: Seer Code Review
🔇 Additional comments (4)
autogpt_platform/frontend/src/app/(platform)/library/hooks/useFavoriteAgents.ts (2)

33-36: useMemo dependency on allAgents may cause unnecessary recalculations.

The allAgents array is recreated on every render when agentsQueryData changes (expected behavior). However, since allAgents is derived directly from agentsQueryData, you could depend on agentsQueryData instead for clearer intent, or this is acceptable as-is since React Query memoizes query data.

This is minor and the current implementation works correctly.


41-46: Verify that hasNextPage and pagination behavior align with client-side filtering expectations.

After client-side filtering, hasNextPage still reflects server pagination state, not whether there are more filtered results to show. This could lead to confusing UX where:

  1. User searches, sees filtered results
  2. hasNextPage is true (server has more pages)
  3. User scrolls to load more, but new page may have no matching results

This might be intentional (fetch all then filter), but verify this is the expected behavior for the favorites section.

autogpt_platform/frontend/src/app/(platform)/library/page.tsx (1)

9-27: LGTM!

The page correctly wires searchTerm to both FavoritesSection and LibraryAgentList, ensuring consistent search behavior across the library. The component follows coding guidelines with function declaration and proper state management via the custom hook.

autogpt_platform/frontend/src/app/(platform)/library/components/FavoritesSection/FavoritesSection.tsx (1)

24-26: Early return logic is clean and handles both loading and empty states.

The combined condition isLoading || favoriteAgents.length === 0 correctly hides the section during loading and when there are no favorites, which aligns with the PR objective to always show favorites when available (feature flag removed).

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

Projects

Status: ✅ Done
Status: Done

Development

Successfully merging this pull request may close these issues.

3 participants