You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This PR adds Cmajor stored state synchronization for UI preferences, starting with the selected instrument.
Previously, only parameter values were persisted across plugin sessions in DAWs. With this PR, the selected instrument is now saved and restored automatically, allowing users to continue where they left off. The implementation is future-friendly additional UI state keys can be persisted with minimal effort.
🏷️ Type of Change
✨ Feature enhancement
🧪 Test improvements
💡 Motivation/Reason
Persisting only parameter data caused UI selections (like instrument choice) to reset every time a DAW session was reopened. This was frustrating and inconsistent with user expectations.
By syncing StoredStateStore ↔ PatchConnection stored state, we achieve session continuity, making the user experience more polished and professional.
@gunjanghate I'm running into an issue trying to test these changes. When running the patch with Cmajor: Run patch I get a black screen. Would you be able to have a look at it?
Can you share logs or console output from Cmajor when the black screen appears?
@gunjanghate unfortunately I've not been able to get any console output or other logs from cmajor. I think the best approach is to take it one step at a time and see where it breaks. Keep in mind you need to build the view with npm run build for any changes to affect the Cmajor panel in vscode.
@gunjanghate thank you! I've tested it and it works for me as well. Could you clean up the PR a little? I think you can remove any console logs, maybe error handling could be simplified?
gunjanghate
changed the title
feat(state): sync stored state with patch connection
Connected view/src/StoredStateStore.tsx to patchConnection.
Oct 3, 2025
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
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.
🎵 Summary of Changes
This PR adds Cmajor stored state synchronization for UI preferences, starting with the selected instrument.
Previously, only parameter values were persisted across plugin sessions in DAWs. With this PR, the selected instrument is now saved and restored automatically, allowing users to continue where they left off. The implementation is future-friendly additional UI state keys can be persisted with minimal effort.
🏷️ Type of Change
💡 Motivation/Reason
Persisting only parameter data caused UI selections (like instrument choice) to reset every time a DAW session was reopened. This was frustrating and inconsistent with user expectations.
By syncing StoredStateStore ↔ PatchConnection stored state, we achieve session continuity, making the user experience more polished and professional.
🧪 Testing Done
npm test)StoredStateStore.test.tsxcovering sync logicsendStoredStateValue🔗 Related Issues
Fixes #61
📝 Additional Notes
PatchConnectionis present (e.g., dev mode / tests)refavoids stale closure bugs in listener callbacks📋 Checklist