Skip to content

fix(settings): fix unsaved change detection for non-admin-message config items#1062

Open
fullburnen wants to merge 1 commit into
meshtastic:mainfrom
fullburnen:fix/unsaved-change-count
Open

fix(settings): fix unsaved change detection for non-admin-message config items#1062
fullburnen wants to merge 1 commit into
meshtastic:mainfrom
fullburnen:fix/unsaved-change-count

Conversation

@fullburnen

Copy link
Copy Markdown

Description

Changing settings often results in the unsaved change counter appearing in the wrong sidebar section. Change counts are also incorrect when modifying items in some tabs.

Changes Made

  • Add getRadioConfigChangeCount() and getDeviceConfigChangeCount() for individual setting sections. This resolves displaying the count of unsaved changes on the wrong sidebar item.

  • Add normalizeBytes and call it from the Security page so that unset Admin Keys do not trigger unsaved changes when updating the page.

  • The Position page uses useMemo which does not clear rhfState.isDirty. Remove the rhfState.isDirty from hasPending to address it.

  • Device -> User is a more complicated change and hasUserChange() is used rather than making a more complex change

Testing Done

  • Went through Radio, Device and Module Config
  • Changed and reverted one toggle per tab
  • Checked for unsaved change counter to increment/decrement and for the unsaved changes box to appear

Screenshots (if applicable)

Before After
module-mqtt-before module-mqtt-after
device-position-before device-position-after

Checklist

  • Code follows project style guidelines

…fig items

Add getRadioConfigChangeCount() and getDeviceConfigChangeCount() for individual setting sections. This resolves displaying the count of unsaved changes on the wrong sidebar item.

Add normalizeBytes and call it from the Security page so that unset Admin Keys do not trigger unsaved changes when updating the page.

The Position page uses useMemo which does not clear rhfState.isDirty. Remove the rhfState.isDirty from hasPending to address it.
@vercel

vercel Bot commented Jun 3, 2026

Copy link
Copy Markdown

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

A member of the Team first needs to authorize it.

@CLAassistant

CLAassistant commented Jun 3, 2026

Copy link
Copy Markdown

CLA assistant check
All committers have signed the CLA.

@fullburnen fullburnen marked this pull request as ready for review June 3, 2026 04:41
@fullburnen fullburnen marked this pull request as draft June 3, 2026 04:47
@fullburnen

Copy link
Copy Markdown
Author

How did I miss that the tabs no longer have a dot for changes.

@fullburnen

Copy link
Copy Markdown
Author

How did I miss that the tabs no longer have a dot for changes.

Looks like it is an existing issue, possibly stemming from memonization in c729d3b.

@fullburnen fullburnen marked this pull request as ready for review June 5, 2026 03:00
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.

2 participants