Skip to content

feat(ui-tui): right-to-left text shaping (§8 bidi) - #529

Merged
ericleepi314 merged 1 commit into
mainfrom
tui/rtl-shaping
Jun 28, 2026
Merged

feat(ui-tui): right-to-left text shaping (§8 bidi)#529
ericleepi314 merged 1 commit into
mainfrom
tui/rtl-shaping

Conversation

@ericleepi314

Copy link
Copy Markdown
Collaborator

Summary

Ports RTL/bidi handling as a pure-TS shaper (no deps). src/bidi.ts reverses RTL runs (Hebrew/Arabic, incl. presentation forms) into visual order within LTR-base text, keeping digit sub-runs in logical order — the common case (RTL words in otherwise-LTR content) on terminals without native bidi. Opt-in via /rtl (and CLAWCODEX_RTL=1) since bidi-capable terminals would otherwise double-reorder.

Scoped honestly: not full UAX #9 (no base-RTL paragraph resolution / nested levels). Display-only — stored entry text stays logical, so /export and /copy are unaffected.

Verification

bidi unit cases (RTL word reversed, spaced run, digits keep order, no-RTL untouched); in-app /rtl toggles and a Hebrew assistant line renders reversed while the logical form is not shown. typecheck + build clean. 65 commands.

🤖 Generated with Claude Code

Port RTL/bidi handling as a pure-TS shaper (no deps). src/bidi.ts reverses RTL
runs (Hebrew/Arabic, incl. presentation forms) into visual order within LTR-base
text, keeping digit sub-runs in logical order — the common case (RTL words in
otherwise-LTR content) on terminals without native bidi. Opt-in via /rtl (and
CLAWCODEX_RTL=1) since bidi-capable terminals would otherwise double-reorder.

Scoped honestly: not full UAX #9 (no base-RTL paragraph resolution / nested
levels). Display-only — stored entry text stays logical, so /export and /copy are
unaffected.

Verified: bidi unit cases (RTL word reversed, spaced run, digits keep order,
no-RTL untouched); in-app /rtl toggles and a Hebrew assistant line renders
reversed while the logical form is not shown.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@ericleepi314
ericleepi314 merged commit 94c72f7 into main Jun 28, 2026
@ericleepi314
ericleepi314 deleted the tui/rtl-shaping branch June 28, 2026 05:29
singlaamitesh pushed a commit to singlaamitesh/clawcodex that referenced this pull request Jul 7, 2026
Port RTL/bidi handling as a pure-TS shaper (no deps). src/bidi.ts reverses RTL
runs (Hebrew/Arabic, incl. presentation forms) into visual order within LTR-base
text, keeping digit sub-runs in logical order — the common case (RTL words in
otherwise-LTR content) on terminals without native bidi. Opt-in via /rtl (and
CLAWCODEX_RTL=1) since bidi-capable terminals would otherwise double-reorder.

Scoped honestly: not full UAX agentforce314#9 (no base-RTL paragraph resolution / nested
levels). Display-only — stored entry text stays logical, so /export and /copy are
unaffected.

Verified: bidi unit cases (RTL word reversed, spaced run, digits keep order,
no-RTL untouched); in-app /rtl toggles and a Hebrew assistant line renders
reversed while the logical form is not shown.

Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
ericleepi314 added a commit that referenced this pull request Jul 21, 2026
Port RTL/bidi handling as a pure-TS shaper (no deps). src/bidi.ts reverses RTL
runs (Hebrew/Arabic, incl. presentation forms) into visual order within LTR-base
text, keeping digit sub-runs in logical order — the common case (RTL words in
otherwise-LTR content) on terminals without native bidi. Opt-in via /rtl (and
CLAWCODEX_RTL=1) since bidi-capable terminals would otherwise double-reorder.

Scoped honestly: not full UAX #9 (no base-RTL paragraph resolution / nested
levels). Display-only — stored entry text stays logical, so /export and /copy are
unaffected.

Verified: bidi unit cases (RTL word reversed, spaced run, digits keep order,
no-RTL untouched); in-app /rtl toggles and a Hebrew assistant line renders
reversed while the logical form is not shown.

Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
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