# 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