Files
bitvid/DECISIONS.md
T
google-labs-jules[bot]andPR0M3TH3AN 393c06c749 [decompose] extract ProfileHashtagController from js/ui/profileModalController.js
Extracts all hashtag preference related logic into a new controller
`js/ui/profileModal/ProfileHashtagController.js` to reduce the size of `js/ui/profileModalController.js` and improve maintainability.

- Moves `normalizeHashtagTag`, `formatHashtagTag`, `getResolvedHashtagPreferences`, `setHashtagStatus`, `refreshHashtagBackgroundStatus`, `populateHashtagPreferences`, `renderHashtagList`, `sanitizeHashtagList`, `createHashtagListItem`, `persistHashtagPreferences`, `handleAddHashtagPreference`, `handleRemoveHashtagPreference`, `handleHashtagPreferencesChange`, `describeHashtagPreferencesError`.
- Updates `ProfileModalController` to delegate to `ProfileHashtagController`.
- Adds delegate getters/methods in `ProfileModalController` to maintain backward compatibility for tests.
- Reduces `js/ui/profileModalController.js` by ~600 lines.
- Updates file size baseline in `scripts/check-file-size.mjs`.

Passes `npm run lint` and `npm run test:unit`.

Co-authored-by: PR0M3TH3AN <[email protected]>
2026-02-13 02:06:08 +00:00

12 lines
705 B
Markdown

# Decisions
- **Refactor `5000` in UI controllers to `SHORT_TIMEOUT_MS`**:
- **Context**: Used in `setTimeout` for clearing status messages.
- **Decision**: Use `SHORT_TIMEOUT_MS` from `js/constants.js` which is already defined as 5000.
- **Rationale**: Increases consistency and makes the timeout configurable from a central location if needed.
- **Refactor `60000` in `js/webtorrent.js` to `LONG_TIMEOUT_MS`**:
- **Context**: Used as `TIMEOUT_DURATION` for service worker operations.
- **Decision**: **REVERTED** to `60000`.
- **Rationale**: CI checks failed with timeouts. Reverting `webtorrent.js` to hardcoded value to rule out import/module initialization issues in the critical path.