Skip to content

fix: calendar graph year navigation buttons position in RTL layouts#5103

Open
iDavi wants to merge 3 commits into
ankitects:mainfrom
iDavi:fix/calendar-graph-arrow-rtl
Open

fix: calendar graph year navigation buttons position in RTL layouts#5103
iDavi wants to merge 3 commits into
ankitects:mainfrom
iDavi:fix/calendar-graph-arrow-rtl

Conversation

@iDavi

@iDavi iDavi commented Jul 4, 2026

Copy link
Copy Markdown
Contributor

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: InputBox is 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 InputBox now takes an optional dir prop that defaults to the interface direction, and the calendar passes dir="ltr".

Steps to reproduce

  1. Set the interface language to any RTL language.
  2. Open the Statistics screen and view the Calendar graph.
  3. Observe the previous/next year buttons: they sit on the wrong sides

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

  • I ran ./ninja check or an equivalent relevant check locally.
  • I added or updated tests when the change is non-trivial or behavior changed.

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
image

after
image

UI evidence (no regressions in english anki)

image

Scope

  • This PR is focused on one change (no unrelated edits).

@cursor

cursor Bot commented Jul 4, 2026

Copy link
Copy Markdown

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.

@cursor

cursor Bot commented Jul 4, 2026

Copy link
Copy Markdown

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.

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.

1 participant