Skip to content

Consolidate modal naming and close APIs - #1528

Merged
osyed merged 2 commits into
mainfrom
agent/align-modal-close-apis
Aug 4, 2026
Merged

Consolidate modal naming and close APIs#1528
osyed merged 2 commits into
mainfrom
agent/align-modal-close-apis

Conversation

@dnlbui

@dnlbui dnlbui commented Aug 4, 2026

Copy link
Copy Markdown
Contributor

What Changed

This PR consolidates modal controller naming and dismissal conventions so conventional modals can use the shared handler helper directly.

  • Controller variable names now match their DOM modal IDs, eliminating eight alias mappings.
  • chatSettingsModal, importContactsModal, and shareContactsModal expose guarded user dismissal through .close().
  • Internal completion and cleanup paths use .forceClose() when they must bypass dismissal warnings.
  • Only the EVM asset modals and Google Drive picker remain documented structural exceptions.

Consolidated Flow

  1. A modal is registered under the same name as its DOM ID.
  2. UI close buttons and browser back invoke the controller's public .close() method.
  3. Guarded modals preserve their warning-before-discard behavior.
  4. Successful or error-driven internal flows use .forceClose() to finish cleanup without triggering a dismissal warning.

Why

This is a behavior-preserving consolidation after the shared browser-back registry. The registry still needed alias rows for mismatched controller names and special handleClose() mappings for guarded modals.

Aligning controller names with DOM IDs and making .close() the consistent public dismissal API lets the shared helper cover those modals without changing user-facing behavior.

Validation

  • node --check app.js
  • node --test tests/modal-close-coverage.test.mjs
  • git diff --check agent/fix-modal-browser-back...HEAD

Closes #1527

@dnlbui
dnlbui marked this pull request as ready for review August 4, 2026 21:40
@dnlbui

dnlbui commented Aug 4, 2026

Copy link
Copy Markdown
Contributor Author

@codex

@dnlbui dnlbui linked an issue Aug 4, 2026 that may be closed by this pull request
@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Bravo.

Reviewed commit: 01109d33d9

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@dnlbui
dnlbui force-pushed the agent/align-modal-close-apis branch 2 times, most recently from 9210c2f to cdf6283 Compare August 4, 2026 22:28
@dnlbui
dnlbui force-pushed the agent/align-modal-close-apis branch from cdf6283 to 9d55d71 Compare August 4, 2026 22:50
@dnlbui dnlbui changed the title Align modal close APIs Consolidate modal naming and close APIs Aug 4, 2026
@dnlbui
dnlbui force-pushed the agent/align-modal-close-apis branch from 9d55d71 to 4bc90f4 Compare August 4, 2026 23:03
Base automatically changed from agent/fix-modal-browser-back to main August 4, 2026 23:03
- Updated modal references throughout app.js to use standardized naming conventions, improving code readability and maintainability.
- Renamed instances of myProfileModal, backupAccountModal, validatorStakingModal, scanQRModal, searchMessagesModal, and searchContactsModal to their new counterparts: accountModal, backupModal, validatorModal, qrScanModal, searchModal, and contactSearchModal respectively.
- Adjusted event listeners and modal handling to reflect these changes, ensuring seamless functionality across the application.
@osyed
osyed force-pushed the agent/align-modal-close-apis branch from 4bc90f4 to 4859077 Compare August 4, 2026 23:03
- Updated references in app.js and index.html to reflect the new naming convention for the message search modal.
- Adjusted event listeners and modal handling to ensure seamless functionality with the updated modal name.
@osyed
osyed merged commit 70770e6 into main Aug 4, 2026
1 check passed
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.

Align modal close APIs so more handlers use createModalCloseHandlers

2 participants