https://github.com/user-attachments/assets/3a444937-0290-4505-85e1-64b7b713bc3b - [x] Analyze the existing `FieldWidgetRelationCard` and `FieldWidgetMorphRelationCard` components - [x] Review existing patterns for "More" buttons (found `IconChevronDown` pattern) - [x] Create a reusable `FieldWidgetShowMoreButton` component for the "More (X)" button - [x] Update `FieldWidgetRelationCard` to show max 5 items initially with progressive loading - [x] Update `FieldWidgetMorphRelationCard` to show max 5 items initially with progressive loading - [x] Add Storybook story with play function to test progressive loading for regular relations - [x] Verify changes visually in Storybook (all tests pass) - [x] Run code review (no issues found) - [x] Run CodeQL security check (no code changes for CodeQL to analyze) - [x] Address PR review feedback: - [x] Move constants to separate files (`FieldWidgetRelationCardInitialVisibleItems.ts` and `FieldWidgetRelationCardLoadMoreIncrement.ts`) - [x] Add translation for "More (X)" string using `t` macro from `@lingui/core/macro` ## Summary This PR adds progressive loading functionality to the FIELD widget with CARD display mode: 1. **New Component**: Created `FieldWidgetShowMoreButton` - A styled button component that displays "More (X)" with a chevron icon, showing the remaining count of hidden items. 2. **Updated Components**: - `FieldWidgetRelationCard`: Now displays max 5 relation cards initially, with a "More (X)" button that loads 5 more items on each click - `FieldWidgetMorphRelationCard`: Same progressive loading behavior for morph relations 3. **Constants**: Moved to separate files following codebase conventions: - `FIELD_WIDGET_RELATION_CARD_INITIAL_VISIBLE_ITEMS` (5) - `FIELD_WIDGET_RELATION_CARD_LOAD_MORE_INCREMENT` (5) 4. **Storybook Story**: Added `OneToManyRelationCardWidgetWithProgressiveLoading` story with play function that tests: - Initial display of 5 items - "More (7)" button visibility - Loading additional items on click - Button disappearing when all items are shown <!-- START COPILOT ORIGINAL PROMPT --> <details> <summary>Original prompt</summary> > > ---- > > *This section details on the original issue you should resolve* > > <issue_title>[RPL] Allow users to progressively load relations in FIELD widget with CARD display mode</issue_title> > <issue_description>## Current state > > The FIELD widget should display max 5 relations in CARD display mode. > > ## Goal > > Display a "More (12)" button. Clicking on this button loads 5 more items. After a click, "More (12)" becomes "More (7)". > > <img width="1334" height="712" alt="Image" src="https://github.com/user-attachments/assets/e801cca2-af99-4d87-8ce2-0c639775b0b1" /> > > ## Technical input > > `FieldWidgetRelationCard` already loads all the relations and maps over each one of them. Create a state that's updated when clicking on the More button, slicing the relations to display. > > ## Acceptance criteria > > - Must work for relations and morph relations in _card_ display mode > - Create stories to assert it works properly (with play function to actually test the components)</issue_description> > > ## Comments on the Issue (you are @copilot in this section) > > <comments> > </comments> > </details> <!-- START COPILOT CODING AGENT SUFFIX --> - Fixes twentyhq/core-team-issues#2063 <!-- START COPILOT CODING AGENT TIPS --> --- 💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more [Copilot coding agent tips](https://gh.io/copilot-coding-agent-tips) in the docs. --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: Devessier <29370468+Devessier@users.noreply.github.com> Co-authored-by: Baptiste Devessier <baptiste@devessier.fr>
The #1 Open-Source CRM
🌐 Website · 📚 Documentation · Roadmap ·
Discord ·
Figma
Installation
See: 🚀 Self-hosting 🖥️ Local Setup
Does the world need another CRM?
We built Twenty for three reasons:
CRMs are too expensive, and users are trapped. Companies use locked-in customer data to hike prices. It shouldn't be that way.
A fresh start is required to build a better experience. We can learn from past mistakes and craft a cohesive experience inspired by new UX patterns from tools like Notion, Airtable or Linear.
We believe in Open-source and community. Hundreds of developers are already building Twenty together. Once we have plugin capabilities, a whole ecosystem will grow around it.
What You Can Do With Twenty
Please feel free to flag any specific needs you have by creating an issue.
Below are a few features we have implemented to date:
- Personalize layouts with filters, sort, group by, kanban and table views
- Customize your objects and fields
- Create and manage permissions with custom roles
- Automate workflow with triggers and actions
- Emails, calendar events, files, and more
Personalize layouts with filters, sort, group by, kanban and table views
Customize your objects and fields
Create and manage permissions with custom roles
Automate workflow with triggers and actions
Emails, calendar events, files, and more
Stack
- TypeScript
- Nx
- NestJS, with BullMQ, PostgreSQL, Redis
- React, with Recoil, Emotion and Lingui
Thanks
Thanks to these amazing services that we use and recommend for UI testing (Chromatic), code review (Greptile), catching bugs (Sentry) and translating (Crowdin).
Join the Community
- Star the repo
- Subscribe to releases (watch -> custom -> releases)
- Follow us on Twitter or LinkedIn
- Join our Discord
- Improve translations on Crowdin
- Contributions are, of course, most welcome!




