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.
Description
The purpose of this PR is to resolve #398 and centralize the data source variable in the main process so that the "Data Source" menu always reflects the current state, allows users to change it, and persists those changes across app restarts, refreshes and cache clears.
Changes
Added an envManager.ts module that loads the persisted environment on startup and updates it (persisting the new value and rebuilding the menu).
Changed the Data Source menu to be built dynamically (via a function) so that its radio buttons always reflect the current environment.
Modified the menu click to call updateEnvironment() (which updates state and rebuilds the menu) and send an event. The main process loads the environment before building the menu, and the renderer listens for updates to re‑render the UI.
Testing