-
Notifications
You must be signed in to change notification settings - Fork 5k
feat: added workspace member filter for actor fields #16628
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
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.
Your free trial has ended. If you'd like to continue receiving code reviews, you can add a payment method here.
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.
1 issue found across 11 files
Prompt for AI agents (all 1 issues)
Check if these issues are valid — if so, understand the root cause of each and fix them.
<file name="packages/twenty-front/src/modules/object-record/object-filter-dropdown/components/ObjectFilterDropdownActorSelect.tsx">
<violation number="1" location="packages/twenty-front/src/modules/object-record/object-filter-dropdown/components/ObjectFilterDropdownActorSelect.tsx:49">
P2: Duplicate schema parsing: both `isCurrentWorkspaceMemberSelected` and `selectedRecordIds` are extracted from the same value using identical parsing logic. Combine these into a single parse call to avoid redundant processing.</violation>
</file>
Reply to cubic to teach it or ask questions. Re-run a review with @cubic-dev-ai review this PR
| objectFilterDropdownSearchInputComponentState, | ||
| ); | ||
|
|
||
| const { isCurrentWorkspaceMemberSelected } = jsonRelationFilterValueSchema |
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.
P2: Duplicate schema parsing: both isCurrentWorkspaceMemberSelected and selectedRecordIds are extracted from the same value using identical parsing logic. Combine these into a single parse call to avoid redundant processing.
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At packages/twenty-front/src/modules/object-record/object-filter-dropdown/components/ObjectFilterDropdownActorSelect.tsx, line 49:
<comment>Duplicate schema parsing: both `isCurrentWorkspaceMemberSelected` and `selectedRecordIds` are extracted from the same value using identical parsing logic. Combine these into a single parse call to avoid redundant processing.</comment>
<file context>
@@ -0,0 +1,185 @@
+ objectFilterDropdownSearchInputComponentState,
+ );
+
+ const { isCurrentWorkspaceMemberSelected } = jsonRelationFilterValueSchema
+ .catch({
+ isCurrentWorkspaceMemberSelected: false,
</file context>
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.
Fixed
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.
Pull request overview
This PR adds support for filtering ACTOR fields by the Workspace Member subfield, enabling users to filter records by who created them with a "Me" option to quickly filter by the current user.
- Added
workspaceMemberIdas a filterable subfield for ACTOR type fields - Implemented workspace member selection UI with a "Me" option for filtering by current user
- Extended filter transformation logic to handle workspace member ID filtering with IS and IS_NOT operands
Reviewed changes
Copilot reviewed 11 out of 11 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
packages/twenty-shared/src/types/RecordGqlOperationFilter.ts |
Added workspaceMemberId to ActorFilter type to support filtering by workspace member |
packages/twenty-shared/src/utils/filter/turnRecordFilterIntoGqlOperationFilter.ts |
Implemented filter transformation logic for workspaceMemberId subfield with support for IS and IS_NOT operands |
packages/twenty-front/src/modules/settings/data-model/constants/SettingsCompositeFieldTypeConfigs.ts |
Enabled isFilterable: true for the workspaceMemberId subfield of ACTOR fields |
packages/twenty-front/src/modules/settings/data-model/constants/CompositeFieldSubFieldLabel.ts |
Updated label from "Workspace Member ID" to "Workspace Member" for better UX |
packages/twenty-front/src/modules/object-record/record-filter/utils/isRecordMatchingFilter.ts |
Added client-side filter matching logic for workspace member ID |
packages/twenty-front/src/modules/object-record/record-filter/utils/getRecordFilterOperands.ts |
Added workspace member subfield detection and appropriate operands (IS, IS_NOT, empty operands) |
packages/twenty-front/src/modules/object-record/record-filter/constants/IconNameBySubField.ts |
Added icon mapping for workspace member subfield |
packages/twenty-front/src/modules/object-record/object-filter-dropdown/utils/isFilterOnActorWorkspaceMemberSubField.ts |
New utility function to detect workspace member subfield filters |
packages/twenty-front/src/modules/object-record/object-filter-dropdown/utils/getSubMenuOptions.ts |
Added "Workspace Member" option to ACTOR field submenu |
packages/twenty-front/src/modules/object-record/object-filter-dropdown/components/ObjectFilterDropdownActorSelect.tsx |
New component implementing workspace member selection with "Me" option and multi-select capability |
packages/twenty-front/src/modules/object-record/advanced-filter/components/AdvancedFilterDropdownFilterInput.tsx |
Integrated workspace member filter component into advanced filter dropdown |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| const { isCurrentWorkspaceMemberSelected } = jsonRelationFilterValueSchema | ||
| .catch({ | ||
| isCurrentWorkspaceMemberSelected: false, | ||
| selectedRecordIds: arrayOfUuidOrVariableSchema.parse( | ||
| objectFilterDropdownFilterValue, | ||
| ), | ||
| }) | ||
| .parse(objectFilterDropdownFilterValue); | ||
|
|
||
| const { selectedRecordIds } = jsonRelationFilterValueSchema | ||
| .catch({ | ||
| isCurrentWorkspaceMemberSelected: false, | ||
| selectedRecordIds: arrayOfUuidOrVariableSchema.parse( | ||
| objectFilterDropdownFilterValue, | ||
| ), | ||
| }) | ||
| .parse(objectFilterDropdownFilterValue); |
Copilot
AI
Dec 17, 2025
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.
The same schema is being parsed twice to extract different fields. This is inefficient and could lead to inconsistencies. Consider parsing once and destructuring both isCurrentWorkspaceMemberSelected and selectedRecordIds from the single parse result.
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.
makes sense. Fixed.
713b5da to
c125421
Compare
c125421 to
43a91c8
Compare
|
@Bonapara Can I get a review here ? |
|
The team is gonna review it very soon |
|
Hi @abk404 sorry for the review delay. That's a very nice PR overall, great work. I made some minor modifications while testing it properly that I've pushed. Here are still things to handle for this new filter to work : Add it to the graph filter part :
@Bonapara should we add back the created by field in workflows ?
|
604b2af to
3aa6311
Compare
|
🚀 Preview Environment Ready! Your preview environment is available at: http://bore.pub:59360 This environment will automatically shut down when the PR is closed or after 5 hours. |


Closes #16619
This PR adds support for filtering ACTOR fields by
Workspace Membersubfield, enabling users to filter records by who created them with aMeoption.I replicated the same UX and code structure as the Relation field filter for consistency.
Each filter selection triggers a server-side GraphQL call. But there is client-side filtering in
isRecordMatchingFilter.tswhich instantly filters already-loaded records while the server is fetching new results. I replicated this behaviour from howFULL_NAMEand other composite fields handle filtering.UX decision that were taken by me (Let me know if changes are needed) :