Repository navigation
Split store.js: pure helpers and Store method groups into focused modules (#1447 pass P) - #1469
Merged
Merged
Conversation
….js (#1447) Verbatim move of SPEND_RETENTION_DAYS, capList, localDayKey, pruneSpendByDay, the spend/usage/run-artifact normalizers and the thread shard-id encoders. store.js requires them back and re-exports the same module.exports keys. Co-Authored-By: Claude Opus 5.5 <[email protected]>
…alize.js (#1447) Verbatim move of isHttpUrl, the agent-profile parse/normalize/validate trio, matchingProfileId, the settings defaults and normalizeSettings with its otel/webhook/quota-failover helpers. store.js requires back what Store uses and drops the requires only the moved code needed. Co-Authored-By: Claude Opus 5.5 <[email protected]>
…e-migrate.js (#1447) Verbatim move of STANDARD_TEMPLATE and its clone/ensure helpers, the kimi-model, automation, project and thread migrations with their per-field normalizers, and backfillFromNotice. store.js requires back what Store uses and drops the requires only the moved code needed. Co-Authored-By: Claude Opus 5.5 <[email protected]>
…ethods.js (#1447) Verbatim move of getUsage..getUsageThreadsByDay into a StoreUsageMethods class. store.js copies its prototype descriptors onto Store.prototype, so the methods keep class-method semantics (non-enumerable, same this, same names) and instanceof is unchanged. A duplicate name throws at load. Co-Authored-By: Claude Opus 5.5 <[email protected]>
…js (#1447) Verbatim move of getSettings and setSettings into a StoreSettingsMethods class, attached through the same descriptor copy as the usage methods. Co-Authored-By: Claude Opus 5.5 <[email protected]>
…ds.js (#1447) Verbatim move of _buildSearchSnapshot, _cancelSearchWorker, _runSearchScan and searchThreads into a StoreSearchMethods class. The worker path still resolves threadSearch.js via __dirname, which is the same electron/ directory. Co-Authored-By: Claude Opus 5.5 <[email protected]>
…s-methods.js (#1447) Verbatim move of listTemplates, getTemplate, saveTemplate and removeTemplate into a StoreTemplateMethods class. Co-Authored-By: Claude Opus 5.5 <[email protected]>
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
Closed
4 tasks
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.
Round 6, pass P of #1447.
electron/store.js(4,185 lines) persists all app state. It goes to 2,052 lines; seven focused modules now hold the rest.Part 1: pure helpers out of the file
store-migrate.jsstore-normalize.jsstore-util.jsPart 2: method groups out of
class Storestore-settings-methods.jsstore-usage-methods.jsstore-search-methods.jsstore-templates-methods.jsEach method group is written as a class. store.js copies the groups' property descriptors onto
Store.prototypewithObject.defineProperty, and throws if a name is defined twice. This keeps methods non-enumerable (as in the class body), keeps accessors intact, and never shadows silently. None of the moved methods usessuperor#privatefields.Untouched:
constructor,load,_readFile,save,flushand_writeAtomicare byte-identical to main. The debounce, atomic write and backup handling don't move.Checked
module.exportskeys are identical.Store.prototypehas the same 93 own properties, with identical descriptor shapes (enumerable / writable / configurable / value vs accessor) and zero enumerable keys, as on main.coder-store.json(6 MB) was loaded with main's Store and with this branch's Store.Date.now()and random ids, so two loads with main's code differ in the same 8 places.Date.nowandcrypto.randomUUIDfrozen, both produce byte-identical normalised state: 6,043,877 bytes, the same SHA-256.mcp-inject/memory-supload flakes, which pass 54/54 on their own.npm run typecheckis clean.vite buildandtest:smokeA–E pass.🤖 Generated with Claude Code