Files
bitvid/decisions/DECISIONS_1771241005.md
T

1.7 KiB

Decisions Log

Date: 2026-02-16 Agent: bitvid-decompose-agent File: js/ui/profileModalController.js

Decisions

1. Extract DM Relay Logic

Decision: Extracted DM relay management logic into ProfileDmRelayController. Rationale: The relay logic (add, remove, publish, refresh) was cluttering the main controller and is distinct from core profile management. Implementation: Created js/ui/profileModal/ProfileDmRelayController.js and delegated calls from ProfileModalController.

2. Extract Attachment Logic

Decision: Extracted attachment handling logic into ProfileDmAttachmentController. Rationale: Attachment uploading, rendering queue, and file selection are a separate concern from the main profile UI. Implementation: Created js/ui/profileModal/ProfileDmAttachmentController.js and delegated calls from ProfileModalController.

3. Move Helper Methods

Decision: Moved pure helper methods (generateAttachmentId, resolveLatestDirectMessageForRecipient, etc.) to ProfileDirectMessageHelper. Rationale: Keeps the main controller focused on orchestration rather than utility logic.

4. Move Rendering Logic

Decision: Moved rendering methods (renderAttachmentQueue, setMessagesUnreadIndicator) to ProfileDirectMessageRenderer. Rationale: Separates DOM manipulation from business logic.

5. Move Action Logic

Decision: Moved action handlers (handleSendDmRequest, handleSendProfileMessage, etc.) to ProfileDirectMessageActions. Rationale: Groups user interaction handlers together.

Impact

  • js/ui/profileModalController.js: Reduced by ~405 lines.
  • Improved separation of concerns for Direct Messages within the Profile Modal.