Skip to content

Add RTL toggle button for preview pane#67

Open
EssamSoft wants to merge 4 commits into
ThisIs-Developer:mainfrom
EssamSoft:feat/RTL-button
Open

Add RTL toggle button for preview pane#67
EssamSoft wants to merge 4 commits into
ThisIs-Developer:mainfrom
EssamSoft:feat/RTL-button

Conversation

@EssamSoft
Copy link
Copy Markdown

Adds an RTL button (text-only, no icon) to both the desktop toolbar and mobile menu that toggles right-to-left direction on the markdown preview. State is persisted to localStorage and restored on page load.

Adds an RTL button (text-only, no icon) to both the desktop toolbar and
mobile menu that toggles right-to-left direction on the markdown preview.
State is persisted to localStorage and restored on page load.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@vercel
Copy link
Copy Markdown

vercel Bot commented Apr 6, 2026

@EssamSoft is attempting to deploy a commit to the ThisIs-Developer Team on Vercel.

A member of the Team first needs to authorize it.

@vercel
Copy link
Copy Markdown

vercel Bot commented Apr 7, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
markdown-viwer Ready Ready Preview, Comment May 21, 2026 4:53am

@ThisIs-Developer
Copy link
Copy Markdown
Owner

Thank you for the idea and implementation, but there is a question about why we need the RTL button. Already in #61 , it mentions that the space needs to be clear for more working space. I don't think it's a good idea to add it right now, but I have a plan to implement it. I want to make a panel with all tools like H1, H2, H3, inline, bold, table, code, quote, etc., and there I will add this RTL button. Is that ok?
image

@EssamSoft
Copy link
Copy Markdown
Author

Thank you for the idea and implementation, but there is a question about why we need the RTL button. Already in #61 , it mentions that the space needs to be clear for more working space. I don't think it's a good idea to add it right now, but I have a plan to implement it. I want to make a panel with all tools like H1, H2, H3, inline, bold, table, code, quote, etc., and there I will add this RTL button. Is that ok? image

Thanks for your response. I think adding a toolbar might make the UX a bit more complicated. The simplified RTL button is very useful for me as an Arabic speaker. Some documents contain both Arabic and English, which causes reading issues due to the conflicting text directions between the two languages. For my use case, the ideal solution is the ‘magic’ RTL button to switch direction on demand while reading.

CleanShot 2026-04-19 at 04 08 06@2x

@ThisIs-Developer ThisIs-Developer added the enhancement New feature or request label May 2, 2026
@ThisIs-Developer
Copy link
Copy Markdown
Owner

ThisIs-Developer commented May 8, 2026

Hi @EssamSoft , Thank you for your support and contribution.
I was really inspired by your implementation for Arabic and right-to-left reading support. Your feedback about making reading easier for Arabic users was amazing and very helpful.
Based on your pull request and suggestion, I have now implemented both RTL and LTR toggle buttons in the new version of the Markdown Viewer.
Please review the updated feature and share your feedback or suggestions for further improvements. I’d really appreciate your thoughts on making it even better.

Thanks again for your contribution and support!
https://ffb0b8d2.markdown-viewer.pages.dev/#share=eJydU0tOw0AM3fcUwwV6C5asOEElxAZBJYrEummShlBR9QgQlXyaEPUDJZzEvg3PdlpRhLpgk4x_z89vPBzQkirKKOVHdzoY9K7P-5d3NOl0aMMjxMRPJa04Zl8N_GpqOOARB44jDmgN_xj_QlzdTod99qh2lCJSwLDY1AFvwXGLCYDQUUFbygDtGVoLjVKU-fRFuR6pQRHSYHKkMU9Q6FkciiO-GMdYjDmMh9Yn5GjZld4ph1RIPubAyJ_4KmPL9FA7A1F0rDCVL9zWoB7L8VdLX4cu6I1q6XmErta8wpGrVDyEtzYIyU8lCYohOxRw0box9lskZK3GyPPQTrAqcdHEga-Jqg1fZOwM9hDlyjihleYvLaFAtLZIZiL9Q8Wj4rcpB2UtlExtNOb0jvH3rErhhE0xmEYC9OHOerdXF_37G9ElgafkSDNMjECblyqpdkEPzLo3prjamp94RotWdNoIMBYg__PyE8D_FHgfUdkqLAFm4DGlXYcZE4QimSlQ_cPd-6h3b-PFrtywbZNwjvXmc114-PAIFPHglYF-O6HAGeBuG469uJNvyyp70Q
Screenshot 2026-05-08 111548

@EssamSoft
Copy link
Copy Markdown
Author

EssamSoft commented May 10, 2026

Thank you for the update! 🙏

One small UX note: placing the RTL button at the top of the preview pane would feel more natural — when users are in reading mode, they're not interacting with the editor toolbar, so a dedicated button near the preview area would be more accessible.

@ThisIs-Developer
Copy link
Copy Markdown
Owner

ThisIs-Developer commented May 21, 2026

@EssamSoft First of all, thank you. I really respect that you’re still putting effort into these features and supporting the developer community.

Coming to the PR, I’ve reviewed the changes and found a few issues that need clarification/fixes:

  1. The RTL toggle is currently placed between the Share and Theme Toggle buttons. It should be moved beside the “Preview Only” button.
  2. The button label behavior is confusing:
    • When clicking the RTL button, the preview text changes to RTL correctly.
    • However, the button label itself does not change from “RTL” to “LTL”.
  3. By default, the editor/preview should start in LTR mode. Clicking the toggle should switch it to RTL.
  4. Currently, RTL is only applying to the Preview section, not to the Editor mode.
  5. Need to remove the existing (R/L Btn on toolbar).

@EssamSoft
Copy link
Copy Markdown
Author

EssamSoft commented May 22, 2026

@ThisIs-Developer

Thank you for your response

Let me clarify the confusion

The RTL toggle is currently placed between the Share and Theme Toggle buttons. It should be moved beside the “Preview Only” button.

Agreed


The button label behavior is confusing:

  • When clicking the RTL button, the preview text changes to RTL correctly.
  • However, the button label itself does not change from “RTL” to “LTL”.

Yes you are right! We should change the label to LTR.


By default, the editor/preview should start in LTR mode. Clicking the toggle should switch it to RTL. Currently, RTL is only applying to the Preview section, not to the Editor mode.

Exactly, We shouldn't apply RTL to the editor.


Need to remove the existing (R/L Btn on toolbar).

Agreed.

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

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants