fix: calendar graph year navigation buttons position in RTL layouts#5103
Open
iDavi wants to merge 3 commits into
Open
fix: calendar graph year navigation buttons position in RTL layouts#5103iDavi wants to merge 3 commits into
iDavi wants to merge 3 commits into
Conversation
|
Bugbot is not enabled for this team, so this pull request was not reviewed. Enable Bugbot in the Cursor dashboard to get automatic reviews on future PRs. |
|
Bugbot is not enabled for this team, so this pull request was not reviewed. Enable Bugbot in the Cursor dashboard to get automatic reviews on future PRs. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Linked issue (required)
Refs #4749
Summary / motivation (required)
In the statistics Calendar graph, the previous/next year navigation buttons are in the wrong position for RTL interface languages (Arabic, Hebrew, Persian). they sat on the wrong sides.
The graph itself is drawn LTR (oldest weeks on the left, most recent on the right). The navigation row, however, inherited the interface's RTL direction:
InputBoxis a centered flex row, so under RTL its children lay out right-to-left, flipping "previous" to the right and "next" to the left, against the grid they control)This pins the calendar's navigation row to LTR so the arrows stay aligned with the LTR-rendered heatmap. To allow that, the shared
InputBoxnow takes an optionaldirprop that defaults to the interface direction, and the calendar passesdir="ltr".Steps to reproduce
How to test (required)
Check that the fix is working:
Run anki with a RTL language
./run -l ar. Follow steps to reproduce the issue. Click in the buttons to assert that right arrow advance year and left arrow go to previous year.Check that there were no regressions:
Change language to any LTR one
./run -l en. Go to the same calendar graph. Click in the buttons to assert that right arrow advance year and left arrow go to previous year.Checklist
./ninja checkor an equivalent relevant check locally.I believe this is a trivial change, and I don't think the codebase has tooling to automatically test this kind of UI fix now.
Before / after
before

after

UI evidence (no regressions in english anki)
Scope