Skip to content
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

refactor: revamp picker block #4227

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

lawvs
Copy link
Contributor

@lawvs lawvs commented May 9, 2024

Description

I'm really sorry for submitting such a big change without any substantial feature updates in the pull request.

Initially, I planned to fix the issue with the picker component not being able to select items using the arrow keys. However, during development, I discovered that VarReferenceVars may have multiple nested structures, making it challenging to handle properly with LexicalTypeaheadMenuPlugin.

This PR still includes many useful updates. If you have time, I hope this PR can be merged.

This PR mainly affects the following areas:

  • Fixed the issue with PickerBlock not scrolling along (by adjusting the usage of floating-ui).
Screen.Recording.2024-05-11.at.17.11.40.mov
  • Removed redundant code by merging PromptMenu and VariableMenu into PickerBlockMenuOption.

These changes improve the code structure and organization of the picker block functionality.

Type of Change

  • Improvement, including but not limited to code refactoring, performance optimization, and UI/UX improvement

How Has This Been Tested?

Input '/' and test the picker block plugin in the prompt editor.

Suggested Checklist:

  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • My changes generate no new warnings
  • I ran dev/reformat(backend) and cd web && npx lint-staged(frontend) to appease the lint gods
  • optional I have made corresponding changes to the documentation
  • optional I have added tests that prove my fix is effective or that my feature works
  • optional New and existing unit tests pass locally with my changes

@lawvs lawvs force-pushed the refactor/component-picker-block branch from 973bc50 to 77bd35b Compare May 11, 2024 09:14
@lawvs lawvs marked this pull request as ready for review May 11, 2024 09:18
@dosubot dosubot bot added size:XL This PR changes 500-999 lines, ignoring generated files. ☕️ javascript Pull requests that update Javascript code 💪 enhancement New feature or request labels May 11, 2024
@crazywoola crazywoola requested review from takatost, nite-knite, iamjoel, zxhlyh, JzoNgKVO and VincePotato and removed request for takatost May 13, 2024 07:21
@lawvs lawvs force-pushed the refactor/component-picker-block branch from 77bd35b to 2ca5597 Compare May 15, 2024 04:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
💪 enhancement New feature or request ☕️ javascript Pull requests that update Javascript code size:XL This PR changes 500-999 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant