mirror of
https://github.com/PR0M3TH3AN/bitvid.git
synced 2026-11-06 12:52:26 +00:00
[decompose] extract helpers from js/ui/profileModalController.js
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]>
This commit is contained in:
1 parent
5e8b6b0141
commit
d22785bb87
9 files changed
+605
-413
No files matched your search
@@ -0,0 +1,28 @@
|
||||
# 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:
|
||||
|
||||
1. **DM Relay UI Logic** (`ProfileDmRelayBinder.js`)
|
||||
- `cacheDmRelayElements`
|
||||
- `bindDmRelayControls`
|
||||
- `refreshDmRelayPreferences`
|
||||
- `handlePublishDmRelayPreferences`
|
||||
- `updateDmPrivacyToggleForRecipient`
|
||||
- `setPrivacyToggleState`
|
||||
- `handleActiveDmIdentityChanged`
|
||||
|
||||
2. **DM Attachment Logic** (`ProfileDmAttachmentBinder.js`)
|
||||
- `renderAttachmentQueue`
|
||||
- `uploadAttachmentQueue`
|
||||
- `resolveLatestDirectMessageForRecipient`
|
||||
- `maybePublishTypingIndicator`
|
||||
|
||||
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
|
||||
Reference in new issue
Block a user