Repository navigation
feat(desktop): rebrand the persisted store names to codev - #317
Merged
Merged
Conversation
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>
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.
The desktop troubleshooting docs tell you to reset the app by deleting these files by name:
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.*:codev.settings,codev.updater,codev.{global,workspace,draft,window}.*.datcodev.global.dat:server)persist.ts'sGLOBAL_STORAGE/WINDOW_STORAGE/LOCAL_PREFIX(the eviction filter) and itsworkspaceStorage/draftStoragename builders carry the new prefix;store-cleanup.ts'sstoreKindregexes,install-state.ts's settings-file check andwindows.ts'swindowDataFilefollow.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.tsrenames everyopencode.*file inuserDataon startup. The call site is load-bearing: it runs immediately afterapp.setPath("userData", …), before the firstgetStore()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.tsdoes the same for localStorage keys, called frompersist.tsmodule init and fromentry.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.tsstill reads Tauri'sopencode.*.datfiles — that is what Tauri wrote — but rebrands each target store name throughrebrandStoreName.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, leavesdefault.dat/window-state-*.json/ theopencodedata dir alone, keeps the rebranded file when both exist, no-ops on first run).bun typecheckclean in both packages; the e2e specs that seed these storage names were updated with them.Docs PR: quickbeard/codev-landing-page (follows).
🤖 Generated with Claude Code