Skip to content

chore(desktop): remove the unreachable CLI installer and unread strings - #302

Closed
quickbeard wants to merge 2 commits into
mainfrom
remove-installcli
Closed

quickbeard wants to merge 2 commits into
mainfrom
remove-installcli

Conversation

@quickbeard

@quickbeard quickbeard commented Aug 22, 2026 •

Copy link
Copy Markdown
Owner

What

Two commits, both removing desktop renderer code nothing can reach.

1. The CLI installer. packages/desktop/src/renderer/cli.ts is imported by nothing, and the one call it makes has nothing behind it:

  • No ipcMain.handle("install-cli") exists anywhere in the tree, so window.api.installCli() could only ever reject with "No handler registered for 'install-cli'".
  • Its menu label had no menu item — DESKTOP_MENU (packages/app/src/desktop-menu.ts) has no Install CLI entry.

Removed: renderer/cli.ts, installCli from the ElectronAPI type and the preload object, and the five strings only it used.

2. The rest of the unread strings. The same dictionaries carried 13 more keys with no reader: desktop.menu.{checkForUpdates,reloadWebview,restart} and every desktop.updater.*. Both dictionaries feed one t() (renderer/i18n/index.ts) with exactly one importer, renderer/index.tsx, whose five call sites are all literal keys — error.dev.rootNotFound and the three desktop.dialog.*. Nothing else can reach the rest. Each dictionary is now three lines.

Their readers moved rather than disappeared: menu labels come from DESKTOP_MENU, and the updater dialogs are shown from the main process by main/updater.ts, where the renderer's t() cannot be called — so it hardcodes English.

Why removed rather than revived

I checked anomalyco/opencode@dev before deciding: it ships the same orphaned cli.ts, the same missing handler, and the same dead dictionary. This is stale upstream code, not something the fork broke.

One caveat I want visible rather than buried, because it is not a reason to keep the keys: the updater dialogs really are English-only. These strings would have been a translation's starting point, but they were never wired to those dialogs. Upstream's answer is packages/app/src/i18n/desktop-native.ts + nativeT() + a set-native-translations IPC channel that feeds the main process translated strings — if that lands in a sync, take it wholesale rather than reviving these keys. Both DIVERGENCES.md rows say so, along with the standing instruction to re-delete on sync since upstream still carries the dead copy.

Verification

  • bun turbo typecheck: 33/33 — this is what proves the ElectronAPI removal is safe; nothing implements or calls that member.
  • bun run test in packages/desktop: 132 pass / 0 fail.
  • bun run lint: byte-identical totals with and without the change (4894 warnings / 1 error, all pre-existing), and no findings in the touched files.
  • grep for installCli, install-cli, desktop.cli., desktop.menu., desktop.updater. across packages: no matches left outside the dictionaries' own history.

Rebased onto current main (post-#297), so the desktop tests here run in CI.

Quickbeard and others added 2 commits August 22, 2026 17:53
`renderer/cli.ts` was imported by nothing, and the one call it made —
`window.api.installCli()` — had no handler behind it: there is no
`ipcMain.handle("install-cli")` anywhere, so invoking it could only reject
with "No handler registered for 'install-cli'". Its menu label had no menu
item either; `DESKTOP_MENU` has no Install CLI entry, so the five strings it
owned were dead weight for translators.

Checked against anomalyco/opencode@dev, which carries the same three orphans
and the same missing handler: this is stale upstream code, not something the
fork broke. Removing it rather than reviving it — nothing here asks for a CLI
installer, and the CLI ships through npm.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
The same dictionaries carried 13 more keys nothing reads:
desktop.menu.{checkForUpdates,reloadWebview,restart} and every
desktop.updater.* string. Both dictionaries feed one t(), which has exactly
one importer — renderer/index.tsx — whose five call sites are all literal
keys: error.dev.rootNotFound and the three desktop.dialog.* strings. Nothing
else can reach them.

The readers moved rather than disappeared: menu labels now come from
DESKTOP_MENU, and the updater dialogs are shown from the main process by
main/updater.ts, where the renderer's t() cannot be called — so it hardcodes
English. That leaves those dialogs untranslated, which these strings do not
fix; upstream's answer is the desktop-native bundle and nativeT(), noted in
DIVERGENCES for whenever a sync brings it.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@quickbeard quickbeard changed the title chore(desktop): remove the unreachable CLI installer chore(desktop): remove the unreachable CLI installer and unread strings Aug 22, 2026
@quickbeard quickbeard closed this Aug 24, 2026
@quickbeard
quickbeard deleted the remove-installcli branch August 24, 2026 02:49
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