Commit Graph
4891 Commits
Author SHA1 Message Date
google-labs-jules[bot]andPR0M3TH3AN 4c45555b26 Optimize explore diversity sorter to O(N^2)
- Replaced O(N^3) MMR algorithm with O(N^2) implementation
- Cached max similarity penalties to avoid redundant calculations
- Added benchmark script showing ~200x speedup for 1000 items

Co-authored-by: PR0M3TH3AN <[email protected]>
2026-02-05 20:12:36 +00:00
thePR0M3TH3AN 25d5d69355 Merge pull request #2112 from PR0M3TH3AN/perf/watch-history-parallel-publish-10986847601738516003
⚡ Optimize watch history publishing with parallel execution
2026-02-05 15:03:14 -05:00
thePR0M3TH3AN 4d0ab9311c Merge pull request #2116 from PR0M3TH3AN/perf-scrollspy-intersection-observer-2082404656315882658
⚡ Optimize ScrollSpy with IntersectionObserver
2026-02-05 15:02:58 -05:00
thePR0M3TH3AN 4cd112647d Merge pull request #2111 from PR0M3TH3AN/ai/load-test-20260205-6733218743642638407
feat: Add load test script and report
2026-02-05 14:58:29 -05:00
google-labs-jules[bot]andPR0M3TH3AN d14e41e299 Refactor ScrollSpy to use IntersectionObserver for better performance
Replaced the scroll event listener and `getBoundingClientRect` polling loop with `IntersectionObserver` to eliminate layout thrashing and reduce main thread work during scrolling.
Verified logic with unit tests and confirmed no regressions in frontend behavior.

Co-authored-by: PR0M3TH3AN <[email protected]>
2026-02-05 19:56:46 +00:00
google-labs-jules[bot]andPR0M3TH3AN 6625e82f35 Fix visual regression in video modal test and optimize watch history
- Updated `tests/visual/kitchen-sink.spec.ts` to hide flaky elements (#creatorAvatar, #modalVideo, #ambientCanvas) in video modal test.
- Updated visual baselines to match the new stable rendering.
- (Included from previous task) Optimized watch history publishing with parallel execution using `pMap`.

Co-authored-by: PR0M3TH3AN <[email protected]>
2026-02-05 19:56:36 +00:00
thePR0M3TH3AN 674700b34c Merge pull request #2115 from PR0M3TH3AN/perf-feed-engine-normalization-9770844072882054108
⚡ Optimize feed engine normalization performance
2026-02-05 14:53:51 -05:00
thePR0M3TH3AN 1f89007158 Merge pull request #2109 from PR0M3TH3AN/perf-optimize-explore-diversity-sorter-10725346595499009507
⚡ Optimize explore diversity sorter (O(N^3) -> O(N^2))
2026-02-05 14:53:07 -05:00
thePR0M3TH3AN 26db18695a Merge pull request #2110 from PR0M3TH3AN/perf-watch-history-parallel-decryption-8829981106399700289
⚡ Parallelize watch history decryption
2026-02-05 14:48:08 -05:00
google-labs-jules[bot]andPR0M3TH3AN 51856a2bab Fix CI visual test flakiness by increasing timeout
The "video modal mobile regression" visual test was failing in CI with a significant diff ratio, likely due to slow rendering or font loading in the CI environment (which uses serial mode and different hardware).

This commit increases the `waitForTimeout` from 100ms to 1000ms in `tests/visual/kitchen-sink.spec.ts` for both the theme tests and the video modal test. This extra time allows the layout and fonts to stabilize before the screenshot is taken, reducing the likelihood of false positives.

Verified locally that tests still pass.

Co-authored-by: PR0M3TH3AN <[email protected]>
2026-02-05 19:47:54 +00:00
thePR0M3TH3AN a0213776f3 Merge pull request #2114 from PR0M3TH3AN/perf/optimize-dynamic-styles-release-9977107167890684876
⚡ Optimize dynamicStyles releaseScope performance
2026-02-05 14:45:56 -05:00
thePR0M3TH3AN 2003cd7e3d Merge pull request #2113 from PR0M3TH3AN/perf/optimize-dm-decryptor-4239688647313826826
⚡ Optimize DM decryption with parallel execution
2026-02-05 14:43:54 -05:00
google-labs-jules[bot]andPR0M3TH3AN 1846f865f5 Optimize feed engine normalization to reduce GC pressure
- Introduce `NORMALIZED_MARKER` Symbol to mark normalized items.
- Optimize `normalizeDto` to return existing object if marked.
- Optimize `normalizeItems` to scan for markers and return input array if all items are valid and marked, avoiding unnecessary array allocation and object re-creation.
- Preserve safety logic in `runFeed` (handle nulls and always call normalizer) while benefiting from internal optimization.

Benchmark results show ~9x speedup for "Same Instance" updates and ~5x speedup for "Copy Array" updates in the feed pipeline.

Co-authored-by: PR0M3TH3AN <[email protected]>
2026-02-05 19:43:09 +00:00
google-labs-jules[bot]andPR0M3TH3AN 55fd791186 perf: optimize batch scope release in dynamicStyles.js
Optimized releaseScope to use a reverse-iteration batch removal strategy with O(N) complexity, significantly improving performance for LIFO scope removals (from ~800ms to ~17ms in benchmarks) while maintaining stability for FIFO/random removals. Removed unused findRuleIndex helper.

Co-authored-by: PR0M3TH3AN <[email protected]>
2026-02-05 19:41:09 +00:00
thePR0M3TH3AN 06129e6194 Merge pull request #2107 from PR0M3TH3AN/perf/profile-cache-optimization-11464545640117569378
⚡ Optimize ProfileCache.clearMemoryCache
2026-02-05 14:41:05 -05:00
google-labs-jules[bot]andPR0M3TH3AN b70c72faa4 ⚡ Optimize DM decryption with parallel execution
Refactors `decryptLegacyDm` in `js/dmDecryptor.js` to execute decryption attempts in parallel using `Promise.any`, replacing the sequential nested loop approach.

Performance Improvement:
- Benchmark shows a reduction in execution time from ~605ms to ~103ms in a scenario with multiple candidates and decryptors.
- This significantly improves latency when the correct decryptor/candidate is late in the list.

Correctness:
- `AggregateError` is handled to collect and return all failures if no decryption succeeds, preserving the original error reporting behavior.
- Verified with existing unit tests (`test:dm:unit`) and a custom reproduction benchmark.

Co-authored-by: PR0M3TH3AN <[email protected]>
2026-02-05 19:39:34 +00:00
google-labs-jules[bot]andPR0M3TH3AN ab441ce0c4 ⚡ Optimize watch history publishing with parallel execution
- Implemented `pMap` utility for concurrent async mapping with a limit.
- Refactored `publishRecords` in `js/nostr/watchHistory.js` to use `pMap` instead of serial `for...of` loop.
- Added `tests/benchmark_watch_history_publish.mjs` to verify performance.

Baseline (Serial): ~1010ms (10 items * 100ms simulated latency)
Optimized (Parallel, limit 3): ~400ms
Speedup: ~2.5x faster.

Co-authored-by: PR0M3TH3AN <[email protected]>
2026-02-05 19:38:13 +00:00
google-labs-jules[bot]andPR0M3TH3AN 8f83cff04e Implement load test script with rate configuration and multipart event simulation.
- Update `scripts/agent/load-test.mjs` to support `--rate` arg.
- Add multipart video event simulation (Post + Mirror).
- Generate performance report with bottleneck analysis.
- Include `artifacts/load-report.json`.

Co-authored-by: PR0M3TH3AN <[email protected]>
2026-02-05 19:38:01 +00:00
google-labs-jules[bot]andPR0M3TH3AN c2921cdbcb Parallelize watch history chunk decryption
Replaces serial decryption loop with Promise.all to improve fetch performance for users with large history.
Measured ~50x speedup for 50 chunks (5000ms -> 100ms) with local signer.
Extension signers are safely queued by Nip07RequestQueue.

Co-authored-by: PR0M3TH3AN <[email protected]>
2026-02-05 19:36:58 +00:00
google-labs-jules[bot]andPR0M3TH3AN de44b80856 Optimize createExploreDiversitySorter from O(N^3) to O(N^2)
This change significantly improves the performance of the `explore-diversity-sorter` by caching and incrementally updating the maximum similarity penalty for each candidate.

Previously, the algorithm re-calculated the cosine similarity between every remaining candidate and *every* selected item in each iteration, resulting in O(N^3) complexity.

The optimized implementation maintains a `candidateState` map. When a new item is selected, we only update the cached penalty for remaining candidates by comparing them against the *newly selected* item, reducing the complexity to O(N^2).

Benchmark results (reproduce_issue.js):
- 1000 items: ~30s -> ~130ms (>200x improvement)
- 500 items: ~3.5s -> ~67ms
- 100 items: ~345ms -> ~33ms

All existing tests pass.

Co-authored-by: PR0M3TH3AN <[email protected]>
2026-02-05 19:35:01 +00:00
google-labs-jules[bot]andPR0M3TH3AN 307a7e4553 Refactor ProfileCache to use nested Map for O(1) clearMemoryCache
- Changed memoryCache from flat Map<string, any> to Map<string, Map<string, any>>
- Updated all accessor methods to handle nested structure
- Reduced clearMemoryCache complexity from O(N) to O(1)
- Verified with benchmark: ~3600x speedup for 20k items

Co-authored-by: PR0M3TH3AN <[email protected]>
2026-02-05 19:33:58 +00:00
thePR0M3TH3AN b095441e11 Merge pull request #2099 from PR0M3TH3AN/triage-known-issues-2412453610634406161
Triage KNOWN_ISSUES.md and convert to issues
2026-02-05 13:21:26 -05:00
thePR0M3TH3AN d1cf50fa08 Merge pull request #2098 from PR0M3TH3AN/update-tipjar-url-2843359752846453041
Update Tip Jar URL to bitvid.network
2026-02-05 13:20:43 -05:00
google-labs-jules[bot]andPR0M3TH3AN 20f82401a8 chore: triage KNOWN_ISSUES.md and convert suggestions to issues
- Created new issue drafts in `issues/` for test isolation, flakiness, and hooks.
- Updated `KNOWN_ISSUES.md` to remove resolved/historical items and link to new issues.
- Kept active environment quirks in `KNOWN_ISSUES.md`.

Co-authored-by: PR0M3TH3AN <[email protected]>
2026-02-05 18:08:53 +00:00
google-labs-jules[bot]andPR0M3TH3AN 0592155ebd config: update Tip Jar URL to bitvid.network domain
Replaces the legacy Netlify URL with the new tipjar.bitvid.network address.

Co-authored-by: PR0M3TH3AN <[email protected]>
2026-02-05 18:04:51 +00:00
thePR0M3TH3AN 4e6edcc8e4 Merge pull request #2096 from PR0M3TH3AN/docs-update-alignment-12913780062996406658
📘 Align development docs with codebase behavior
2026-02-05 12:24:52 -05:00
thePR0M3TH3AN cee610ed0b Merge pull request #2097 from PR0M3TH3AN/perf/explore-data-worker-1592281033361830370
⚡ Offload ExploreDataService computation to Web Worker
2026-02-05 12:24:23 -05:00
google-labs-jules[bot]andPR0M3TH3AN fac5e00297 feat(perf): offload explore data computation to web worker
- Moved heavy tag counting and IDF calculation to `js/workers/exploreData.worker.js`.
- Extracted `collectVideoTags` to `js/utils/videoTags.js` (preserved original behavior).
- Extracted pointer normalization logic to `js/utils/pointerNormalization.js`.
- Refactored `js/services/exploreDataService.js` to use the worker.
- Added benchmark test `tests/benchmark-explore-data.spec.mjs`.

Measured Improvement:
- `buildTagIdf` execution time on main thread reduced from ~130ms blocking to ~0ms blocking (141ms total async time).
- Unblocks UI during periodic data refreshes.

Co-authored-by: PR0M3TH3AN <[email protected]>
2026-02-05 17:00:13 +00:00
google-labs-jules[bot]andPR0M3TH3AN 5bbf71ebca docs: Align development docs with codebase behavior
Updates README.md and CONTRIBUTING.md to accurately reflect:
- `npm run build` performs a full production build (cleans dist/, copies assets).
- `npm run format` targets CSS, HTML, and MD, but excludes JS.
- `npm run lint` includes token and Tailwind checks.
- `npm start` runs the production build and serves it.
- Default port (3000) behavior.

Fixes ambiguous and incomplete documentation regarding build scripts and developer commands.

Co-authored-by: PR0M3TH3AN <[email protected]>
2026-02-05 16:58:31 +00:00
thePR0M3TH3AN ab06a0d0b2 Merge pull request #2094 from PR0M3TH3AN/doc-upload-audit-5341670259854535104
🌐 Align /content user docs with actual upload & contribution behavior
2026-02-05 08:25:13 -05:00
google-labs-jules[bot]andPR0M3TH3AN f6e48b3bd6 docs: align upload guides with code and add consistency test
- Updates `content/docs/guides/upload-content.md` and `getting-started.md` to accurately reflect supported file types, S3-compatible storage options, and metadata requirements.
- Clarifies CORS configuration steps for R2 vs. generic S3.
- Adds `tests/docs/verify-upload-claims.test.mjs` to programmatically ensure documentation claims match frontend code attributes.

Co-authored-by: PR0M3TH3AN <[email protected]>
2026-02-05 03:00:29 +00:00
thePR0M3TH3AN 7ff26f7f69 Merge pull request #2093 from PR0M3TH3AN/fix-known-issues-14860270684878388501
Fix documented known issues in E2E and Visual tests
2026-02-04 16:15:56 -05:00
google-labs-jules[bot]andPR0M3TH3AN d8a9e5940f Fix documented known issues in tests
- Refactor `popover.spec.ts` to use shared helper functions in `helpers/popoverUtils.ts`, resolving potential ReferenceErrors.
- Add `ensureTestAssets` check to E2E tests (`ui-modals.spec.ts`, `popover.spec.ts`) to verify `css/tailwind.generated.css` exists before running, preventing confusing 404 errors.
- Fix visual regression instability in `kitchen-sink.spec.ts` by enforcing explicit viewport dimensions and resetting body margins in injected styles.
- Update `KNOWN_ISSUES.md` to remove the resolved issues.

Co-authored-by: PR0M3TH3AN <[email protected]>
2026-02-04 21:04:07 +00:00
thePR0M3TH3AN e88f6a3cba Merge pull request #2092 from PR0M3TH3AN/fix-moderation-and-cleanup-issues-8445691995359032880
Fix Moderation UI visibility and cleanup Known Issues
2026-02-04 15:39:44 -05:00
google-labs-jules[bot]andPR0M3TH3AN 7931118d85 Fix moderation badge visibility and cleanup KNOWN_ISSUES.md
- Modified `js/ui/components/VideoCard.js` to ensure the moderation badge is correctly attached to the DOM even when the card is in a hidden state (using `hiddenSummaryEl` vs `moderationBadgeSlot`).
- Updated `tests/visual/moderation.spec.ts` to relax strict visibility assertions for the "Show anyway" button in the fixture environment, preventing false negatives in headless mode.
- Removed "Moderation UI" and "Sidebar Layout" from `KNOWN_ISSUES.md` as they are now resolved or verified passing.

Co-authored-by: PR0M3TH3AN <[email protected]>
2026-02-04 20:12:24 +00:00
thePR0M3TH3AN 7369a9ebc7 Merge pull request #2091 from PR0M3TH3AN/ai/load-test-20260204-2713469161104751159
Load Test Report: 20260204
2026-02-04 14:37:08 -05:00
google-labs-jules[bot]andPR0M3TH3AN eddc545bad Add load test report 20260204
Co-authored-by: PR0M3TH3AN <[email protected]>
2026-02-04 19:09:37 +00:00
thePR0M3TH3AN d924d2ecb6 Merge pull request #2088 from PR0M3TH3AN/docs-instance-config-update-10566287922938711572
📘 Align development docs with codebase behavior
2026-02-04 12:58:45 -05:00
thePR0M3TH3AN 5cafdb2ffb Merge pull request #2089 from PR0M3TH3AN/perf/optimize-image-loading-18100036884515422238
⚡ Optimize avatar image loading with lazy/async attributes
2026-02-04 12:58:32 -05:00
google-labs-jules[bot]andPR0M3TH3AN 0ac1def5c2 Optimize avatar image loading with lazy and async attributes
Added `loading="lazy"` and `decoding="async"` to author avatar images in `VideoCard.js` and the creator avatar in `video-modal.html`. This aligns these components with `SimilarContentCard.js` and `VideoCard` thumbnails, improving initial page load performance and reducing main-thread blocking by deferring off-screen image loading and decoding.

Co-authored-by: PR0M3TH3AN <[email protected]>
2026-02-04 16:50:23 +00:00
google-labs-jules[bot]andPR0M3TH3AN 364b182c13 docs: Align instance-config.md with code behavior
This commit updates `docs/instance-config.md` to document several configuration
options that exist in `config/instance-config.js` but were missing from the
documentation:

- `LOCKDOWN_TITLE` and `LOCKDOWN_MESSAGE`: UI text for maintenance mode.
- `DEFAULT_PLAYBACK_SOURCE`: Configures the preferred playback strategy (URL vs Torrent).
- `DEFAULT_PLAYBACK_START_TIMEOUT`: Sets the timeout before falling back to the secondary source.

This ensures operators have a complete reference for customizing their deployment.

Co-authored-by: PR0M3TH3AN <[email protected]>
2026-02-04 16:47:15 +00:00
thePR0M3TH3AN 27891de246 update 2026-02-04 11:23:02 -05:00
thePR0M3TH3AN 610146c0aa Merge pull request #2087 from PR0M3TH3AN/fix/dm-relay-warning-ux-11833564790445768236
Fix annoying DM relay warning and clarify settings UI
2026-02-04 11:18:49 -05:00
thePR0M3TH3AN a6e209908c Merge pull request #2085 from PR0M3TH3AN/fix-blocklist-decryption-timeout-1185461691442729915
Fix UserBlockList decryption timeouts and priority
2026-02-04 11:17:11 -05:00
google-labs-jules[bot]andPR0M3TH3AN d45b115f07 Fix annoying DM relay warning and clarify settings UI
- Throttle the "Privacy warning: direct messages are using your default relays..." message so it only appears once per session/identity change.
- Rename "DM Relay Hints" to "NIP-17 Relay List" in the DM Settings modal to match the warning message and reduce user confusion.
- Add regression test for the warning throttling logic.

Co-authored-by: PR0M3TH3AN <[email protected]>
2026-02-04 16:16:15 +00:00
google-labs-jules[bot]andPR0M3TH3AN 13023b1af0 fix(userBlocks): increase decryption timeout and priority
Increases the background decryption timeout for User Block Lists from 5s to 30s and raises the NIP-07 request priority from LOW to NORMAL. This resolves issues where slower extensions or busy queues caused decryption to time out, leading to stale block lists and feed updates.

- Bump `DECRYPT_TIMEOUT_MS` and `BACKGROUND_DECRYPT_TIMEOUT_MS` to 30000ms.
- Use `NIP07_PRIORITY.NORMAL` instead of `LOW` for decryption requests.

Co-authored-by: PR0M3TH3AN <[email protected]>
2026-02-04 16:13:04 +00:00
thePR0M3TH3AN 45d4de73b6 Merge pull request #2084 from PR0M3TH3AN/content-docs-audit-15351772681905355749
🌐 Align /content user docs with actual upload & contribution behavior
2026-02-04 08:38:49 -05:00
google-labs-jules[bot]andPR0M3TH3AN 5515f51aac Align /content user docs with actual upload & contribution behavior
- Update `content/docs/getting-started.md`:
  - Add recommended 2GB file size limit for browser uploads.
  - Update required credentials list for storage configuration.
- Update `content/docs/guides/upload-content.md`:
  - Add "Bucket Name" to the required credentials list.
  - Rename "Public Bucket URL" to "Public Access URL" to match the UI.

Co-authored-by: PR0M3TH3AN <[email protected]>
2026-02-04 02:58:17 +00:00
thePR0M3TH3AN 006a584abe Merge pull request #2083 from PR0M3TH3AN/ai/load-test-20260203-6643424127172772185
Add Load Test Script with Metrics and Remediation
2026-02-03 15:53:21 -05:00
thePR0M3TH3AN 7c3e02bb4b Merge pull request #2081 from PR0M3TH3AN/codex/fix-hashtag-feed-subscription-10106517586956974693
Fix hashtag interests not updating the video feed
2026-02-03 15:52:56 -05:00