Skip to content

feat: add confirmation prompt to network switch with unsaved state - #558

Open
BABAT-CODE wants to merge 1 commit into
WHEELBACK:mainfrom
BABAT-CODE:feature/network-selector-switch-confirm
Open

feat: add confirmation prompt to network switch with unsaved state#558
BABAT-CODE wants to merge 1 commit into
WHEELBACK:mainfrom
BABAT-CODE:feature/network-selector-switch-confirm

Conversation

@BABAT-CODE

Copy link
Copy Markdown

Show a confirmation dialog when the user attempts to switch networks while one or more dashboard forms have unsaved state registered via window.__networkSelectorDirtyForms. This prevents accidental context loss (e.g. a half-filled settlement proposal) when switching away from mainnet mid-session.

  • Update NetworkSelector.tsx to intercept network changes and show an accessible dialog (role=dialog, aria-modal, labelled/described by IDs) when dirty form state is detected.
  • Add confirmation dialog styles to NetworkSelector.css.
  • Add NetworkSelector.test.tsx with 7 tests covering: clean switch, dirty-state prompt, confirm action, cancel action, and mainnet warning.

Pull Request

Summary

  • Describe the purpose of this PR in one or two sentences.

Checklist

  • Closes #__
  • Tests added or updated
  • ABI snapshot updated if contract sources changed (abis/ and COMEBACKHERE-contracts/)
  • Screenshots attached if UI changed
  • Documentation updated if needed

Notes

Show a confirmation dialog when the user attempts to switch networks
while one or more dashboard forms have unsaved state registered via
window.__networkSelectorDirtyForms. This prevents accidental context
loss (e.g. a half-filled settlement proposal) when switching away from
mainnet mid-session.

- Update NetworkSelector.tsx to intercept network changes and show an
  accessible dialog (role=dialog, aria-modal, labelled/described by IDs)
  when dirty form state is detected.
- Add confirmation dialog styles to NetworkSelector.css.
- Add NetworkSelector.test.tsx with 7 tests covering: clean switch,
  dirty-state prompt, confirm action, cancel action, and mainnet warning.

Closes WHEELBACK#1
@drips-wave

drips-wave Bot commented Aug 29, 2026

Copy link
Copy Markdown

@BABAT-CODE Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits.

You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀

Learn more about application limits

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.

feat: add NetworkSelector confirmation prompt when switching from mainnet to testnet

1 participant