refactor: move event handlers from simple-modals to respective files (@biplavbarua)#7333
Conversation
There was a problem hiding this comment.
Pull request overview
This PR refactors the codebase by moving event handlers from simple-modals.ts to their respective page controller files (account-settings.ts and settings.ts) and extracts shared utilities to a new simple-modals-base.ts file to prevent circular dependencies.
Changes:
- Created
simple-modals-base.tsto exportPopupKey,list, andshowPopupfunction - Moved event handlers for account-related buttons from
simple-modals.tstoaccount-settings.ts - Moved event handlers for settings-related buttons from
simple-modals.tstosettings.ts
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
frontend/src/ts/modals/simple-modals-base.ts |
New file containing extracted PopupKey type, list object, and showPopup function to prevent circular dependencies |
frontend/src/ts/modals/simple-modals.ts |
Removed event handlers and showPopup function; now imports and re-exports from simple-modals-base.ts |
frontend/src/ts/pages/account-settings.ts |
Added event handlers for account-related buttons and imported showPopup from simple-modals-base.ts |
frontend/src/ts/pages/settings.ts |
Added event handlers for settings-related buttons (custom themes and fonts) and imported showPopup from simple-modals-base.ts |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
Refactored event handlers based on Copilot feedback:\n- Moved |
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 4 out of 4 changed files in this pull request and generated 3 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This PR addresses the
TODOinsimple-modals.tsby moving event handlers to their respective page controller files (account-settings.tsandsettings.ts).Key Changes:
.pageAccountSettingshandlers toaccount-settings.ts..pageSettingshandlers tosettings.ts.PopupKey,list, andshowPopuptosimple-modals-base.tsto resolve circular dependencies introduced by importing page controllers insimple-modals.ts(which now importshowPopupfrom base).Testing:
madge.tsc.