Files
bitvid/js/ui
thePR0M3TH3ANandClaude Opus 4.8 a1a8f6cda6 perf(profile): defer profile-panel rendering until the modal opens
Post-login the site froze for ~10-15s and the profile panel wouldn't open.
Cause: profileModalController.handleAuthLogin eagerly rendered EVERY profile
panel at login (twice) — friends list + per-contact avatar fetches,
subscriptions, blocks, relays, wallet, hashtags, storage — into a CLOSED
modal. With a responsive signer (nos2x) making decryption instant, that all
fired in one main-thread burst right after login. The block- and
subscription-"change" listeners and the moderation "contacts" listener also
re-rendered their panels unconditionally as that data loaded, compounding it.

selectPane() already lazily populates each pane when it's shown, so the eager
pass was redundant. Changes:
- handleAuthLogin: only run the full panel population when the modal is
  already open (e.g. account switch with it visible); otherwise rely on
  open()/selectPane. Kept the cheap DM-identity setup eager.
- Gate the userBlocks "change", subscriptions "change", and moderation
  "contacts" re-renders on isProfileModalOpen() so they don't paint into a
  closed modal during the post-login data burst.
- Add a "friends" case to selectPane() (the only pane without a lazy-populate
  trigger) so it still populates on open now that login doesn't.
- Add isProfileModalOpen() + populateOpenProfilePanels() helpers.

All panes remain covered (account is static; admin refreshes independently).
Full build + unit suite green. KNOWN_BUGS #0 (post-login freeze).

Co-Authored-By: Claude Opus 4.8 <[email protected]>
2026-06-16 16:06:26 -04:00
..