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

chore: RTL support for keyboard commands and pointer events #302

Merged
merged 17 commits into from
May 23, 2024
Merged

Conversation

pan-kot
Copy link
Member

@pan-kot pan-kot commented May 13, 2024

Description

Support for RTL

Observations:

  • Settings button dropdown opens to the left when direction="rtl";
  • Pressing arrow left when the palette is open causes screen to grow;
  • Need to invert the resize icon and cursor.
Screen.Recording.2024-05-13.at.15.15.38.mov

How has this been tested?

Review checklist

The following items are to be evaluated by the author(s) and the reviewer(s).

Correctness

  • Changes include appropriate documentation updates.
  • Changes are backward-compatible if not indicated, see CONTRIBUTING.md.
  • Changes do not include unsupported browser features, see CONTRIBUTING.md.
  • Changes were manually tested for accessibility, see accessibility guidelines.

Security

Testing

  • Changes are covered with new/existing unit tests?
  • Changes are covered with new/existing integration tests?

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

Copy link

codecov bot commented May 13, 2024

Codecov Report

Attention: Patch coverage is 93.22917% with 13 lines in your changes are missing coverage. Please review.

Project coverage is 93.60%. Comparing base (ebd3533) to head (6f12236).

Files Patch % Lines
src/internal/item-container/index.tsx 77.41% 7 Missing ⚠️
src/board/transition.ts 90.62% 3 Missing ⚠️
src/internal/utils/rects.ts 82.35% 3 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #302      +/-   ##
==========================================
- Coverage   93.61%   93.60%   -0.01%     
==========================================
  Files          62       62              
  Lines        4321     4444     +123     
  Branches      753      767      +14     
==========================================
+ Hits         4045     4160     +115     
- Misses        274      282       +8     
  Partials        2        2              

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

@pan-kot pan-kot changed the title chore: RTL support for keyboard commands chore: RTL support for keyboard commands and pointer events May 13, 2024
src/board/transition.ts Outdated Show resolved Hide resolved
direction = "right";
} else if (isRtl && direction === "right") {
direction = "left";
}
Copy link
Member Author

Choose a reason for hiding this comment

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

A better solution should be available here. Maybe it is easier to sort the "sources" differently depending on the page direction.

src/internal/utils/screen.ts Outdated Show resolved Hide resolved
top: top + yOffset,
bottom: bottom + yOffset,
width: width,
height: height,
} as DOMRect;
Copy link
Member Author

Choose a reason for hiding this comment

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

The DOMRect type is used in a bunch of places, it would be nice to replace it with some custom Rect type featuring rtl-friendly property names, maybe as a separate PR.

@pan-kot pan-kot requested a review from DaemonCahill May 22, 2024 09:40
@pan-kot pan-kot marked this pull request as ready for review May 22, 2024 09:40
@pan-kot pan-kot requested a review from a team as a code owner May 22, 2024 09:40
DaemonCahill
DaemonCahill previously approved these changes May 22, 2024
pages/app/page.tsx Outdated Show resolved Hide resolved
src/board/internal.tsx Outdated Show resolved Hide resolved
@pan-kot pan-kot merged commit b6e8324 into main May 23, 2024
31 checks passed
@pan-kot pan-kot deleted the rtl-1 branch May 23, 2024 14:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants