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-playground] Fix: tabs do not show strikethrough/underline #6811

Merged
merged 36 commits into from
Dec 10, 2024

Conversation

vantage-ola
Copy link
Contributor

@vantage-ola vantage-ola commented Nov 8, 2024

Description

Made some changes to .PlaygroundEditorTheme__textStrikethrough to show strikethroughs on tabs

Closes #6808

Before

Screenshot 2024-11-08 161836

After selecting the whole text, it shows the strikethrough is present
Screenshot 2024-11-08 162158

After

The slight change in css makes the strikethrough visible

Screenshot 2024-11-08 162320

Copy link

vercel bot commented Nov 8, 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 Dec 10, 2024 6:04am
lexical-playground ✅ Ready (Inspect) Visit Preview 💬 Add feedback Dec 10, 2024 6:04am

@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 Nov 8, 2024
Copy link

github-actions bot commented Nov 8, 2024

size-limit report 📦

Path Size
lexical - cjs 31.11 KB (0%)
lexical - esm 30.98 KB (0%)
@lexical/rich-text - cjs 40.11 KB (0%)
@lexical/rich-text - esm 32.8 KB (0%)
@lexical/plain-text - cjs 38.74 KB (+0.14% 🔺)
@lexical/plain-text - esm 30.11 KB (0%)
@lexical/react - cjs 42 KB (0%)
@lexical/react - esm 34.15 KB (0%)

@vantage-ola
Copy link
Contributor Author

i took another approach to fixing this.., i just jumped into it without thinking and was in an hurry to fix it... I had even forgotten both underline and strikethrough existed...

the reason I used white-space: pre; is because normally HTML collapses multiple spaces into one, but white-space: pre treats them like <pre> tags

@vantage-ola
Copy link
Contributor Author

vantage-ola commented Nov 9, 2024

i took another approach to fixing this.., i just jumped into it without thinking and was in an hurry to fix it... I had even forgotten both underline and strikethrough existed...

the reason I used white-space: pre; is because normally HTML collapses multiple spaces into one, but white-space: pre treats them like \<pre\> tags

no need for them actually. 😅 silly me.. i was using display: inline-block; while trying out things...

Copy link
Collaborator

@etrepum etrepum left a comment

Choose a reason for hiding this comment

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

The e2e test suite is failing, both in CI here and I can reproduce the failures locally.

  5 failed
    [chromium] › packages/lexical-playground/__tests__/e2e/CodeBlock.spec.mjs:319:3 › CodeBlock › Can maintain indent when creating new lines 
    [chromium] › packages/lexical-playground/__tests__/e2e/CodeBlock.spec.mjs:407:3 › CodeBlock › Can (un)indent multiple lines at once 
    [chromium] › packages/lexical-playground/__tests__/e2e/CodeBlock.spec.mjs:891:3 › CodeBlock › When pressing CMD/Ctrl + Left, CMD/Ctrl + Right, the cursor should go to the start of the code 
    [chromium] › packages/lexical-playground/__tests__/e2e/Tab.spec.mjs:22:3 › Tab › can tab + IME ─
    [chromium] › packages/lexical-playground/__tests__/e2e/Tab.spec.mjs:92:3 › Tab › can tab inside code block #4399 
  21 skipped
  478 passed (6.4m)

You can run these suites locally by having npm run start in one terminal and then in another:

npm run test-e2e-chromium

To run a particular test or suite you can specify another argument, e.g.

npm run test-e2e-chromium packages/lexical-playground/__tests__/e2e/CodeBlock.spec.mjs:319:3

@etrepum
Copy link
Collaborator

etrepum commented Dec 6, 2024

I think most of these tests failures probably just mean that you have to change the tests to expect the tabNode class, but they need to be fixed nonetheless.

@vantage-ola
Copy link
Contributor Author

ok, thank you... will take a look at them

@vantage-ola
Copy link
Contributor Author

i think its good to go now

Copy link
Collaborator

@etrepum etrepum left a comment

Choose a reason for hiding this comment

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

Other than the circular dependency I think this is good enough, there are still some slight difference in how the text is rendered which are clear especially when a background color is added but that's just a matter of tweaking the CSS accordingly. Since this CSS is in the playground and not part of the package itself I think that it's acceptable.

Playground

Screenshot 2024-12-07 at 16 53 37

This PR

Screenshot 2024-12-07 at 16 53 28

packages/lexical/package.json Outdated Show resolved Hide resolved
packages/lexical/src/nodes/LexicalTabNode.ts Outdated Show resolved Hide resolved
Co-authored-by: Bob Ippolito <bob@redivi.com>
Copy link
Collaborator

@etrepum etrepum left a comment

Choose a reason for hiding this comment

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

There are still some issues with the integrity check, maybe because package-lock.json is still changed unnecessarily, or maybe because there is still a dependency on @lexical/utils in LexicalTabNode.ts. Once you fix it, npm run ci-check should pass locally as well.

package-lock.json Outdated Show resolved Hide resolved
packages/lexical/src/nodes/LexicalTabNode.ts Outdated Show resolved Hide resolved
@vantage-ola
Copy link
Contributor Author

the strikethrough, underline or both doesnt align when the font is different, i dont think there is a way the css can accomodate all of the fonts and they will be consistent across the playground editor(i may be wrong).
Screenshot 2024-12-09 154408

@etrepum etrepum added this pull request to the merge queue Dec 10, 2024
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to no response for status checks Dec 10, 2024
@etrepum etrepum added this pull request to the merge queue Dec 10, 2024
Merged via the queue into facebook:main with commit df15f53 Dec 10, 2024
11 checks passed
@vantage-ola vantage-ola deleted the fix-strikethrough-issue branch December 12, 2024 13:40
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.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Bug: Tabs do not show strikethrough
4 participants