Repository navigation
refactor: define startup contracts and resilient preferences (1/5) - #5918
Merged
Merged
Conversation
4 tasks done
This was referenced Oct 28, 2026
This was referenced Oct 28, 2026
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.
Refs #645, #732, #3717.
Define the startup recovery contracts and resource/workspace identities, and load preferences with field validation, safe defaults and atomic updates. Invalid files remain read-only; unknown keys survive successful writes. The startup settings component exposes five policies and three independent recovery options when the application integration enables it. It reuses the existing Compound, Select, Bool and Element Plus button styles. Shared controls render the acknowledged value, disable during persistence, and restore their value after failed updates. All supported locales use the normal translation resources.
Keep preference schema metadata in shared/preferences/schema.json, consumed by both the main validator and renderer search. Require descriptions at type-check time; missing metadata had thrown during real settings-window initialization. Use the existing preferences module as the canonical configuration type. Renderer preferences derive from that type; document view/save-format/baseline contracts belong to the existing file module, avoiding the file → application state → project → file cycle. Reuse the shared filesystem hash implementation for resource identities.
The folder picker and path are shown only for the selected-folder startup policy; switching away preserves the saved path. Remove the startup footer and its unused translations.
Previous settings validation (5448a9a / c048147): 76 focused component/locale tests pass (also on the standalone configuration branch), 3 actual settings-window regressions pass, and build, lint and typecheck pass locally. Full-suite results below belong to the previous settings baseline. Current-head CI status is tracked on this PR.
Previous validation on head 0247f80: 23 focused contract/configuration/component/search tests, lint and typecheck pass locally. Component tests use the actual Element Plus controls, including failed-save rollback and disabled pending state. The full integration additionally passes 1637 unit tests and 19 real Electron settings/language/configuration regressions. Those results are from that baseline; see PR checks for the current head.
Combines original parts 01 and 02; supersedes #5913. This is independently testable and targets develop. The runtime startup switch is in #5922. No migration of old configuration or snapshots.
Design documents, acceptance cases and issue/progress tracking remain in the agreed desktop folder. No design documents or screenshots are added to the repository.
Review refinement on 1382e4b: remove the identity-module re-export of contentSha256 and import it directly from common/filesystem. Import preference contracts from their owning module. Replace IUserPreferences consumers with UserPreferencesPatch; the integrated configuration model now uses only UserPreferences and its partial-update type. Independently tested branches that still use electron-store keep its legacy storage shape private as LegacyStoredPreferences. No configuration migration is added.
Local validation for this refinement: 22 relevant unit tests, lint and typecheck pass. This is an import/type refactor; the full Electron suite was not rerun locally. CI for this head is pending; prior-head results below remain historical.
Complete re-export cleanup on 15aec65: remove the remaining file-type re-exports from applicationState and, in the integration, RegisteredDocumentContent and PreparedSessionWindow re-exports from main-process services. Consumers import directly from each definition module. AST inspection of all 23 changed source files against develop finds zero re-exports, including import-then-export and direct import aliases.
Local validation on this head: 22 relevant unit tests, lint and typecheck pass. The integration merge has the exact same tree as tested commit 816b3d7. Full Electron tests were not rerun for this type/import-only change. New-head CI is pending.
By submitting this pull request, I confirm that my contribution is made under the terms of the MIT license.