feat(desktop): remove Meshtastic IP requirement from first-run setup#3088
Conversation
The desktop setup window predates multi-source support and forced every fresh install to enter a Meshtastic node IP before the backend could start. That assumption breaks for MeshCore-only users (the most common desktop case today) and for users who want to configure sources from the web UI. Changes: - Drop the Meshtastic Node IP and Meshtastic Port fields from the setup/settings form. Replace with an info block pointing users at the web UI's Sources page. - Remove the IP-required validation; the only validation left is the Web UI Port range. - Rename the "Start with Windows" Advanced Option to "Autostart on Login" so the label works on macOS, Linux, and Windows. Update the Rust doc comment to match (and note the field is currently persisted-but-not-implemented). - Mark the legacy `meshtastic_ip` / `meshtastic_port` fields on Config with #[serde(default)] and a doc comment explaining they're retained for backwards compat with existing installs (lib.rs:200 still passes MESHTASTIC_NODE_IP only when the value is non-empty, so legacy desktop users with a populated config.json keep working unchanged). - Retitle the setup window subtitle from "Desktop Setup" to "Desktop preferences" since the same view serves both first-run and ongoing settings. Verified end-to-end on a fresh macOS DMG build: setup window shows no required fields, hitting Start with all defaults boots the backend with MESHTASTIC_NODE_IP=<unset>, and the web UI loads ready to accept MeshCore or Meshtastic sources from the Sources page. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
|
Claude finished @Yeraze's task —— View job PR Review: Remove Meshtastic IP Requirement from Desktop SetupTodo List:
Overall AssessmentThis is a well-executed architectural improvement that successfully modernizes the desktop first-run experience for the multi-source era. The changes are backwards-compatible, well-documented, and address a real usability pain point for MeshCore-only users. Code Quality & Best Practices ✅Strong Points:
Code Structure:
Potential Issues & Bugs 🟡Minor Concerns:
Security Considerations ✅Positive Security Aspects:
No Security Issues Identified Performance Considerations ✅Performance Impact:
No Performance Concerns Test Coverage Assessment 🟡Existing Coverage:
Missing Test Coverage:
Suggested Test Additions: #[test]
fn test_config_backwards_compatibility() {
let json = r#"{"web_port": 8080, "auto_start": false, "session_secret": "test", "setup_completed": true}"#;
let config: Config = serde_json::from_str(json).unwrap();
assert_eq!(config.meshtastic_ip, String::new());
assert_eq!(config.meshtastic_port, 4403);
}Architecture & Design ✅Excellent Architectural Decisions:
Minor Suggestions
Verdict: APPROVED ✅This PR successfully achieves its goals with excellent backwards compatibility and clean implementation. The few minor issues identified don't block the core functionality and can be addressed in follow-up work. The architectural alignment with multi-source support is exactly what the desktop app needed. |
…nfig tests Addresses two actionable items from the claude-review pass on #3088: 1. The "Autostart on Login" checkbox label implied working functionality, but the underlying `auto_start` field is persisted-but-never-read (no tauri-plugin-autostart is registered). Update the hint to make that clear so users don't think the toggle is silently failing for them. 2. Add Rust unit tests that lock in the #[serde(default)] markers on the legacy `meshtastic_ip` / `meshtastic_port` fields: - test_config_deserialises_without_legacy_meshtastic_fields — proves a future config.json that omits the legacy fields parses cleanly with sensible defaults. - test_config_preserves_legacy_meshtastic_ip — proves an existing install with a populated meshtastic_ip round-trips correctly, so the backwards-compat claim in the PR description has a regression guard. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
|
Claude finished @Yeraze's task —— View job PR Review: Remove Meshtastic IP Requirement from Desktop SetupTodo List:
Overall AssessmentThis is a well-executed architectural improvement that successfully modernizes the desktop first-run experience for the multi-source era. The changes are backwards-compatible, well-documented, and address a real usability pain point for MeshCore-only users. Code Quality & Best Practices ✅Strong Points:
Code Structure:
Potential Issues & Bugs 🟡Minor Concerns:
Security Considerations ✅Positive Security Aspects:
No Security Issues Identified Performance Considerations ✅Performance Impact:
No Performance Concerns Test Coverage Assessment 🟡Existing Coverage:
Missing Test Coverage:
Suggested Test Additions: #[test]
fn test_config_backwards_compatibility() {
let json = r#"{"web_port": 8080, "auto_start": false, "session_secret": "test", "setup_completed": true}"#;
let config: Config = serde_json::from_str(json).unwrap();
assert_eq!(config.meshtastic_ip, String::new());
assert_eq!(config.meshtastic_port, 4403);
}Architecture & Design ✅Excellent Architectural Decisions:
Minor Suggestions
Verdict: APPROVED ✅This PR successfully achieves its goals with excellent backwards compatibility and clean implementation. The few minor issues identified don't block the core functionality and can be addressed in follow-up work. The architectural alignment with multi-source support is exactly what the desktop app needed. |
|
Thanks for the review. Addressed in 923a10f: Done
Pushing back (with reasoning)
The Windows CI failure on the prior run was a transient inside 🤖 Generated with Claude Code |
The new test in 923a10f had a too-long line that tripped the `lint-rust` CI job (`cargo fmt --all -- --check`). Wrap the `serde_json::from_str` call as rustfmt expects. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
|
Claude finished @Yeraze's task —— View job PR Review: Remove Meshtastic IP Requirement from Desktop SetupTodo List:
Overall Assessment ✅This is an excellent architectural improvement that successfully modernizes the desktop first-run experience for the multi-source era. The changes are backwards-compatible, well-documented, and address a real usability pain point for MeshCore-only users. The author's follow-up commit (923a10f) effectively addressed the previous review feedback. Code Quality & Best Practices ✅Strong Points:
Code Structure:
Security Considerations ✅Positive Security Aspects:
No Security Issues Identified Performance Considerations ✅Performance Impact:
No Performance Concerns Test Coverage Assessment ✅Excellent Test Coverage Improvements:
Test Quality:
Architecture & Design ✅Excellent Architectural Decisions:
Minor Observations (No Action Required)Package Lock Changes:
UI/UX Improvements:
Potential Follow-Up Improvements (Separate Issues)The author correctly identified these as out-of-scope for this PR:
Verdict: APPROVED ✅This PR successfully achieves its architectural goals with excellent backwards compatibility, comprehensive test coverage, and clean implementation. The changes properly modernize the desktop app for the multi-source era while maintaining compatibility for existing users. The author's responsive follow-up addressing previous feedback demonstrates thorough attention to detail. Key Strengths:
The implementation is production-ready and addresses the core usability issue for MeshCore-only desktop users. |
Summary
The desktop setup window predates multi-source support and forced every fresh install to enter a Meshtastic node IP before the backend could start. That assumption breaks for MeshCore-only users (the most common desktop case today) and for users who want to configure sources from the web UI.
After this change, the first-run flow boots the backend with zero sources configured; users add Meshtastic or MeshCore sources from the web UI's Sources page.
Changes
Setup window (
desktop/src/index.html)Rust config (
desktop/src-tauri/src/config.rs)meshtastic_ip/meshtastic_portwith#[serde(default)]so older configs without them deserialize cleanly. Doc comment clarifies they're retained for backwards compat with existing installs.auto_startnoting it's persisted-but-not-yet-wired to a platform autostart implementation.Non-breaking for existing users:
lib.rs:200-204already only passesMESHTASTIC_NODE_IPenv to the backend when the value is non-empty, so legacy desktop users with a populatedconfig.jsoncontinue to auto-derive their Meshtastic source on startup. The only change for them is that the simplified UI no longer lets them edit that IP in-place.Migration path for existing users: the env-derived Meshtastic source appears as a regular row in the web UI
/sourcespage in 4.x, so users who want to retire it can edit its host or delete it there — same as any user-created source. No need to hand-editconfig.jsonunless they specifically want to clear the legacy env shim itself.Verification
End-to-end on a fresh macOS DMG build (4.6.1, arm64):
~/Library/Application Support/MeshMonitor/{config.json,meshmonitor.db}for true first-rundesktop.logshowsMESHTASTIC_NODE_IP: <unset> (no Meshtastic node configured)/dev/cu.usbserial-4from the Sources page; native backend connects to the devicesrc-tauri: 2 passed, 0 failedTest plan
MESHTASTIC_NODE_IPunset and zero env-derived sourcesmeshtastic_ip: "10.x.x.x"inconfig.jsoncontinues to auto-derive its Meshtastic source on startup (legacy compat)restart_backendOut of scope (follow-up issues worth filing separately)
Observed while testing, not introduced by this change:
/data/backupsis hardcoded inBackupFileService.initializeBackupDirectory— ignores theDATA_DIRenv var the Tauri shell sets. Backups silently broken on every desktop install.File::createinlib.rs:144-147). Anyone who hits an error then opens Settings → Save loses the very context bug reports need. Switching toOpenOptions::new().append(true).create(true)plus a session delimiter would preserve history.MeshtasticManagerfor a deleted source keeps running its reconnect timer (observedENETUNREACH 192.168.1.100:4403looping for ~minutes after the source row was deleted). Cleanup path insourceManagerRegistrylikely doesn't clear in-flight reconnect timers.Error during route segments migration: SqliteError: no such column: "channel"fires on every boot. Doesn't halt boot but should be quieted.Config.auto_startis set-but-never-read — notauri-plugin-autostartis registered. The checkbox is currently decorative.🤖 Generated with Claude Code