-
Notifications
You must be signed in to change notification settings - Fork 45.8k
fix(frontend): Featured agents cards layout+sizing #9482
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Here's the code health analysis summary for commits Analysis Summary
|
✅ Deploy Preview for auto-gpt-docs-dev canceled.
|
✅ Deploy Preview for auto-gpt-docs canceled.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great job on this component I like where this is headed.
I have a few suggestions to help make this more maintainable and mobile-friendly:
-
I notice you're adding quite a few styles to control the card heights and layout. Instead of managing this at the card level, we should try to handle consistency through the carousel layout. This will make our components more reusable.
-
Some helpful things to consider:
- The
FeaturedAgentCard
should be as clean as possible, with minimal style overrides - Let try using aspect ratios instead of fixed heights for responsive images
- The
Feel free to reach out to me if you would like to sync up at all.
I'd be happy to show you how we can achieve the same layout consistency while keeping our base components clean and reusable.
autogpt_platform/frontend/src/components/agptui/FeaturedAgentCard.tsx
Outdated
Show resolved
Hide resolved
autogpt_platform/frontend/src/components/agptui/FeaturedAgentCard.tsx
Outdated
Show resolved
Hide resolved
autogpt_platform/frontend/src/components/agptui/FeaturedAgentCard.tsx
Outdated
Show resolved
Hide resolved
autogpt_platform/frontend/src/components/agptui/FeaturedAgentCard.tsx
Outdated
Show resolved
Hide resolved
autogpt_platform/frontend/src/components/agptui/FeaturedAgentCard.tsx
Outdated
Show resolved
Hide resolved
autogpt_platform/frontend/src/components/agptui/FeaturedAgentCard.tsx
Outdated
Show resolved
Hide resolved
Removing myself here since it's already reviewed |
Hey @andrewhooker2 with the changes you suggested made this happens because we arnt controlling the sizing any more - i.e removing
I did set sizing in the carousel but that isnt working it seems. I really want to get this done and in today for the release as it was ment to be a quick fix. Also wanted to say a big thank you for going over this and checking it out for me 🙏 |
Hey there @Bentlybro thanks for taking a look back over this. |
Thank you so much @andrewhooker2 ill have a look at that now 🙏 |
…nts. (#9571) Simplify layout and styling for better responsiveness and maintainability. Reorganize markup to remove redundant wrappers and improve flexibility. Adjust FeaturedAgentCard to dynamically handle aspect ratios and optimize hover transitions. ### Changes 🏗️ **FeaturedAgentCard:** - Removed fixed height/width constraints and replaced with flexible h-full container - Simplified nested div structure by eliminating redundant containers - Implemented proper aspect ratio (aspect-[4/3]) for consistent image display across devices - Optimized hover transition by applying styles directly to Image component - Removed redundant positioning attributes and unnecessary wrapper elements **FeaturedSection:** - Replaced arbitrary width calculations with responsive Tailwind classes - Improved carousel item responsiveness with proper breakpoints (basis-full sm:basis-1/2 md:basis-1/3 lg:basis-1/4) - Changed fixed height containers to aspect-ratio based layout for better adaptability - Simplified button positioning with standard Tailwind utilities **Overall Improvements:** - Better adherence to ShadcN component design philosophy - More maintainable and consistent code structure - Improved responsive behavior across different screen sizes - Reduced HTML complexity and CSS specificity ### 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 ### Screenshots 📷 <img width="998" alt="image" src="https://github.com/user-attachments/assets/7b1beef4-5b6f-47f3-b645-bb44686251be" /> <details> <summary>Feature Store Agents</summary> - [ ] Verify FeaturedAgentCard renders with correct aspect ratio on all screen sizes - [ ] Test hover effect on cards (image fades out, description fades in) - [ ] Verify carousel shows correct number of cards per breakpoint (mobile: 1, tablet: 2, desktop: 3-4) - [ ] Test carousel navigation using left/right buttons and indicators - [ ] Verify clicking on a card navigates to the correct agent detail page - [ ] Verify no visual regressions in surrounding marketplace components </details> --------- Co-authored-by: Bentlybro
Changes 🏗️
right now the featured agents cards dont have a set width/height, so they change depending on the content, and the description is duplicated. also, the "by {creator username}" was removed. currently it looks like this:
with my changes, i set a fixed width and height so they dont change, the description now only shows on hover and is truncated to 11 lines, and i added back the "by {creator username}"