fix(admin): Router role no longer reverts when selected in Remote Admin#3153
Merged
Conversation
The Remote Admin Device Configuration role dropdown popped a native window.confirm() the moment a user picked ROUTER. If the user dismissed the dialog — accidentally, via Escape, or because the native confirm felt out of place inside the in-page dropdown UX — the role state was never updated and the dropdown silently snapped back to the previous value. Every other role (Sensor, Tracker, Client, etc.) committed immediately, which made the symptom look ROUTER-specific. Replace the confirm gate with a persistent inline warning banner under the role display. Selection always commits to local form state now; the warning explains the routing implications and stays visible until the user picks a different role, so the user can review before pressing "Save Device Config". New translation keys are added; the old router_mode_confirmation key is retained (unused) so non-English locales aren't broken until translators update. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
|
Claude finished @Yeraze's task —— View job PR Review: Router Role Revert FixTodo List:
Code AnalysisThe PR successfully addresses the Router role reversion bug by replacing a blocking confirmation dialog with a persistent warning banner. Key Changes:
Code Quality & Implementation✅ Excellent:
✅ Good UX Design:
Security & Bug Analysis✅ No Security Concerns:
✅ No Apparent Bugs:
UX Improvements & Best Practices✅ Significant UX Enhancement:
✅ Follows React Best Practices:
Performance Considerations✅ Minimal Performance Impact:
Test Coverage
Overall Assessment🎉 Excellent Fix - This is a well-executed solution that:
Recommendation: Approve ✅ The implementation is solid, the UX improvement is significant, and the code quality is high. This is exactly the kind of thoughtful user experience enhancement that makes software better to use. |
Yeraze
added a commit
that referenced
this pull request
May 23, 2026
Patch bump covering recent fixes since 4.6.5: - Router role no longer reverts on selection in Remote Admin (#3153) - Auto-upgrade banner no longer persists after successful upgrade (#3155) - Blog index full-width + post header (breadcrumbs, title, date, tags) (#3152) Updated all five version-tracking files per CLAUDE.md: - package.json - package-lock.json (regenerated via npm install --package-lock-only --legacy-peer-deps) - helm/meshmonitor/Chart.yaml (version + appVersion) - desktop/src-tauri/tauri.conf.json - desktop/package.json Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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
User report: in the Remote Admin → Device Configuration role dropdown, every attempt to pick Router would immediately revert to the previous selection. Other roles (Sensor, Tracker, etc.) saved fine.
Root cause
src/components/AdminCommandsTab.tsxhandleRoleChangehad a special branch fornewRole === 2(ROUTER) that popped a nativewindow.confirm()before applying the change:If the user dismissed the dialog (Cancel, Escape, or accidental click — easy to do because the native modal feels disconnected from the custom in-page dropdown UX) the role state was never updated and the dropdown snapped back to the previous value. ROUTER is the only role with this gate, which is why Sensor/Tracker/etc. appeared to "work fine."
Fix
Replace the modal gate with a persistent inline warning banner:
AdminCommandsTab.tsx— drop thewindow.confirm()branch.handleRoleChangenow always commits immediately, like every other role.DeviceConfigurationSection.tsx— render a yellow warning banner directly under the role display wheneverdeviceRole === 2. It includes apublic/locales/en.json— new keysadmin_commands.router_mode_warning_titleandadmin_commands.router_mode_warning. The oldrouter_mode_confirmationkey is left in place (unused) so non-English locale files aren't broken until translators update.Why this UX is better
Test plan
npx tsc --noEmitpasses🤖 Generated with Claude Code