Fix profile modal opening latency by deferring expensive UI updates

The profile modal was slow to open (~100ms+ delay) when a user has many trusted contacts, blocked users, or moderation reports, because `refreshModerationSettingsUi` and `populateBlockedList` were called synchronously before making the modal visible.

This change refactors `ProfileModalController.show()` to:
1. Render the header synchronously (fast).
2. Call `open()` immediately to make the modal visible.
3. Defer expensive data population (`refreshModerationSettingsUi`, `populateBlockedList`, `refreshWalletPaneState`) to the next animation frame using `requestAnimationFrame`.

This significantly improves the perceived responsiveness of the profile button.

Co-authored-by: PR0M3TH3AN <[email protected]>
This commit is contained in:
google-labs-jules[bot]andPR0M3TH3AN committed 2026-01-27 19:03:03 +00:00
1 parent 8b9ef3858d
commit bc51f21c0d
3 files changed
+263 -337

No files matched your search

+1 -1
View File
@@ -40,7 +40,6 @@
"esbuild": "^0.25.12",
"fake-indexeddb": "^6.2.5",
"http-server": "^14.1.1",
"jsdom": "^24.1.3",
"nostr-tools": "^2.19.4",
"pixelmatch": "^5.3.0",
"playwright": "^1.58.0",
@@ -56,6 +55,7 @@
"dependencies": {
"@floating-ui/dom": "^1.7.4",
"highlight.js": "^11.11.1",
"jsdom": "^27.4.0",
"marked": "^17.0.1",
"ws": "^8.19.0"
}