Skip to content

Fixed record pickers create new #12705

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

Merged
merged 8 commits into from
Jun 19, 2025
Merged

Fixed record pickers create new #12705

merged 8 commits into from
Jun 19, 2025

Conversation

lucasbordeau
Copy link
Contributor

This PR fixes many bugs related to creating a record from inside a relation picker, single or multiple.

QA video :

Part 1 :

QA.1.mov

Part 2 :

QA.2.mov

Also :

  • Refactored RecordDetailRelationSectionDropdown to split it into two components to avoid too many ternaries inside functions.

Fixes #12668
Fixes #12669
Fixes #12670
Fixes #12671

Copy link
Contributor

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

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

PR Summary

Major refactoring of relation picker components to fix multiple bugs related to record creation and improve code maintainability.

  • Split RecordDetailRelationSectionDropdown into two specialized components (ToOne and ToMany) eliminating nested ternaries and improving code clarity
  • Fixed search filter persistence in useSingleRecordPickerSearch.ts preventing incorrect 'No record' selection during search
  • Added proper state management in RelationToOneFieldInput.tsx for updating selected records after creation
  • Implemented refetch queries in useAddNewRecordAndOpenRightDrawer.ts to ensure command menu updates after record creation
  • Enhanced empty state handling in SingleRecordPickerMenuItemsWithSearch.tsx with proper filteredSelectedRecords checks

9 files reviewed, 2 comments
Edit PR Review Bot Settings | Greptile

@lucasbordeau lucasbordeau changed the title Ok Fix record pickers create new Jun 18, 2025
@lucasbordeau lucasbordeau changed the title Fix record pickers create new Fixed record pickers create new Jun 18, 2025
Copy link
Contributor

github-actions bot commented Jun 18, 2025

🚀 Preview Environment Ready!

Your preview environment is available at: http://bore.pub:22443

This environment will automatically shut down when the PR is closed or after 5 hours.

Copy link
Contributor

@bosiraphael bosiraphael left a comment

Choose a reason for hiding this comment

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

LGTM

@lucasbordeau lucasbordeau enabled auto-merge (squash) June 19, 2025 13:27
@lucasbordeau lucasbordeau merged commit bb3008e into main Jun 19, 2025
54 checks passed
@lucasbordeau lucasbordeau deleted the fix/picker-create-new branch June 19, 2025 13:37
abdulrahmancodes pushed a commit to abdulrahmancodes/twenty that referenced this pull request Jun 19, 2025
This PR fixes many bugs related to creating a record from inside a
relation picker, single or multiple.

QA video : 

Part 1 :


https://github.com/user-attachments/assets/35450b08-ff84-4698-8318-681d72437cd4

Part 2 : 


https://github.com/user-attachments/assets/807c3a7b-4116-41ff-b9a0-23767452b631

Also : 

- Refactored `RecordDetailRelationSectionDropdown` to split it into two
components to avoid too many ternaries inside functions.

Fixes twentyhq#12668
Fixes twentyhq#12669
Fixes twentyhq#12670
Fixes twentyhq#12671
Copy link

sentry-io bot commented Jun 25, 2025

Suspect Issues

This pull request was deployed and Sentry observed the following issues:

Did you find this useful? React with a 👍 or 👎

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