Skip to content

feat(app): rtl header for Hebrew and Arabic systems - #48856

Closed
arielfrja wants to merge 2 commits into
anomalyco:devfrom
arielfrja:rtl-header
Closed

arielfrja wants to merge 2 commits into
anomalyco:devfrom
arielfrja:rtl-header

Conversation

@arielfrja

@arielfrja arielfrja commented Sep 13, 2026 •

Copy link
Copy Markdown

Issue for this PR

N/A — found while running desktop dev on Hebrew Windows (no existing issue).

Type of change

  • Bug fix
  • New feature
  • Refactor / code improvement
  • Documentation

What does this PR do?

On Hebrew/Arabic Windows the native caption buttons (minimize/maximize/close) sit on the left side of the window, but the desktop titlebar always reserved space on the right (margin-right: auto) and never switched to RTL, so the header overlapped the caption controls.

Changes:

  • systemPrefersRtl() in packages/app/src/i18n/desktop-native.ts detects RTL OS languages from navigator.languages (which is the OS language in Electron), including Hebrew (he plus legacy iw). Hebrew has no UI bundle, so it keeps English strings but now gets RTL chrome.
  • New language.systemDirection() in the language context, consumed only by the titlebar: <header dir> plus margin-left: auto under RTL system languages / margin-right: auto under LTR ones. Document direction and conversation content still follow the UI locale — only the header follows the OS language, because only the native window chrome depends on it.
  • New direction.toggle command (mod+shift+d, View category) that flips the content direction, same as the debug-bar DIR switch. command.direction.toggle was added with English fallback text in the locale files; real translations should go through translate:app.

The second commit (fix: restore triple-slash references in custom-elements) is a prerequisite, not an unrelated feature: bun typecheck fails identically on clean dev without it, so no green CI is possible without it. Happy to split it into its own PR on request.

How did you verify your code works?

  • bun test src/i18n/desktop-native.test.ts (new systemPrefersRtl cases: he-IL, iw-IL, ar-EG, LTR negatives, tag normalization) plus the command/layout suites: 27 pass, 0 fail.
  • Full monorepo bun typecheck: 30/30 successful.
  • Ran electron-vite dev on Hebrew Windows and watched the header mirror with margin-left: auto; toggled content direction with the new hotkey.

Screenshots / recordings

image

Checklist

  • I have tested my changes locally
  • I have not included unrelated changes in this PR

@github-actions github-actions Bot added needs:compliance This means the issue will auto-close after 2 hours. and removed needs:compliance This means the issue will auto-close after 2 hours. labels Sep 13, 2026
@github-actions

Copy link
Copy Markdown
Contributor

Thanks for updating your PR! It now meets our contributing guidelines. 👍

@thdxr

thdxr commented Oct 10, 2026

Copy link
Copy Markdown
Member

This branch has been upgraded to V2. We're no longer taking PRs for V1. If you think this is still relevant, please port it over and open it for V2.

— from 𝕺𝖕𝖊𝖓𝕮𝖔𝖉𝖊

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.

2 participants