feat(mqtt): slim bridge source-edit modal to basics + deep-link to Configuration page#3299
Conversation
…figuration page The MQTT bridge create/edit popup duplicated every advanced setting that now lives on the dedicated Configuration page (mode, forwarding, ok_to_mqtt, subscribe topic-block, geofence, publish channel/topic filters, rewrites), forcing them to be maintained in two places. Trim the popup to the essentials needed to create/connect a bridge — name, parent broker, upstream URL, username, password, and subscriptions — plus a hint and, when editing an existing source, a "Configuration →" button that deep-links straight to that bridge's Configuration page (/source/<id>/#mqtt-config). buildBridgeConfig now accepts a *partial* form and manages only the fields a caller actually supplies, merging over the stored config (base) for the rest. So a modal save touches just the basics and preserves all advanced settings untouched — single source of truth, no double-maintenance. This also fixes a latent bug where a modal edit could clobber fields it didn't render. The Configuration page passes the loaded config as base too, so it preserves any config sub-keys it doesn't surface (e.g. node/portnum filters). Removed the now-unused advanced bridge form state, reset/hydration, and the BBoxMapEditor / bbox-seed imports + helper from DashboardPage. Tests: mqttBridgeConfig.test.ts gains a "modal posts only basics → advanced preserved" case (18 total). Full suite green (5880 passed). Verified live in the dev container: slimmed modal, modal save preserves advanced config, and the deep-link button opens the right bridge's Configuration page. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
|
Claude finished @Yeraze's task —— View job Code Review Analysis ✅Todo List
🎯 SummaryThis is a well-executed refactor that successfully separates concerns between the lightweight modal and the full Configuration page. The implementation demonstrates thoughtful architecture decisions and solid testing practices. ✅ Code Quality & ArchitectureExcellent separation of concerns:
Smart preservation mechanism:
Clean user experience:
🐛 Potential IssuesMinor: Deep-link button placement
Edge case: Navigation state
🔒 Security ConsiderationsPassword handling is secure:
Credential preservation:
⚡ Performance ConsiderationsEfficient form management:
Network optimization:
🧪 Test CoverageComprehensive new test case:
Existing test coverage remains strong:
📋 Adherence to Project GuidelinesFollows CLAUDE.md conventions:
Code style compliance:
🏆 Strengths
📝 Minor Suggestions
🎉 ConclusionThis is a high-quality refactor that successfully reduces modal complexity while maintaining full functionality. The partial-form architecture is elegant and well-tested. The code follows project conventions and demonstrates good architectural thinking. Recommendation: ✅ Approve - This PR is ready for merge. |
…3304) Bump version to 4.8.3 across package.json, package-lock.json, desktop/package.json, desktop/src-tauri/tauri.conf.json, helm/meshmonitor/Chart.yaml (version + appVersion), and the CLAUDE.md header. Add a [4.8.3] CHANGELOG entry rolling up the PRs merged since 4.8.2: active MeshCore node discovery (#3302) and reciprocal discoverability (#3303), the dedicated MQTT bridge Configuration page with per-bridge publish filter (#3294) and slimmed source-edit modal (#3299), plus fixes to MeshCore private-key validation (#3301), hashtag-channel creation (#3298), reconnect stability (#3270), the npm legacy-peer-deps pin (#3283), OIDC auto-admin docs (#3292), and Dependabot bumps. Review docs for accuracy against these changes: - docs/features/mqtt-broker.md: topic rewrites and the publish filter now live on the dedicated bridge Configuration page, not the broker's edit modal (which is slimmed to basics in 4.8.3). - docs/features/meshcore.md: document the new Active Node Discovery ("Discover Nearby Nodes" / "Discover Repeaters") and discoverability. Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
Summary
Follow-up to the MQTT bridge Configuration page (#3295). That page is now the home for all advanced bridge settings, but the create/edit Source popup still duplicated them (mode, forwarding, ok_to_mqtt, subscribe topic-block, geofence, publish channel/topic filters, topic rewrites) — two places to maintain.
This trims the popup to just the basics needed to create/connect a bridge, and points users to the Configuration page for the rest.
Changes
BBoxMapEditor+ bbox-seed imports/helper)./source/<id>/#mqtt-config. Hidden on create (no source exists yet).buildBridgeConfigaccepts aPartial<BridgeConfigForm>and manages only the fields a caller supplies, merging over the stored config (base) for the rest. A modal save therefore touches only the basics and preserves all advanced settings untouched — single source of truth, no double-maintenance. This also fixes a latent bug where a modal edit could clobber fields it didn't render.base, so it preserves config sub-keys it doesn't surface (e.g. node/portnum filters).Files
src/pages/DashboardPage.tsxsrc/components/MQTT/mqttBridgeConfig.tsbuildBridgeConfigpartial-form + preserve semantics.src/components/MQTT/MqttBridgeConfigurationView.tsxbaseon save.src/components/MQTT/mqttBridgeConfig.test.tsTesting
tscclean; lint introduces no new errors.mode,forwardingMode,ignoreOkToMqtt,uplinkFilters.channels,downlinkFilters.geo, anddownlinkTopicRewriteall preserved (username updated).🤖 Generated with Claude Code