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

fix: avoid selection change when ai-panel display #7002

Merged
merged 5 commits into from
May 10, 2024

Conversation

donteatfriedrice
Copy link
Member

To fixed TOV-834

  • Add an affine-viewport-overlay-widget to avoid selection change when some panel/dialog/modal opened. By preventing the dragStart, pointerDown, and click event to dispatch when viewport widget is locked.

Before, when ai-panel opened and has generated some content, if user click or drag outside of the ai panel, the selection will be changed, then the response actions will be wired, for example, insert below or replace the wrong blocks.

Screen.Recording.2024-05-09.at.16.07.48.mov

Now can lock the viewport when ai-panel opened by calling affineViewportOverlayWidget.lock().

Screen.Recording.2024-05-09.at.16.09.21.mov

Copy link

vercel bot commented May 9, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
blocksuite ✅ Ready (Inspect) Visit Preview 💬 Add feedback May 9, 2024 2:54pm
1 Ignored Deployment
Name Status Preview Comments Updated (UTC)
blocksuite-docs ⬜️ Ignored (Inspect) Visit Preview May 9, 2024 2:54pm

Copy link

graphite-app bot commented May 9, 2024

Your org has enabled the Graphite merge queue for merging into master

Add the label “merge” to the PR and Graphite will automatically add it to the merge queue when it’s ready to merge.

You must have a Graphite account and log in to Graphite in order to use the merge queue. Sign up using this link.


if (this.state !== 'hidden') {
this.viewportOverlayWidget?.lock();
} else {
Copy link
Contributor

Choose a reason for hiding this comment

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

The order can be swapped here.
!== no need.

@doodlewind doodlewind merged commit e591bb8 into master May 10, 2024
19 checks passed
@doodlewind doodlewind deleted the fix/use-last-selection branch May 10, 2024 02:01
@donteatfriedrice donteatfriedrice restored the fix/use-last-selection branch May 14, 2024 05:56
@donteatfriedrice donteatfriedrice deleted the fix/use-last-selection branch May 21, 2024 09:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

4 participants