Skip to content

RTL/LTR , persian texts #1257

Description

@hesandanesh-create

What problem are you trying to solve?

Summary

Persian/Farsi (RTL) text is not rendered correctly in the Freebuff Desktop app.
Both user-typed messages and AI responses in Persian appear misaligned and
disordered — text is left-aligned (LTR) and the bidi algorithm produces broken
ordering for punctuation, parentheses, and mixed LTR/RTL content.

Environment

  • App: Freebuff Desktop
  • OS: Windows 11
  • App version: all versions
  • Language of text: Persian (Farsi), RTL script

Steps to Reproduce

  1. Open the Freebuff Desktop app.
  2. Type or paste a Persian sentence containing punctuation and parentheses,
    e.g.: سلام! لطفاً این متن را (با پرانتز) بررسی کنید.
  3. Send the message, and/or ask the assistant to reply in Persian.

Expected Behavior

Persian text should be displayed right-aligned, with correct visual ordering
of letters, punctuation, and parentheses (proper Unicode bidi handling).

Actual Behavior

Text is rendered left-aligned inside a LTR container. Punctuation and
parentheses appear in the wrong position, and mixed Persian/English content
is visually scrambled (see attached screenshots).

Technical Notes (for maintainers)

The likely cause is that the message container does not set
direction: rtl / dir="rtl" when the text contains RTL characters.
Persian script also requires proper font shaping (contextual letterforms),
which may be missing or incorrect in the current renderer.

Suggested Fix

  • Auto-detect RTL content (e.g., first-strong bidi heuristic or a regex check
    for Arabic/Persian Unicode ranges) and set dir="rtl" on the text container.
  • Ensure the UI font includes a Persian-capable typeface with proper shaping
    (e.g., Vazirmatn, Noto Sans Arabic, or system fallback).
  • Apply text-align: right and correct unicode-bidi for RTL messages.

Additional Context

This affects all Persian users. Persian is written by ~110 million people
globally, so proper RTL support would significantly improve usability.
Happy to provide more details or test fixes if needed.

Thank you! 🙏

What would you like to happen?

adding this feature

Area

CLI (terminal client)

Contribution

  • I would be willing to open a PR for this

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:desktopThe Electron desktop appbot:triagedClassified by the community triage bottype:bugA defect in the code with a reproducible failure

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions