-
Notifications
You must be signed in to change notification settings - Fork 4.5k
Fix issues with one to many activity targets #15656
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
base: main
Are you sure you want to change the base?
Conversation
...ecord-show/graphql/operations/factories/findOneRecordForShowPageOperationSignatureFactory.ts
Show resolved
Hide resolved
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.
Greptile Overview
Greptile Summary
This PR fixes the one-to-many activity targets display issue where only one chip was visible when not hovering, despite multiple values being selected.
Key Changes
- New GQL field generation utility: Created
generateActivityTargetGqlFields()to centralize and optimize GraphQL field generation for activity targets, replacing the oldergenerateActivityTargetMorphFieldKeys()approach - Fixed visibility issues: Removed the hover-based opacity transition that was hiding chips in
RecordInlineCellContainer - Overflow handling: Added
overflow: clipcontainer inTaskRowand fixed width (24px) for the chip counter inExpandableList - Optimized data fetching: Set
shouldOnlyLoadActivityIdentifiers: truefor list views to only load necessary identifier fields instead of full relations - Code consolidation: Unified activity target field generation logic across show pages and list views
The fix properly addresses the root cause by ensuring chips remain visible and are properly clipped based on available width, while also optimizing the data fetching strategy.
Confidence Score: 4/5
- This PR is safe to merge with minimal risk after removing commented code
- The changes properly fix the display issue with good architectural improvements, but there's commented code that should be cleaned up. The refactoring is well-structured and the new utility function follows good patterns. No logic or syntax errors found.
- Check
useRecordsFieldVisibleGqlFields.tsto ensure commented code is removed before merge
Important Files Changed
File Analysis
| Filename | Score | Overview |
|---|---|---|
| packages/twenty-front/src/modules/object-record/graphql/record-gql-fields/utils/generateActivityTargetGqlFields.ts | 4/5 | New utility function to generate GraphQL fields for activity targets with configurable depth and identifier loading. Replaces generateActivityTargetMorphFieldKeys with a more flexible approach. |
| packages/twenty-front/src/modules/ui/layout/expandable-list/components/ExpandableList.tsx | 5/5 | Fixed width constraint added to chip counter (24px) to ensure consistent sizing and prevent overflow display issues. |
| packages/twenty-front/src/modules/object-record/record-field/hooks/useRecordsFieldVisibleGqlFields.ts | 4/5 | Replaced old GQL field generation with new generateActivityTargetGqlFields utility, setting shouldOnlyLoadActivityIdentifiers: true to optimize data fetching. Contains commented out old code. |
| packages/twenty-front/src/modules/object-record/record-inline-cell/components/RecordInlineCellContainer.tsx | 5/5 | Removed hover-based opacity transition effect that was hiding display mode content, fixing visibility issues with inline cells. |
Sequence Diagram
sequenceDiagram
participant User
participant TaskRow
participant ActivityTargetsInlineCell
participant RecordInlineCellContainer
participant ExpandableList
participant RecordChip
participant GraphQL
User->>TaskRow: View task with multiple targets
TaskRow->>ActivityTargetsInlineCell: Render with maxWidth=200
ActivityTargetsInlineCell->>GraphQL: Fetch activity targets<br/>(shouldOnlyLoadActivityIdentifiers: true)
GraphQL-->>ActivityTargetsInlineCell: Return identifier fields only
ActivityTargetsInlineCell->>RecordInlineCellContainer: Render display mode
RecordInlineCellContainer->>ExpandableList: Render chips (isChipCountDisplayed)
loop For each target
ExpandableList->>RecordChip: Render chip
ExpandableList->>ExpandableList: Check if overflowing
end
alt Chips overflow container
ExpandableList->>ExpandableList: Set firstHiddenChildIndex
ExpandableList->>User: Show visible chips + counter (+N)
else All chips fit
ExpandableList->>User: Show all chips
end
User->>ExpandableList: Click chip counter
ExpandableList->>User: Show dropdown with all chips
Additional Comments (1)
-
packages/twenty-front/src/modules/object-record/record-field/hooks/useRecordsFieldVisibleGqlFields.ts, line 80-89 (link)style: Remove commented out code before merging.
10 files reviewed, 1 comment
|
🚀 Preview Environment Ready! Your preview environment is available at: http://bore.pub:54402 This environment will automatically shut down when the PR is closed or after 5 hours. |
This PR fixes issues with one to many activity target bugs described here : #14280 (comment)
It also improves the request that fetches notes and tasks in index pages, to only fetch the notes and tasks identifier fields, thus reducing the amount of network load.
Fixes #14280