Files
bitvid/decisions/DECISIONS_1739837127.md
T
google-labs-jules[bot]andPR0M3TH3AN d22785bb87 [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]>
2026-02-18 01:03:43 +00:00

726 B

Decisions

Extraction Strategy

  • Extracted logic heavily depends on this (the controller instance).
  • To avoid modifying ProfileDirectMessageController.js (keeping changes confined to ProfileModalController decomposition), we will create "Binder" modules that export standalone functions accepting the controller instance.
  • This pattern mimics the "Mixin" or "Extension Method" pattern but with pure functions.

Naming

  • ProfileDmRelayBinder.js: Handles relay preferences and UI binding.
  • ProfileDmAttachmentBinder.js: Handles attachment queue rendering and uploading.

Dependencies

  • Binders will import necessary utilities (logger, helpers) but rely on the controller instance for state and services.