Skip to content

feat(desktop): rebrand the persisted store names to codev - #317

Merged
quickbeard merged 1 commit into
mainfrom
rebrand-store-names
Aug 24, 2026
Merged

quickbeard merged 1 commit into
mainfrom
rebrand-store-names

Conversation

@quickbeard

Copy link
Copy Markdown
Owner

The desktop troubleshooting docs tell you to reset the app by deleting these files by name:

  • opencode.settings.dat — the desktop default server URL
  • opencode.global.dat and opencode.workspace.*.dat — UI state such as recent servers and projects

So they are a user-visible surface, not an internal id — a user following that page reads upstream's product name out of their own app data directory. This renames them to codev.*.

(The docs are also stale on one point: the Electron settings store is opencode.settings, with no .dat — that was the Tauri-era name. The docs PR fixes that alongside the rename.)

What changed

Every persisted store the app names is now codev.*:

  • desktop store files — codev.settings, codev.updater, codev.{global,workspace,draft,window}.*.dat
  • the browser build's localStorage keys, which prefix the same store names (codev.global.dat:server)

persist.ts's GLOBAL_STORAGE / WINDOW_STORAGE / LOCAL_PREFIX (the eviction filter) and its workspaceStorage / draftStorage name builders carry the new prefix; store-cleanup.ts's storeKind regexes, install-state.ts's settings-file check and windows.ts's windowDataFile follow.

Keeping existing state

A rename orphans everything an upgrading install already has, which is why the names were deliberately preserved until now. Two fork-only one-time migrations carry the state across:

  • packages/desktop/src/main/store-rebrand.ts renames every opencode.* file in userData on startup. The call site is load-bearing: it runs immediately after app.setPath("userData", …), before the first getStore() and before the onboarding directory scan. A store opened under the new name first would write a fresh file, and the rename would then find its target occupied and strand the user's real state.
  • packages/app/src/utils/storage-rebrand.ts does the same for localStorage keys, called from persist.ts module init and from entry.tsx's pre-render read (the language dictionary warms up from localStorage while modules are still importing, so module-init ordering alone is not enough).

Both keep an existing codev.* target and leave the leftover alone rather than overwriting live state.

The Tauri importer in migrate.ts still reads Tauri's opencode.*.dat files — that is what Tauri wrote — but rebrands each target store name through rebrandStoreName.

Testing

  • packages/app: 700 unit + 130 browser tests pass, including new coverage for the localStorage sweep (rename, both-keys-present, idempotence).
  • packages/desktop: 136 tests pass, including new coverage for the file sweep against a real temp directory (renames stores, leaves default.dat / window-state-*.json / the opencode data dir alone, keeps the rebranded file when both exist, no-ops on first run).
  • bun typecheck clean in both packages; the e2e specs that seed these storage names were updated with them.
  • The Electron app itself was not launched — the migration paths are covered by the filesystem and localStorage tests above.

Docs PR: quickbeard/codev-landing-page (follows).

🤖 Generated with Claude Code

The desktop app kept its settings, recent servers and per-project UI state in
files named after upstream — `opencode.settings`, `opencode.global.dat`,
`opencode.workspace.*.dat` and friends — and the browser build used the same
names as its localStorage prefixes. The troubleshooting docs name those files
so a user can delete them to reset the app, which makes them a user-visible
surface rather than an internal id.

Rename them all to `codev.*`, and carry existing state across with two one-time
migrations: `store-rebrand.ts` renames every pre-rebrand file in the desktop
userData directory at startup — before the first store opens and before the
onboarding scan, or a store would write a fresh file over the migration's
target — and `storage-rebrand.ts` does the same for localStorage keys.

The Tauri importer still reads Tauri's `opencode.*.dat` files, since that is
what Tauri wrote, but rebrands each target store name on the way in.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@quickbeard
quickbeard merged commit 2eb59b6 into main Aug 24, 2026
0 of 5 checks passed
@quickbeard
quickbeard deleted the rebrand-store-names branch August 24, 2026 09:13
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