-
Notifications
You must be signed in to change notification settings - Fork 429
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(core): portable text annotations slow to show #7588
base: next
Are you sure you want to change the base?
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
1 Skipped Deployment
|
No changes to documentation |
Component Testing Report Updated Nov 7, 2024 7:59 AM (UTC) ✅ All Tests Passed -- expand for details
|
⚡️ Editor Performance ReportUpdated Thu, 07 Nov 2024 08:02:11 GMT
Detailed information🏠 Reference resultThe performance result of
🧪 Experiment resultThe performance result of this branch
📚 Glossary
|
4f918e7
to
18efbe9
Compare
18efbe9
to
782f0bc
Compare
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.
As always, fantastic work and great pr description :)
Description
Adding an annotation inside the PTE editor is perceived as slow, this is mainly because the annotation needs the annotation value to exist in the form value before being able to show the Popover for it.
Also:
Comments Input:
blurred
state to track when the editor loses focus, preventing immediate comment input display upon regaining focus (CommentsPortableTextInput.tsx
).Annotation:
isReady
state to ensure the annotation toolbar popover is only rendered when children are present , this means that the member exists. (Annotation.tsx
).Focus in Popover Modal:
PopoverModal.tsx
).Note
Upcoming changes:
The portable text editor package will be update to not debounce the
addAnnotation
actionScreen.Recording.2024-10-04.at.13.25.27.mov
What to review
Are this changes correct?
Is there any oversight to fix?
Testing
Visit a PTE field in the studio, add an annotation, the toolbar and comments button should not show. The first input should be focused once annotations render.
https://test-next-studio-git-pte-annotations.sanity.dev/test/structure/input-standard;portable-text;pt_allTheBellsAndWhistles;834d6ed4-7cb1-47b9-a533-a734e0f78693
Notes for release
Update annotations creations in portable text, autofocus on the first input.