Repository navigation
feat(zcode-rtl-fixer): add Persian/English RTL fixer plugin for ZCode Desktop - #362
Open
sajjadyousefnia wants to merge 2 commits into
Open
sajjadyousefnia wants to merge 2 commits into
sajjadyousefnia wants to merge 2 commits into
Conversation
… Desktop Community plugin v0.2.0 under external_plugins/: per-paragraph automatic RTL (first-strong), Persian font, RTL tables and list markers in the ZCode Desktop chat box; code blocks untouched. Ships commands /rtl:install|status|font| settings|uninstall, a management skill, a dependency-free ASAR patcher and 23 unit tests. Marketplace entry registered with en/zh-CN description_i18n.
sajjadyousefnia
requested review from
jacksonliuyn and
panda920
as code owners
November 28, 2026 04:21
Collaborator
|
✅ Internal validation passed. A ZCode maintainer will review the change next; after acceptance, release checks run separately and this PR is closed automatically. |
…in ZCode desktop entry to the patched instance
Collaborator
|
✅ Internal validation passed. A ZCode maintainer will review the change next; after acceptance, release checks run separately and this PR is closed automatically. |
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Plugin type (required) / 插件类型(必填)
Affected plugin name(s) / 涉及的插件名称:
zcode-rtl-fixer(Standard plugin)What / 改动内容
Adds a new community plugin
external_plugins/zcode-rtl-fixer(v0.2.0) plus itsmarketplace.jsonentry.Problem. In ZCode Desktop, messages that mix Persian and English render with a hard LTR base direction: Persian paragraphs hug the left edge, embedded English terms scramble word order, list markers sit on the wrong side, and users resort to copy-pasting text into other editors to read it.
Solution. A small, dependency-free renderer bootstrap (settings baked at patch time) is injected into the app's
out/renderer/index.htmlof an extracted AppImage copy. It provides:unicode-bidi: plaintext(first-strong) — Persian aligns right, English stays left, even within one message;code/pre/language-*/hljs), the terminal and editors are untouched;Ships commands
/rtl:install,/rtl:status,/rtl:font,/rtl:settings,/rtl:uninstalland a management skill. The original AppImage and the running instance are never modified: the patch targets~/.local/share/zcode-rtl-fixer/app(extracted copy), keeps a pristineapp.asar.origbackup (idempotent re-patch), and registers a "ZCode RTL" launcher + desktop entry.How it was tested.
node tests/run-tests.mjs): bidi heuristics, ASAR read/patch/extract round-trips (incl. symlink entries, header growth, integrity metadata), patcher idempotency and settings baking, engine/manifest/catalog version sync.Repo checks:
python3 scripts/validate.py→OK: 59 plugin(s) validated.python3 scripts/build_dist.pycannot complete on a plain checkout because unbuilt UI plugins (e.g. excalidraw) requirepnpm buildfirst — unrelated to this PR. This plugin packages cleanly through the same pipeline functions (build_zip/build_index_entry): deterministic zip of 16 entries, sha2562ac333…8b2,componentTypes: [command, skill],publisherType: community.git diff --checkpasses.Dependencies, network, permissions, side effects (documented in both READMEs):
/rtl:fontcommand downloading the Vazirmatn release zip from GitHub. No telemetry.~/.local/share/zcode-rtl-fixer/,~/.local/bin/zcode-rtl,~/.local/share/applications/zcode-rtl.desktop,~/.fonts/(font command only),~/.zcode/rtl-fixer/settings.json.--appimage-extract,unzip,fc-cache/fc-list,mvduring install. All scripts are original and dependency-free (Node stdlib only).Licensing / provenance. All plugin code is original, MIT (LICENSE included). The Vazirmatn font (SIL Open Font License 1.1) is downloaded at runtime only when the user requests a font install; no font binaries are committed.
Self-check / 自查清单
external_plugins/<name>// 插件名唯一且 kebab-case,位于external_plugins/<name>/categoryis set (utilities) / 分类已填写versionis 0.2.0 in BOTHplugin.jsonandmarketplace.json/ 两处版本号一致README.md(EN) andREADME_CN.md(中文) both present and equivalent / 中英文 README 均已提供description_i18nhas bothenandzh-CNin both manifests / 两处均含 en 与 zh-CNpython3 scripts/validate.pypasses locally;build_dist.pyverified for this plugin (full dist blocked by pre-existing unbuilt UI plugins) / 本地校验通过