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

[lexical-list][lexical-playground] Bug fix: support pasting google doc checklist #6191

Merged
merged 7 commits into from
May 30, 2024

Conversation

potatowagon
Copy link
Contributor

@potatowagon potatowagon commented May 29, 2024

Description

support pasting google doc checklist

Closes #6022

Test plan

added unit test

Before

Screenshot 2024-05-29 at 1 17 57 PM

^ the checkboxes are img so unusable

After

Screenshot 2024-05-29 at 1 14 01 PM

Copy link

vercel bot commented May 29, 2024

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

Name Status Preview Comments Updated (UTC)
lexical ✅ Ready (Inspect) Visit Preview 💬 Add feedback May 29, 2024 3:33pm
lexical-playground ✅ Ready (Inspect) Visit Preview 💬 Add feedback May 29, 2024 3:33pm

@facebook-github-bot facebook-github-bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label May 29, 2024
@potatowagon potatowagon marked this pull request as draft May 29, 2024 01:03
Copy link

github-actions bot commented May 29, 2024

size-limit report 📦

Path Size Loading time (3g) Running time (snapdragon) Total time
packages/lexical/dist/Lexical.js 23.95 KB (0%) 480 ms (0%) 519 ms (+374.71% 🔺) 998 ms
packages/lexical-rich-text/dist/LexicalRichText.js 34.64 KB (0%) 693 ms (0%) 578 ms (+71.88% 🔺) 1.3 s
packages/lexical-plain-text/dist/LexicalPlainText.js 34.62 KB (0%) 693 ms (0%) 613 ms (+105.19% 🔺) 1.4 s

@potatowagon potatowagon changed the title [lexical-list][lexical-playground] Bug fix: pasting google doc checklist [lexical-list][lexical-playground] Bug fix: support pasting google doc checklist May 29, 2024
@potatowagon potatowagon marked this pull request as ready for review May 29, 2024 05:30
@potatowagon potatowagon requested a review from Sahejkm as a code owner May 29, 2024 05:45
ivailop7
ivailop7 previously approved these changes May 29, 2024
@lexical-bot lexical-bot added the extended-tests Run extended e2e tests on a PR label May 29, 2024
img.parentElement != null &&
img.parentElement.tagName === 'LI' &&
img.previousSibling === null &&
img.src.startsWith('data:image/png;base64,iVBOR')
Copy link
Contributor

Choose a reason for hiding this comment

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

this image node has roledescription="checkbox" IMO it's better to check for it rather then performing base64 match

zurfyx
zurfyx previously approved these changes May 29, 2024
Comment on lines 498 to 503
isHTMLElement(domNode) &&
(domNode.getAttribute('aria-checked') === 'true'
? true
: domNode.getAttribute('aria-checked') === 'false'
? false
: undefined);
Copy link
Member

Choose a reason for hiding this comment

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

Why is the undefined important here? Nit, can we simplify this nested ternary? We can even retrieve the getAttribute once which saves us from a second getAttribute call

Copy link
Contributor Author

@potatowagon potatowagon May 29, 2024

Choose a reason for hiding this comment

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

the undefined is for non checkbox cases, eg. bullet list. sure will save the getAttribute as var

@potatowagon
Copy link
Contributor Author

test failures are from flaky test & unrelated to PR changes. double check on main the same tests fail

@potatowagon potatowagon added this pull request to the merge queue May 30, 2024
Merged via the queue into main with commit 621e3eb May 30, 2024
37 of 38 checks passed
@potatowagon potatowagon deleted the fix-checkbox-paste branch September 11, 2024 07:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. extended-tests Run extended e2e tests on a PR
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Bug: Google Docs checklist does not paste correctly
6 participants