mirror of
https://github.com/PR0M3TH3AN/bitvid.git
synced 2026-10-28 08:22:24 +00:00
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]>
705 B
705 B
Decisions
-
Refactor
5000in UI controllers toSHORT_TIMEOUT_MS:- Context: Used in
setTimeoutfor clearing status messages. - Decision: Use
SHORT_TIMEOUT_MSfromjs/constants.jswhich is already defined as 5000. - Rationale: Increases consistency and makes the timeout configurable from a central location if needed.
- Context: Used in
-
Refactor
60000injs/webtorrent.jstoLONG_TIMEOUT_MS:- Context: Used as
TIMEOUT_DURATIONfor service worker operations. - Decision: REVERTED to
60000. - Rationale: CI checks failed with timeouts. Reverting
webtorrent.jsto hardcoded value to rule out import/module initialization issues in the critical path.
- Context: Used as