mirror of
https://github.com/PR0M3TH3AN/bitvid.git
synced 2026-10-27 07:52:24 +00:00
Extracted DM Relay UI logic and DM Attachment logic into separate binder modules to reduce the size of ProfileModalController.js. Updated file size baseline. Co-authored-by: PR0M3TH3AN <[email protected]>
1.1 KiB
1.1 KiB
Decompose: js/ui/profileModalController.js
Selection
Selected js/ui/profileModalController.js (6258 lines) because it is the largest grandfathered file not decomposed in the last 8 weeks.
Plan
Extract two cohesive blocks related to DM functionality that are currently mixed into the main controller:
-
DM Relay UI Logic (
ProfileDmRelayBinder.js)cacheDmRelayElementsbindDmRelayControlsrefreshDmRelayPreferenceshandlePublishDmRelayPreferencesupdateDmPrivacyToggleForRecipientsetPrivacyToggleStatehandleActiveDmIdentityChanged
-
DM Attachment Logic (
ProfileDmAttachmentBinder.js)renderAttachmentQueueuploadAttachmentQueueresolveLatestDirectMessageForRecipientmaybePublishTypingIndicator
These functions heavily rely on this.dmController and this.services, suggesting they belong in dedicated helpers or the DM controller itself. Extracting them to binder modules allows preserving the this context via argument passing while reducing the main file size.
Stats
- Original size: 6258 lines
- Target reduction: > 200 lines