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(files): add tiptap-text-direction extension to support RTL #6874

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

JuliaKirschenheuter
Copy link
Contributor

📝 Summary

Now it is possible to detect RTL writing style for languages, which requires RTL. Using https://github.com/amirhhashemi/tiptap-text-direction extension. This version works for:

  • Paragraph
  • Heading
  • Lists

🖼️ Screenshots

🏚️ Before 🏡 After
Screenshot from 2025-01-23 16-09-02 Screenshot from 2025-01-23 16-07-29

🏁 Checklist

  • Code is properly formatted (npm run lint / npm run stylelint / composer run cs:check)
  • Sign-off message is added to all commits
  • Tests (unit, integration and/or end-to-end) passing and the changes are covered with tests
  • Documentation (README or documentation) has been updated or is not required

Copy link

@hamza221 hamza221 left a comment

Choose a reason for hiding this comment

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

Looks good 🙏🏼

Copy link
Collaborator

@max-nextcloud max-nextcloud left a comment

Choose a reason for hiding this comment

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

The test failures look related as now dir="ltr" is include in some of the html output of the unit tests. I think you can just adjust the expectation to match the actual outcome - and we get a test for this extension for free.

Other than that and the linter fix this looks great. Thanks for looking into it!

Would be nice if we could backport it as I think it really fixes a UX bug for rtl and mixed language use.

src/extensions/RichText.js Show resolved Hide resolved
Signed-off-by: julia.kirschenheuter <julia.kirschenheuter@nextcloud.com>
@JuliaKirschenheuter
Copy link
Contributor Author

/backport to stable28

@JuliaKirschenheuter
Copy link
Contributor Author

/backport to stable29

@JuliaKirschenheuter
Copy link
Contributor Author

/backport to stable30

Copy link

codecov bot commented Feb 12, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 37.99%. Comparing base (3fe2d5c) to head (6c1bcf3).

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #6874      +/-   ##
==========================================
+ Coverage   37.85%   37.99%   +0.13%     
==========================================
  Files         750      735      -15     
  Lines       42637    42498     -139     
  Branches     1273     1258      -15     
==========================================
+ Hits        16142    16146       +4     
+ Misses      25873    25745     -128     
+ Partials      622      607      -15     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Member

@juliusknorr juliusknorr left a comment

Choose a reason for hiding this comment

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

Change looks sane, @max-nextcloud could you also have a quick look/approval before merging?

Copy link
Collaborator

@max-nextcloud max-nextcloud left a comment

Choose a reason for hiding this comment

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

Code changes look good. Thanks for taking care of this.
🚀

@max-nextcloud
Copy link
Collaborator

Not sure what happened with the cypress tests. Restarted them.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: 👀 In review
Development

Successfully merging this pull request may close these issues.

RTL support
4 participants