Skip to content

fix(device): save the role picked in the role select - #1556

Open
danditomaso wants to merge 2 commits into
meshtastic:mainfrom
danditomaso:fix/device-role-select
Open

danditomaso wants to merge 2 commits into
meshtastic:mainfrom
danditomaso:fix/device-role-select

Conversation

@danditomaso

Copy link
Copy Markdown
Collaborator

Choosing a device role (e.g. CLIENT_MUTE, or ROUTER after confirming) showed the new role but staged the old one, because the form saved before the select's async check resolved. Safe roles are now accepted straight away, and a select whose check resolves later saves again once the value is applied. Closing the unsafe-role dialog with Esc or an outside click now counts as dismissing it instead of leaving the choice pending.

Stacked on #1555 — review only the top commit.

Choosing Strict asks first, as on Android; Balanced and Compatible stage
directly, and losing XEdDSA support or write access drops a pending
confirmation. Labels and per-option help follow Android's strings.
FormSelect applies a synchronous validate result immediately, so the
select stages the chosen value instead of the previous one.
@vercel

vercel Bot commented Nov 27, 2026

Copy link
Copy Markdown

@danditomaso is attempting to deploy a commit to the Meshtastic Team on Vercel.

A member of the Team first needs to authorize it.

@coderabbitai

coderabbitai Bot commented Nov 27, 2026 •

Copy link
Copy Markdown

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 12 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used all 4 included reviews currently available.

Learn how review limits work.

Review configuration:

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 2efda4ff-5073-4e33-8654-083442c0bff4
Commits

Reviewing files that changed from the base of the PR and between 72d2c57 and 80ec978.

Files selected for processing: 11

  • apps/web/public/i18n/locales/en/config.json
  • apps/web/src/components/Dialog/UnsafeRolesDialog/UnsafeRolesDialog.test.tsx
  • apps/web/src/components/Dialog/UnsafeRolesDialog/UnsafeRolesDialog.tsx
  • apps/web/src/components/Dialog/UnsafeRolesDialog/useUnsafeRolesDialog.test.tsx
  • apps/web/src/components/Dialog/UnsafeRolesDialog/useUnsafeRolesDialog.ts
  • apps/web/src/components/Form/DynamicForm.tsx
  • apps/web/src/components/Form/DynamicFormField.tsx
  • apps/web/src/components/Form/FormSelect.test.tsx
  • apps/web/src/components/Form/FormSelect.tsx
  • apps/web/src/components/PageComponents/Settings/Security/Security.test.tsx
  • apps/web/src/components/PageComponents/Settings/Security/Security.tsx
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

The form saved on the select's change event, before the role's async
validate resolved, so it staged the previous role. Safe roles now answer
synchronously, and a select whose validate resolves later saves the form
again once the value lands. Closing the unsafe-role dialog with Esc or an
outside click now answers the pending choice as dismissed.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant