Commit Graph
6160 Commits
Author SHA1 Message Date
thePR0M3TH3AN c5d464f335 Merge pull request #2718 from PR0M3TH3AN/test/comment-avatar-7190109823382715625
🧪 Add tests for commentAvatar.js
2026-02-26 14:39:22 -05:00
thePR0M3TH3AN 9453a40c82 Merge branch 'unstable' into test/comment-avatar-7190109823382715625 2026-02-26 14:39:15 -05:00
thePR0M3TH3AN 4bdf0830ce Merge pull request #2717 from PR0M3TH3AN/security/fix-embed-rel-noopener-9431652007769204320
🔒 Security Fix: Add rel="noopener noreferrer" to embed watch button
2026-02-26 14:38:28 -05:00
thePR0M3TH3AN 11250f681b Merge pull request #2716 from PR0M3TH3AN/refactor-app-extract-dtag-value-657233878683899686
Refactor extractDTagValue in js/app.js
2026-02-26 14:38:13 -05:00
thePR0M3TH3AN 2d28b4d49a Merge pull request #2715 from PR0M3TH3AN/fix-channel-profile-security-vulnerability-10108335032867122402
🔒 Fix missing rel="noopener noreferrer" in channel profile link
2026-02-26 14:37:56 -05:00
thePR0M3TH3AN 19d3e0dfbd Merge pull request #2736 from PR0M3TH3AN/update-watch-history-test-items-15094903720553574923
Update watch history test to use aggregated items
2026-02-26 13:04:27 -05:00
thePR0M3TH3AN de80e58b5d Merge pull request #2725 from PR0M3TH3AN/refactor-delete-modal-dtag-919037621417068012
Refactor DeleteModal to use shared getDTagValueFromTags utility
2026-02-26 13:04:19 -05:00
thePR0M3TH3AN 292f3a40cb Merge pull request #2723 from PR0M3TH3AN/refactor-revert-modal-dtag-18208308647871133769
🧹 Refactor RevertModal to use shared d-tag extraction utility
2026-02-26 13:04:11 -05:00
thePR0M3TH3AN 0e5e56b146 Merge branch 'unstable' into refactor-revert-modal-dtag-18208308647871133769 2026-02-26 13:04:04 -05:00
thePR0M3TH3AN ecdea6ac94 Merge pull request #2724 from PR0M3TH3AN/test/link-preview-settings-coverage-13742612794998658634
test: Add unit tests for linkPreviewSettings.js
2026-02-26 13:03:45 -05:00
thePR0M3TH3AN 143dcf771d Merge pull request #2727 from PR0M3TH3AN/test/video-menu-renderers-15090243999919330255
🧪 Add tests for video menu renderers
2026-02-26 13:02:53 -05:00
thePR0M3TH3AN 73f7540b4e Merge pull request #2730 from PR0M3TH3AN/security-fix-qrcode-innerhtml-10127011832917430140
🔒 Fix unsafe innerHTML usage in qrcode.js
2026-02-26 13:02:46 -05:00
thePR0M3TH3AN c7cbe086bc Merge pull request #2728 from PR0M3TH3AN/test/static-modal-accessibility-13129271747123339314
🧪 Add tests for staticModalAccessibility.js
2026-02-26 13:02:39 -05:00
thePR0M3TH3AN 3bfa2d8a83 Merge pull request #2733 from PR0M3TH3AN/perf-nostr-service-incremental-updates-3861441146552926280
⚡ Optimize video subscription updates using incremental processing
2026-02-26 13:02:32 -05:00
thePR0M3TH3AN f536c71917 Merge pull request #2721 from PR0M3TH3AN/test/comment-avatar-16584237555601496118
Add unit tests for commentAvatar.js
2026-02-26 13:02:25 -05:00
google-labs-jules[bot]andPR0M3TH3AN 311e14c66c test(watch-history): rely on aggregated items from publishRecords
Updated `tests/watch-history.test.mjs` to consume `snapshotResult.items` directly, as `WatchHistoryManager`'s `publishRecords` correctly returns aggregated items. Removed the fallback logic and TODO comment that suggested otherwise.

This cleanup aligns the test with the current implementation of `WatchHistoryManager` which flattens monthly results into a top-level `items` array.

Co-authored-by: PR0M3TH3AN <[email protected]>
2026-02-26 18:02:18 +00:00
thePR0M3TH3AN c28d1e2c2b Merge pull request #2734 from PR0M3TH3AN/refactor/revert-modal-rendering-15253432646628070109
Refactor RevertModal rendering logic
2026-02-26 13:00:38 -05:00
thePR0M3TH3AN c60eada1a6 Merge pull request #2735 from PR0M3TH3AN/refactor-videomodal-comments-13431359782891705470
🧹 Refactor VideoModal to extract CommentsController logic
2026-02-26 13:00:27 -05:00
thePR0M3TH3AN 6692fe1a30 Merge pull request #2732 from PR0M3TH3AN/fix/dm-decryptor-race-order-8056308351647388512
⚡ Use ordered race for parallel DM decryption to respect preference
2026-02-26 13:00:18 -05:00
google-labs-jules[bot]andPR0M3TH3AN feb7ad765a Refactor VideoModal to delegate comments to CommentsController
Move comment-related logic and state from VideoModal.js to CommentsController.js.
Split CommentsController into CommentsController (orchestration), CommentsListRenderer (DOM management), and CommentNodeFactory (element creation) to maintain modularity and adhere to file size limits.
Update VideoModal to initialize and destroy CommentsController correctly.
Fix minor lint issues.

Co-authored-by: PR0M3TH3AN <[email protected]>
2026-02-26 17:53:34 +00:00
google-labs-jules[bot]andPR0M3TH3AN 2703382ab4 Refactor RevertModal rendering logic into separate module
Extracted excessive DOM rendering logic from `RevertModal.js` into `revertModalRenderers.js`.
This improves code readability and maintainability by separating the view construction from the modal logic.
Added unit tests for the new renderers using a lightweight DOM mock.
Replaced local d-tag extraction with shared utility `getDTagValueFromTags`.

Co-authored-by: PR0M3TH3AN <[email protected]>
2026-02-26 17:50:10 +00:00
google-labs-jules[bot]andPR0M3TH3AN 6e42d2c97c perf: Optimize nostrService video subscription updates
Optimizes the `subscribeVideos` callback in `js/services/nostrService.js` to handle video updates incrementally, avoiding O(N*M) complexity during high-volume updates (e.g., initial load).

Changes:
- Modified `js/nostr/videoEventBuffer.js` to include deleted videos in the flushed batch, allowing consumers to handle deletions incrementally.
- Updated `js/services/nostrService.js` to process `updatedVideos` incrementally:
  - Separates updates into active and deleted.
  - Updates `this.videosMap` directly (removing deleted, adding/updating active).
  - Filters and caches only the active updates (O(M)).
  - Emits `videos:updated` with the full sorted list (derived from the updated map) to maintain API contract with consumers.
  - Persists the full sorted list to localStorage.

This reduces the per-batch overhead significantly by avoiding O(N) filtering and map reconstruction for every batch of updates.

Co-authored-by: PR0M3TH3AN <[email protected]>
2026-02-26 17:48:37 +00:00
google-labs-jules[bot]andPR0M3TH3AN 56ffdb693d Refactor decryptLegacyDm to use ordered parallel race for decryptors.
Replaces Promise.any with raceOrdered utility to respect decryptor preference order while maintaining parallel execution.
Adds regression test for order preference.

Co-authored-by: PR0M3TH3AN <[email protected]>
2026-02-26 17:45:31 +00:00
google-labs-jules[bot]andPR0M3TH3AN e2835603c5 Refactor js/utils/qrcode.js to replace innerHTML with DOM manipulation
- Replaced `innerHTML` usage in `Drawing.prototype.draw` (table fallback) with `document.createElement`, `appendChild`, etc.
- Replaced `innerHTML` usage in `Drawing.prototype.clear` with `removeChild` loop.
- Added `tests/qrcode_table_fallback.test.mjs` to verify the table generation logic in a simulated environment (JSDOM) without Canvas support.
- Updated `package.json` to include `jsdom` in `devDependencies` (if it wasn't already there and committed, though I verified it is present after install).

This change eliminates the potential for HTML injection vulnerabilities in the QR code generation library.

Co-authored-by: PR0M3TH3AN <[email protected]>
2026-02-26 17:42:43 +00:00
google-labs-jules[bot]andPR0M3TH3AN 7ec726aad1 Add tests for staticModalAccessibility.js
- Create `tests/static-modal-accessibility.test.mjs` to test `prepareStaticModal`, `openStaticModal`, and `closeStaticModal`.
- Tests cover element resolution, DOM state updates (classes, attributes), and edge cases (missing elements, null targets).
- Use `jsdom` to mock the browser environment.

Co-authored-by: PR0M3TH3AN <[email protected]>
2026-02-26 17:42:07 +00:00
google-labs-jules[bot]andPR0M3TH3AN e95355fdb0 Add unit tests for video menu renderers
- Created `tests/video-menu-renderers.test.mjs` to test `js/ui/components/videoMenuRenderers.js`.
- Implemented comprehensive test coverage for `createVideoMoreMenuPanel`, `createVideoShareMenuPanel`, `createChannelProfileMenuPanel`, and `createVideoSettingsMenuPanel`.
- Tests use `jsdom` to simulate DOM element creation and verify structure, classes, and dataset attributes.
- Ensured dependencies (`jsdom`) are installed.
- Verified tests pass with `npm run test:unit`.

Co-authored-by: PR0M3TH3AN <[email protected]>
2026-02-26 17:41:34 +00:00
google-labs-jules[bot]andPR0M3TH3AN 4bdcfbdb2e Refactor: Replace duplicated extractDTagValue in DeleteModal
Replaced the local `extractDTagValue` function in `js/ui/components/DeleteModal.js` with the shared `getDTagValueFromTags` utility from `js/nostr/nip71.js` (exported via `js/nostr/index.js`).

Added a new unit test `tests/ui/components/DeleteModal.test.mjs` to verify the d-tag extraction logic and ensure the refactor is correct and safe. This test uses `jsdom` to mock the necessary DOM environment.

Co-authored-by: PR0M3TH3AN <[email protected]>
2026-02-26 17:39:07 +00:00
google-labs-jules[bot]andPR0M3TH3AN c4fc0cdb16 test: Add unit tests for linkPreviewSettings.js
- Added comprehensive tests for default settings, storage parsing, and error handling.
- Covered `setLinkPreviewAutoFetch` and `allowLinkPreviewDomain` (including normalization and silent mode).
- Verified `isLinkPreviewDomainAllowed` and event subscriptions.
- Mocked `window.dispatchEvent`, `addEventListener`, and `CustomEvent` locally as they are missing from test helpers.

Co-authored-by: PR0M3TH3AN <[email protected]>
2026-02-26 17:38:30 +00:00
google-labs-jules[bot]andPR0M3TH3AN 931f57eebe Refactor RevertModal to use shared d-tag extraction utility
- Removed duplicated `extractDTagValue` method from `js/ui/components/RevertModal.js`
- Imported and used `getDTagValueFromTags` from `js/nostr/nip71.js`
- Added unit tests for `getDTagValueFromTags` in `tests/nostr/nip71-d-tag.test.mjs`

This reduces code duplication and ensures consistent d-tag extraction logic.

Co-authored-by: PR0M3TH3AN <[email protected]>
2026-02-26 17:37:26 +00:00
google-labs-jules[bot]andPR0M3TH3AN b1b797a12b Add unit tests for commentAvatar.js utility functions
Co-authored-by: PR0M3TH3AN <[email protected]>
2026-02-26 17:36:00 +00:00
google-labs-jules[bot]andPR0M3TH3AN 2eec105545 Add tests for commentAvatar.js utility functions
Co-authored-by: PR0M3TH3AN <[email protected]>
2026-02-26 17:33:09 +00:00
google-labs-jules[bot]andPR0M3TH3AN d5296f82d7 Fix: Add rel="noopener noreferrer" to embed watch button
This commit mitigates a reverse tabnabbing vulnerability by ensuring
that the external link in the embed player opens with proper
security attributes.

Co-authored-by: PR0M3TH3AN <[email protected]>
2026-02-26 17:33:00 +00:00
google-labs-jules[bot]andPR0M3TH3AN d18b3c4838 Refactor extractDTagValue in js/app.js to use getDTagValueFromTags
This commit replaces the duplicated d-tag extraction logic in `extractDTagValue` method of `js/app.js` with the standard utility function `getDTagValueFromTags` from `js/nostr/nip71.js`. This improves code reuse and maintainability.

The fallback logic for `extractDTagValue` now delegates to `getDTagValueFromTags` if `similarContentController` is not present, ensuring consistent behavior.

Verified with unit tests and linting.

Co-authored-by: PR0M3TH3AN <[email protected]>
2026-02-26 17:31:04 +00:00
google-labs-jules[bot]andPR0M3TH3AN d0f0b3ee2e Fix: Add rel="noopener noreferrer" to target="_blank" link in channel profile
This commit addresses a security vulnerability in `views/channel-profile.html` where an external link with `target="_blank"` was missing `rel="noopener noreferrer"`. This could allow the target page to manipulate the `window.opener` object (reverse tabnabbing).

Changes:
- Added `rel="noopener noreferrer"` to the `#channelWebsite` anchor tag.

Verification:
- Confirmed the attribute is present using a Playwright verification script.
- Confirmed no visual regressions.
- Ran linting checks (passed).
- Ran unit tests (pre-existing unrelated failures in NIP compliance noted).

Co-authored-by: PR0M3TH3AN <[email protected]>
2026-02-26 17:30:59 +00:00
thePR0M3TH3AN 9913e484ab chore: add torch update backup snapshots 2026-02-26 08:43:59 -05:00
thePR0M3TH3AN 865dbe841c torch: skip self-copy during update in self-host installs 2026-02-26 08:43:29 -05:00
thePR0M3TH3AN dcff2e7646 chore(torch): track update backup snapshot 2026-02-25 21:12:41 -05:00
thePR0M3TH3AN 25b590647b chore(torch): update package and sanitize colon timestamps 2026-02-25 21:12:08 -05:00
thePR0M3TH3AN 5e01d04e1d update 2026-02-25 15:21:24 -05:00
thePR0M3TH3AN 3ca420a9df Merge pull request #2712 from PR0M3TH3AN/agents/daily/protocol-research-agent-2026-02-25-5019456252140959148
Daily Agent: Protocol Research & Inventory
2026-02-25 13:36:24 -05:00
google-labs-jules[bot]andPR0M3TH3AN c75ed4d431 feat(protocol): Create initial protocol inventory and report
- Create `PROTOCOL_INVENTORY.md` to track non-NIP dependencies (BitTorrent, HLS, LNURL, HTTP Auth).
- Generate `reports/protocol/protocol-report-2026-02-25.md` with findings and recommendations.
- Fix linting false positives by excluding `torch/` and `dev/` directories from design system checks.
- Add `protocol-research-agent` task log.

Co-authored-by: PR0M3TH3AN <[email protected]>
2026-02-25 18:25:04 +00:00
thePR0M3TH3AN 51f37ece22 docs: add TORCH memory integration guidance 2026-02-25 13:12:07 -05:00
thePR0M3TH3AN 0f89cc1524 chore(torch): migrate to new TORCH system and remove legacy agent stack 2026-02-25 12:58:46 -05:00
thePR0M3TH3AN 8fd371b36c Merge pull request #2711 from PR0M3TH3AN/agents/daily/audit-agent-run-1785131454333457700
audit-agent: Daily audit run
2026-02-25 12:38:37 -05:00
google-labs-jules[bot]andPR0M3TH3AN be5ad33918 audit-agent: Daily audit run
- Ran audit scripts: check-file-size, check-innerhtml, lint
- Generated artifacts/audit/2026-02-25/
- Created docs/agents/task-logs/daily/2026-02-25_..._audit-agent_completed.md

Co-authored-by: PR0M3TH3AN <[email protected]>
2026-02-25 17:07:41 +00:00
thePR0M3TH3AN c0edc196ef Merge pull request #2710 from PR0M3TH3AN/agents/daily/ci-health-agent-2026-02-25-7092880812493571695
fix(test): add wait for logout state in login-flows e2e
2026-02-25 11:33:00 -05:00
google-labs-jules[bot]andPR0M3TH3AN b8cf1315e1 fix(test): add wait for logout state in login-flows e2e
Co-authored-by: PR0M3TH3AN <[email protected]>
2026-02-25 16:11:48 +00:00
thePR0M3TH3AN 8102fb97ee Merge pull request #2695 from PR0M3TH3AN/agents/weekly/smoke-agent-harness-11898996381844705269
test(smoke): add smoke-test.mjs harness
2026-02-25 10:36:23 -05:00
thePR0M3TH3AN 9e33fe74ba Merge branch 'unstable' into agents/weekly/smoke-agent-harness-11898996381844705269 2026-02-25 10:36:07 -05:00
thePR0M3TH3AN 7ec86487f5 Merge pull request #2693 from PR0M3TH3AN/agents/daily/scheduler-update-agent-2026-02-23-1075521348879577769
docs(agents): scheduler-update-agent sync (no changes)
2026-02-25 10:35:31 -05:00