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

impr(tape mode): support RTL languages (@NadAlaba) #5748

Open
wants to merge 30 commits into
base: master
Choose a base branch
from

Conversation

NadAlaba
Copy link
Contributor

@NadAlaba NadAlaba commented Aug 8, 2024

Description

Other than the changes made in #5868, this PR has its changes in its last commit impr(tape mode): support RTL languages (@NadAlaba) which has the following changes:

  1. In scrollTape():

    • Current language is await-checked if it's RTL, which requires scrollTape() to be async.
    • An edit to the calculation of the current word width in tape=letter explained in point 3 below.
    • In RTL, start #words margin-left by putting #words right edge in the center of #wordsWrapper (newMargin = - wordsEl.offsetWidth + wordsWrapperWidth/2), then put the first letter of the first word in that center (newMargin += wordRightMargin), and finally add words widths instead of subtracting them like in LTR.
  2. scrollTape() becomeing async requires? it to be awaited in where it is called which requires the calling functions to become async, and the chain continues. Functions that were changed to async:

    • in test-ui.ts: callback in ConfigEvent.subscribe(), updateActiveElement(), updateWordWrapperClasses(), showWords(), updateWordsMargin(), callback in #words.animate.complete() in scrollTape().
    • in input-controller.ts: backspaceToPrevious(), callback in $("#wordsInput").on("input").
    • in ui.ts: callback in debouncedEvent().
  3. Subtract the width of the last letter that has a positive width if the current letter has a zero width (e.g, diacritics). This is needed when calculation is based on letter widths instead of letter position, which is done in caret.ts when tape=word, and in scrollTape() when tape=letter.

  4. Remove restriction on RTL tape mode from test-logic.ts.

closes #3923

@monkeytypegeorge monkeytypegeorge added the frontend User interface or web stuff label Aug 8, 2024
Copy link
Contributor

This PR is stale. Please trigger a re-run of the PR check action.

@github-actions github-actions bot added the Stale Has not been updated in a while label Aug 16, 2024
@Miodec
Copy link
Member

Miodec commented Aug 23, 2024

Weird issue i ran into when testing this (sometimes words are slow to appear on the right)

Screen.Recording.2024-08-23.at.14.49.04.mov

@Miodec Miodec added the waiting for update Pull requests or issues that require changes/comments before continuing label Aug 23, 2024
@github-actions github-actions bot removed the Stale Has not been updated in a while label Aug 23, 2024
@NadAlaba
Copy link
Contributor Author

Weird issue i ran into when testing this (sometimes words are slow to appear on the right)

Resolved!

Please merge #5824 before this to perform final test on this one.

Copy link
Contributor

github-actions bot commented Sep 2, 2024

This PR is stale. Please trigger a re-run of the PR check action.

@github-actions github-actions bot added the Stale Has not been updated in a while label Sep 2, 2024
@NadAlaba NadAlaba marked this pull request as draft September 10, 2024 18:32
@github-actions github-actions bot removed the Stale Has not been updated in a while label Sep 10, 2024
@github-actions github-actions bot removed the waiting for update Pull requests or issues that require changes/comments before continuing label Sep 10, 2024
@NadAlaba NadAlaba marked this pull request as ready for review September 10, 2024 23:01
@github-actions github-actions bot added the waiting for review Pull requests that require a review before continuing label Sep 10, 2024
@NadAlaba
Copy link
Contributor Author

This is built on top of #5868, so it'd be easier to review that PR first

@NadAlaba NadAlaba marked this pull request as draft September 26, 2024 16:05
@github-actions github-actions bot removed the waiting for review Pull requests that require a review before continuing label Sep 26, 2024
@NadAlaba NadAlaba marked this pull request as ready for review September 28, 2024 16:30
@github-actions github-actions bot added the waiting for review Pull requests that require a review before continuing label Sep 28, 2024
Copy link
Contributor

github-actions bot commented Oct 7, 2024

This PR is stale. Please trigger a re-run of the PR check action.

@github-actions github-actions bot added the Stale Has not been updated in a while label Oct 7, 2024
@github-actions github-actions bot closed this Oct 15, 2024
@Miodec Miodec reopened this Oct 16, 2024
@github-actions github-actions bot removed the Stale Has not been updated in a while label Oct 16, 2024
Copy link
Contributor

This PR is stale. Please trigger a re-run of the PR check action.

@github-actions github-actions bot added the Stale Has not been updated in a while label Oct 24, 2024
@github-actions github-actions bot closed this Oct 31, 2024
@Miodec Miodec reopened this Nov 4, 2024
@github-actions github-actions bot removed the Stale Has not been updated in a while label Nov 9, 2024
Copy link
Contributor

This PR is stale. Please trigger a re-run of the PR check action.

@github-actions github-actions bot added the Stale Has not been updated in a while label Nov 19, 2024
@github-actions github-actions bot closed this Dec 8, 2024
@Miodec Miodec reopened this Dec 9, 2024
@github-actions github-actions bot removed the Stale Has not been updated in a while label Dec 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
frontend User interface or web stuff waiting for review Pull requests that require a review before continuing
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Update tape mode to support right to left languages
3 participants