Skip to content

v0.1.7 — window-controls LTR fix, hardened safe-close, broader RTL docs - #1

Open
7odaifa-ab wants to merge 6 commits into
pawnsmaster:mainfrom
7odaifa-ab:release/v0.1.7
Open

v0.1.7 — window-controls LTR fix, hardened safe-close, broader RTL docs#1
7odaifa-ab wants to merge 6 commits into
pawnsmaster:mainfrom
7odaifa-ab:release/v0.1.7

Conversation

@7odaifa-ab

Copy link
Copy Markdown

v0.1.7

  • Window-controls fix: launch the app with --force-ui-direction=ltr (Windows direct + packaged activation, and macOS), so on an RTL OS locale the native minimize/maximize/close controls and menu bar stay in place instead of being mirrored over the app's own buttons. No app modification — it's a startup flag, confirmed working on Arabic Windows.
  • Hardened safe-close: the Windows launcher now polls up to ~10s for the app (and background/tray processes) to fully exit before relaunching, instead of a fixed 1s wait — avoids spurious failures and single-instance-lock races. Matches what the macOS launcher already did.
  • Docs: clarify that the toolkit detects any right-to-left script, not just Arabic (Arabic, Persian, Urdu, and other RTL scripts), and document the window-chrome fix.

Verified: npm run check is green (unit tests + PowerShell/launcher/extension-sync checks).

Add the Chromium switch --force-ui-direction=ltr to the Windows launch paths
(direct launch and packaged-app activation). On an Arabic/RTL Windows locale
Chromium otherwise mirrors the native window chrome (WS_EX_LAYOUTRTL), flipping
the minimize/maximize/close controls onto the app's own buttons and misplacing
the menu bar. The switch corrects this at process start without modifying the
app; RTL text direction is still handled in the renderer.

Also replace the fixed 1s wait after Stop-Process with a ~10s poll loop, so a
slow/busy exit (or antivirus scanning the process) no longer fails the launcher
spuriously, and the fresh debug/UI-direction instance is not swallowed by a
lingering single-instance lock. Matches the poll the macOS launcher already does.
Pass --force-ui-direction=ltr when launching the app on macOS, matching the
Windows launchers, so the native window chrome stays LTR on RTL OS locales.
Clarify that the toolkit detects any right-to-left script, not just Arabic:
direction is decided per Unicode code point, so Arabic and Arabic-script
languages (Persian, Urdu, Kurdish, Pashto, Sindhi, Uyghur) and other RTL scripts
are all supported. The detection core already covers these ranges; only the docs
lagged.

Also document the native window-chrome LTR fix (--force-ui-direction=ltr) and the
hardened wait-for-exit in the launcher list.
Bundles the native window-controls LTR fix (--force-ui-direction=ltr on the
Windows and macOS launchers), the hardened wait-for-exit safe-close, and the
documentation updates clarifying broad RTL script support (Arabic, Persian,
Urdu, and other right-to-left scripts).
@7odaifa-ab

Copy link
Copy Markdown
Author

@pawnsmaster waiting for review..

@pawnsmaster

Copy link
Copy Markdown
Owner

Thanks for the contribution. I don’t currently have access to a Mac, so I can’t test the macOS launcher myself.
Before merging, could you please verify it on a real Mac and confirm that it handles background ChatGPT/Electron processes correctly? Also, please replace:

npm install --omit=dev
with:

npm ci --omit=dev --ignore-scripts

This keeps the installation reproducible and avoids running dependency lifecycle scripts.

- Replace `npm install --omit=dev` with `npm ci --omit=dev --ignore-scripts` in
  the macOS launcher, so the install is reproducible from the lockfile and no
  dependency lifecycle scripts run (matches the Windows launcher).
- Harden the macOS pre-launch close so background/windowless and Electron helper
  processes are handled: detect the app by its main process OR any helper running
  from the bundle, ask it to quit gracefully, then, if anything ignores the
  request, force the whole bundle down (pkill on the .app path) and re-poll before
  giving up.
@7odaifa-ab

Copy link
Copy Markdown
Author

Thanks! Done both:

  • Replaced npm install --omit=dev with npm ci --omit=dev --ignore-scripts.
  • Hardened the macOS pre-launch close: it now detects the app by its main process or any Electron helper running from the bundle, quits gracefully first, and if anything lingers it force-kills the whole bundle (pkill -f "$APP/Contents/") and re-polls before giving up.

On the Mac verification — I want to be upfront: I don't currently have access to a Mac either, so I haven't run it on real hardware. The launcher uses only standard macOS mechanisms (open -na --args, osascript … to quit, pgrep/pkill scoped to the app bundle), but I can't honestly claim it's verified.

If you're OK with it, I'd suggest merging the Windows-verified changes and treating the macOS launcher as best-effort until one of us can test on a Mac — or I can split the macOS launcher into a separate PR so this one stays fully verified. Your call.

@zakhm-innovations

Copy link
Copy Markdown

Tested on real Apple Silicon hardware running macOS 26.2 with Node v20.19.4 and /Applications/ChatGPT.app, using the release/v0.1.7 branch.

Everything passed:

  • npm ci --omit=dev --ignore-scripts
  • npm run check (Node syntax check, extension sync, and launcher parsing)
  • npm test — all 10 unit tests passed
  • Run-CodexLTR.command — completed successfully with exit code 0

I also tested the launcher end to end. It detected the running ChatGPT app, closed it cleanly, relaunched it using open -na, and injected into app://-/index.html. The launcher then confirmed: “RTL support is active for this app session.”

I verified the result through CDP as well: window.__CODEX_RTL_ACTIVE__ was set to true, and the RTL style tag containing unicode-bidi was present.

Finally, I checked the DevTools port with lsof. Port 9223 was bound only to 127.0.0.1, so the local-only security claim is accurate.

@7odaifa-ab

Copy link
Copy Markdown
Author

@pawnsmaster I brought a reviewer :)

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.

3 participants