-
Notifications
You must be signed in to change notification settings - Fork 72
feat: Add settings persistence for Electron app #543
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Persist user settings (model, coProcessor, display mode, etc.) and media paths (discs, tapes) across sessions using electron-store. - Config class emits "settings-changed" events when modal closes - Main.js emits "media-changed" events when disc/tape URLs change - Electron subscribes to these events and saves to store - Settings restored as query params on app startup - Native file dialog selections saved directly in app.js 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
|
@claude What do you think? |
|
Claude finished @mattgodbolt's task —— View job Code Review for Settings Persistence FeatureTodo List
Overall AssessmentThis is a well-implemented feature that adds settings persistence to the Electron app using a clean observer pattern. The implementation follows the repository's code style guidelines and integrates seamlessly with the existing URL-based configuration system. ✅ Strengths
📋 Code Quality Detailssrc/config.js:28-29Good implementation of the observer pattern: if (Object.keys(this.changed).length > 0) {
this.emit("settings-changed", this.changed);
}Only emits when there are actual changes, preventing unnecessary saves. src/main.js:769,775Clean media change notifications: config.emit("media-changed", { disc1: name });
config.emit("media-changed", { tape: name });Proper use of the observer pattern for media changes. src/app/electron.js:51-57Well-structured event listeners: config.on("settings-changed", (settings) => {
api.saveSettings(settings);
});
config.on("media-changed", (media) => {
api.saveSettings(media);
});src/app/app.js:79-85Smart query parameter merging with command-line override: const savedSettings = store.get("settings", {});
const query = { ...savedSettings };
if (args.disc1 && !args.noboot) query.autoboot = true;
if (args.disc1) query.disc1 = getFileParam(args.disc1);
if (args.disc2) query.disc2 = getFileParam(args.disc2);Command-line args properly override saved settings. 🔍 Minor Considerations
🎯 Architecture AssessmentThe implementation demonstrates excellent architectural thinking:
💡 Technical ExcellenceThe code follows the repository's guidelines well:
🔒 Security ReviewThe implementation follows Electron security best practices:
Final Recommendation✅ Approve - This is a high-quality implementation that adds valuable functionality without compromising the existing codebase. The observer pattern is well-executed, the integration is seamless, and the code follows all repository standards. The feature successfully addresses the need for settings persistence in Electron while maintaining the flexibility and URL-based architecture that makes jsbeeb work so well in browser environments. |
Summary
electron-storeTest plan
🤖 Generated with Claude Code