Commit Graph
14 Commits
Author SHA1 Message Date
google-labs-jules[bot]andPR0M3TH3AN f2002b66c2 fix(test): update client count resilience test to access unreachableRelays via connectionManager
Co-authored-by: PR0M3TH3AN <[email protected]>
2026-02-09 14:17:44 +00:00
google-labs-jules[bot]andPR0M3TH3AN d5e86ee5eb feat(security): ensure IS_DEV_MODE is false and add regression test
- Added `tests/unit/security-config.test.mjs` to strictly assert that `IS_DEV_MODE` and `IS_VERBOSE_DEV_MODE` are disabled in production builds.
- Verified that `config/instance-config.js` is correctly set to `false`.

Co-authored-by: PR0M3TH3AN <[email protected]>
2026-02-08 03:39:41 +00:00
google-labs-jules[bot]andPR0M3TH3AN e79998f7b5 test: add unit tests for comment avatar resolution
Added a new test file `tests/unit/comment-avatar.test.mjs` to comprehensively test the `commentAvatar.js` utility. The tests cover:
- `normalizeCommentAvatarKey`: Verifies input sanitization and normalization.
- `resolveCommentAvatarAsset`: Verifies avatar resolution logic including defaults, failure handling, and caching strategies.
- `registerCommentAvatarFailure`: Verifies failure registration and cache invalidation.

This ensures robust handling of user avatars in comments, including edge cases like missing or failed images and cache persistence.

Co-authored-by: PR0M3TH3AN <[email protected]>
2026-02-07 23:12:11 +00:00
google-labs-jules[bot]andPR0M3TH3AN ec77f50744 fix(nostr): prevent count timeouts from disconnecting relays
Prevents "count-timeout" errors from tripping the global circuit breaker in NostrClient. This ensures that slow auxiliary requests do not block critical subscription connections, resolving login issues in unstable network environments.

Co-authored-by: PR0M3TH3AN <[email protected]>
2026-02-02 20:29:25 +00:00
thePR0M3TH3AN d35de4d743 Merge pull request #2036 from PR0M3TH3AN/ai/refactor-notification-controller-20231027-2601673227327805546
refactor(ai): extract notification logic to NotificationController
2026-02-01 08:01:22 -05:00
google-labs-jules[bot]andPR0M3TH3AN 1dfc23c11a refactor(ai): extract notification logic from js/app.js (agent)
- Moved `showError`, `showStatus`, `showSuccess`, and `updateNotificationPortalVisibility` logic to `js/ui/notificationController.js`.
- Instantiated `NotificationController` in `js/ui/applicationBootstrap.js`.
- Refactored `js/app.js` to delegate notification calls to the controller.
- Added unit tests for `NotificationController`.
- Followed AGENTS.md refactoring checklist.

Co-authored-by: PR0M3TH3AN <[email protected]>
2026-02-01 03:08:05 +00:00
google-labs-jules[bot]andPR0M3TH3AN 3511877ebe chore(ai): CI health fixes (flaky tests)
- Fix flaky test in `tests/hashtag-preferences.test.mjs` by defining missing `fetchCalls` variable.
- Fix `webtorrent` initialization error in `tests/unit/services/r2Service.storage-config.test.mjs` by ensuring `window.crypto` is available and `File` mock extends `Blob`.
- Update `tests/test-helpers/setup-localstorage.mjs` to polyfill `window.crypto` using `globalThis.crypto`.
- Update `scripts/run-unit-tests.mjs` to support test file filtering via command line arguments.

Co-authored-by: PR0M3TH3AN <[email protected]>
2026-02-01 02:10:21 +00:00
google-labs-jules[bot]andPR0M3TH3AN cfd7c49a9d Refactor docs navigation and clean up legacy views
Co-authored-by: PR0M3TH3AN <[email protected]>
2026-01-27 16:32:01 +00:00
thePR0M3TH3AN 84468cbed5 Add R2 bucket config tests 2026-01-26 07:46:54 -05:00
google-labs-jules[bot] 62dcc57e64 refactor(ai): extract EditModalController from js/app.js (agent) 2026-01-26 03:21:44 +00:00
google-labs-jules[bot] a708883abb fix(embed): video sizing letterbox and logo accent
- Changed embed video sizing to `object-fit: cover` and `width: 100%` to eliminate black bars/letterboxing.
- Updated `embed.html` and `css/tailwind.source.css` to enforce these styles on `.video-modal__media`, `.video-modal__video`, and `#embedVideo`.
- Wired the embed logo accent color to use the instance configuration (`THEME_ACCENT_OVERRIDES` from `config/instance-config.js`) via a `--bitvid-accent` CSS variable injected in `js/embed.js`.
- Added unit and visual tests to verify styling and configuration logic.
2026-01-24 23:57:29 +00:00
google-labs-jules[bot] 981fac785a fix(embed): implement robust EmbedPlayerModal and guard resetTorrentStats
- Add `js/ui/components/EmbedPlayerModal.js` to implement the `VideoModal` interface for embed contexts (including `resetStats`).
- Update `js/ui/ModalManager.js` to detect embed mode and use `EmbedPlayerModal`.
- Clean up `js/embed.js` to remove local modal definition and add `postMessage` diagnostic logging.
- Update `js/app.js` `resetTorrentStats` log message and verify guard.
- Add unit tests for `EmbedPlayerModal` and `resetTorrentStats` logic.
- Add E2E reproduction script `tests/e2e/repro_issue.spec.ts`.
2026-01-24 22:09:03 +00:00
thePR0M3TH3AN efcaf02e8c Add search filter unit tests 2026-01-23 13:48:54 -05:00
google-labs-jules[bot] 8015edf6b3 refactor(ai): extract ModerationDecorator from js/app.js (agent)
Extracts `decorateVideoModeration` and related helper methods from `js/app.js` into a new `js/services/moderationDecorator.js` service. This improves separation of concerns by moving complex moderation logic out of the main application class.

AGENTS.md Checklist:
1. Identify Logic: Extracted `decorateVideoModeration`, `deriveModerationReportType`, `deriveModerationTrustedCount`, `getReporterDisplayName`, `normalizeModerationSettings`, `getActiveModerationThresholds`.
2. Create Controller Method: Created `ModerationDecorator` class with `decorateVideo` method.
3. Create `bitvidApp` Wrapper: Replaced `decorateVideoModeration` in `js/app.js` with a wrapper that delegates to `this.moderationDecorator.decorateVideo`.
4. Wire Up Callbacks: Passed `getProfileCacheEntry` to `ModerationDecorator` constructor.
5. Remove Old Code: Removed extracted methods from `js/app.js`.

Also added unit tests for `ModerationDecorator` and ensured runtime settings updates are propagated.
2026-01-21 03:20:17 +00:00