Commit Graph
3324 Commits
Author SHA1 Message Date
thePR0M3TH3AN a5ec2fb54f Merge pull request #1225 from PR0M3TH3AN/fix-hashtag-preferences-reset-14075388825661350751
Prevent hashtag preferences reset on transient load failures
2026-01-14 20:25:55 -05:00
google-labs-jules[bot] 48ceed6797 fix(hashtagPreferences): prevent state reset on transient load failures
Prevents `HashtagPreferencesService` from aggressively resetting local state to empty when a load attempt fails due to transient issues (like empty relay lists or network errors) if valid data is already loaded for the current user. This fixes a race condition where tags would briefly load correctly and then turn gray/disappear during application initialization.
2026-01-15 01:23:55 +00:00
thePR0M3TH3AN b9171e9e05 Merge pull request #1223 from PR0M3TH3AN/video-source-toggle-2596229844924260490
Add CDN/P2P Source Toggle to Video Player
2026-01-14 20:09:31 -05:00
google-labs-jules[bot] 7dc60c36ef Add playback source toggle (CDN/P2P) to video modal
- Added toggle buttons and stat counters to `video-modal.html`.
- Updated `VideoModal.js` to manage toggle visibility (show if either source exists, disable unavailable option) and dispatch `playback:switch-source` events.
- Updated `app.js` to handle source switching by restarting playback with a `forcedSource`.
- Updated `playbackService.js` to respect `forcedSource` by bypassing probe logic when a specific source is requested.
2026-01-15 01:06:56 +00:00
google-labs-jules[bot] 95a91ee675 Implement video source toggle (CDN vs P2P)
- Added source toggle UI in `components/video-modal.html`.
- Updated `VideoModal.js` to manage toggle visibility (only when both URL and Magnet exist), update peer/server counts, and dispatch `playback:switch-source` events.
- Updated `PlaybackService.js` to support a `forcedSource` option, allowing bypassing of the URL probe when "torrent" is forced.
- Updated `app.js` to listen for the toggle event on the video modal and re-initialize playback with the forced source preference.
- Updated `tests/ui/helpers/jsdom-test-helpers.mjs` to expose necessary globals for JSDOM testing.
- Fixed an issue where the event listener was missing in `app.js`, causing the toggle to be unresponsive.
2026-01-14 22:06:41 +00:00
google-labs-jules[bot] 6c3ac4d49f Implement video source toggle (CDN vs P2P)
- Added source toggle UI in `components/video-modal.html`.
- Updated `VideoModal.js` to manage toggle visibility (only when both URL and Magnet exist), update peer/server counts, and dispatch `playback:switch-source` events.
- Updated `PlaybackService.js` to support a `forcedSource` option, allowing bypassing of the URL probe when "torrent" is forced.
- Updated `app.js` to listen for the toggle event and re-initialize playback with the forced source preference.
- Updated `tests/ui/helpers/jsdom-test-helpers.mjs` to expose necessary globals for JSDOM testing.
- Verified functionality with targeted updates and existing unit tests.
2026-01-14 21:18:46 +00:00
thePR0M3TH3AN 9932279d3f Merge pull request #1222 from PR0M3TH3AN/event-details-modal-6211185828023206068
Add Event Details modal with raw JSON and history navigation
2026-01-14 15:57:15 -05:00
google-labs-jules[bot] 71a9eaf288 feat: add event details modal with edit history navigation
- Added `EventDetailsModal` to display raw JSON and metadata.
- Implemented `open-channel` action to navigate to creator profile.
- Fixed profile image loading by checking `creatorPicture` and `creator.picture`.
- Added `hideModal()` to `Application` class to fix crash in `openCreatorChannel`.
- Wired up "Event Details" menu option in video card menu.
- Ensured edit history is sorted Newest First for navigation.
2026-01-14 20:55:29 +00:00
google-labs-jules[bot] 6794a54fba Fix View Channel button functionality and styling in EventDetailsModal 2026-01-14 20:42:36 +00:00
google-labs-jules[bot] f1d74894f2 Fix View Channel button functionality and styling in EventDetailsModal 2026-01-14 20:28:26 +00:00
google-labs-jules[bot] 1c7daff733 Update Event Details Modal to use hydrateVideoHistory and improved layout 2026-01-14 19:54:38 +00:00
google-labs-jules[bot] 9a6efdc1b6 Add Event Details modal to video card menu 2026-01-14 19:47:23 +00:00
google-labs-jules[bot] 4b5a46c5bd Add Event Details modal to video card menu 2026-01-14 19:29:32 +00:00
thePR0M3TH3AN 32f6c43a87 Merge pull request #1221 from PR0M3TH3AN/fix-r2-sdk-dependency-error-12606474915456046718
fix(storage): replace jsdelivr with esm.sh for aws-sdk to fix dependency error
2026-01-14 12:58:13 -05:00
google-labs-jules[bot] 7b9781a3dd feat: enhance playback service logging to debug R2 404 issues 2026-01-14 17:56:11 +00:00
google-labs-jules[bot] 175a6f73b4 fix(webtorrent): support webseeds in health checks
Updated `probePeers` in `js/webtorrent.js` to detect `ws` (WebSeed) parameters in magnet links. If a web seed is present, the torrent is now considered "healthy" with at least one peer, even if tracker probing fails or returns zero peers. This ensures videos hosted on R2 (or other HTTP sources) are correctly marked as available in the UI.
2026-01-14 17:37:50 +00:00
google-labs-jules[bot] 0a79108c05 fix(r2): validate baseDomain to reject S3 API endpoints
Updated `r2Service.js` to detect if the user inputs an S3 API endpoint (e.g. `*.r2.cloudflarestorage.com`) as the Public Bucket URL. If detected, it prevents saving and displays a clear error message instructing the user to use the correct public domain (e.g. `*.r2.dev`). This prevents CORS errors and confusion caused by using the wrong endpoint type.
2026-01-14 17:19:14 +00:00
google-labs-jules[bot] fe1b6d0ae2 fix(storage): fix R2 setup issues (CORS, polyfills, headers)
- Switched to `esm.sh` bundle for `@aws-sdk/client-s3` to fix browser compatibility and `fs.readFile` errors.
- Removed `cf-create-bucket-if-missing` header from `multipartUpload` to prevent 403 Forbidden/CORS failures with standard API tokens.
- Refactored `verifyPublicAccess` to attempt CORS setup even if bucket check fails, and added specific error messaging for CORS issues.
- Updated documentation to include `POST` and `HEAD` in the recommended R2 CORS policy.
2026-01-14 17:11:04 +00:00
google-labs-jules[bot] 2758081a2f fix(storage): prevent r2 upload failure by removing restricted header
Removed the `cf-create-bucket-if-missing` header from the multipart upload request in `js/storage/r2-s3.js`. This header triggers a 403 Forbidden error (and subsequent "Failed to fetch" due to CORS behavior) when using R2 API tokens with limited "Object Read & Write" permissions, as it requires bucket creation privileges. Bucket existence is now handled separately.
2026-01-14 16:55:25 +00:00
google-labs-jules[bot] c3179672b1 docs: update R2 CORS policy to include POST and HEAD
Updated the Cloudflare R2 setup instructions in `content/upload-content.md` to include `POST` and `HEAD` in the `AllowedMethods` CORS configuration. This is necessary for multipart uploads (which use POST) and verification checks (which use HEAD) to function correctly.
2026-01-14 16:42:36 +00:00
google-labs-jules[bot] 8097f64ba8 fix(storage): handle R2 CORS errors & use bundled aws-sdk
1.  **Refactor R2 Verification**: Separated bucket existence checks from CORS configuration in `r2Service.js`. Previously, if `HeadBucket` failed (e.g., due to CORS restrictions), the CORS configuration step was skipped. Now, CORS setup is attempted independently, increasing the chance of successful auto-configuration.
2.  **Improve Error Messaging**: Enhanced error handling in `verifyPublicAccess` to detect "Failed to fetch" errors and explicitly suggest checking Cloudflare R2 CORS settings in the UI.
3.  **Fix AWS SDK Import**: Consolidated the AWS SDK import fix to use the `?bundle` version from `esm.sh` in `r2-s3.js`. This prevents `fs.readFile` runtime errors by ensuring a browser-compatible build is loaded.
2026-01-14 16:36:25 +00:00
google-labs-jules[bot] 857536c28f fix(storage): use esm.sh bundled aws-sdk to prevent fs error
Switched the CDN provider for the AWS SDK (R2 client) to the bundled version from `esm.sh` (`?bundle`). This resolves a runtime error `[unenv] fs.readFile is not implemented yet!` which occurred because the previous build was attempting to import Node.js-specific credential providers that rely on the filesystem.

The bundled version from `esm.sh` correctly resolves the browser entry points and provides browser-compatible polyfills (or safe defaults) for dependencies, ensuring the SDK initializes correctly in the client environment.

This change updates the `AWS_SDK_SPECIFIER` constant in `js/storage/r2-s3.js`.
2026-01-14 16:11:20 +00:00
google-labs-jules[bot] 4aa0021029 fix(storage): replace jsdelivr with esm.sh for aws-sdk
Switched the CDN provider for the AWS SDK (R2 client) from `jsdelivr` to `esm.sh` to resolve a runtime dependency error ("does not provide an export named 'blobHasher'"). This error was caused by a broken bundling of the transitive dependency `@smithy/hash-blob-browser` on `jsdelivr`.

This change updates the `AWS_SDK_SPECIFIER` constant in `js/storage/r2-s3.js`.
2026-01-14 15:48:30 +00:00
thePR0M3TH3AN f9f8b9da4a Merge pull request #1220 from PR0M3TH3AN/fix-visual-regression-failures-17326090370992658064
Fix visual regression test failures and logic bugs
2026-01-14 10:03:05 -05:00
google-labs-jules[bot] b66e801fa2 fix(ci): Resolve visual regression failures and test flakiness (v2)
- Fix scoping and property mismatch errors in `popover.spec.ts`.
- Relax placement assertion in `popover.spec.ts` to accommodate environment variations.
- Implement missing `onModerationHide` handler in `docs/moderation/fixtures/index.html`.
- Improve `VideoCard.js` moderation badge handling to ensure correct DOM placement and static positioning when the card is hidden.
- Update `moderation.spec.ts` to use `toHaveCount(1)` and `dispatchEvent('click')` for button interactions, bypassing persistent headless rendering visibility issues (clipping).
- Increase tolerance in `overlay-layers.spec.ts` to account for scrollbar width differences in CI environments.
- Update `check-inline-styles.mjs` to ignore Playwright report directories.
- Update visual baselines for `kitchen-sink` to match the current environment.
2026-01-14 14:57:39 +00:00
google-labs-jules[bot] 1bc11e1ae8 fix(ci): Resolve visual regression failures and test flakiness
- Fix scoping and property mismatch errors in `popover.spec.ts`.
- Relax placement assertion in `popover.spec.ts` to accommodate environment variations.
- Implement missing `onModerationHide` handler in `docs/moderation/fixtures/index.html`.
- Improve `VideoCard.js` moderation badge handling to ensure correct DOM placement and static positioning when the card is hidden.
- Update `moderation.spec.ts` to use `toHaveCount(1)` and `dispatchEvent('click')` for button interactions, bypassing persistent headless rendering visibility issues (clipping).
- Increase tolerance in `overlay-layers.spec.ts` to account for scrollbar width differences in CI environments.
- Update `check-inline-styles.mjs` to ignore Playwright report directories.
- Update visual baselines for `kitchen-sink` to match the current environment.
2026-01-14 14:50:31 +00:00
thePR0M3TH3AN 148ca01281 Merge pull request #1217 from PR0M3TH3AN/fix-popover-tests-jsdom-ref-3613247743198183095
Fix popover engine unit tests for JSDOM compatibility
2026-01-13 23:35:23 -05:00
google-labs-jules[bot] 4cd85b8096 Fix JSDOM reference error and assertion in popover tests
- Exposed `HTMLStyleElement` globally in `tests/ui/popoverEngine.test.mjs` to resolve a `ReferenceError` during `instanceof` checks.
- Updated assertion in "applies token-based sizing and arrow positioning" to check the `--popover-arrow-top` CSS variable instead of the `top` property, as JSDOM does not compute layout properties from variables.
- Verified all tests in the file pass.
2026-01-14 04:29:16 +00:00
thePR0M3TH3AN c0be521be2 Merge pull request #1216 from PR0M3TH3AN/fix-subscription-tests-3380883128418492214
Update subscription manager tests to remove legacy kind requirement
2026-01-13 23:18:52 -05:00
google-labs-jules[bot] d9c6cce97d Update subscription manager tests to remove legacy kind requirement
- Modified `tests/subscriptions-manager.test.mjs` to remove the assertion for legacy Kind 30002 support.
- Updated the test to verify that only the current `SUBSCRIPTION_SET_KIND` (30000) is queried.
- Fixed JSDOM `navigator` mocking in the test file to resolve `TypeError: Cannot set property navigator...` errors.
- Verified all tests pass with the new implementation.
2026-01-14 04:17:13 +00:00
thePR0M3TH3AN e49d4e4f24 Merge pull request #1215 from PR0M3TH3AN/fix-history-pane-refresh-6549169443883378731
Fix history pane stale data on re-open
2026-01-13 23:07:26 -05:00
google-labs-jules[bot] 4bf3605fd2 Fix: Ensure history pane refreshes on subsequent visits
This change ensures that the profile history pane refreshes its content when the user navigates back to it, addressing a bug where stale data could be displayed.

It implements an optimized strategy:
- On the first load, `ensureInitialLoad` is called, which handles the initial fetch internally.
- On subsequent visits (when the renderer is already initialized), `refresh({ force: true })` is called explicitly to update the list.

The unit test `history pane lazily initializes the watch history renderer` was updated to reflect this behavior, verifying that `ensureInitialLoad` is called once and `refresh` is called on subsequent opens.
2026-01-14 04:05:23 +00:00
thePR0M3TH3AN 040a5d0976 Merge pull request #1214 from PR0M3TH3AN/fix-popover-test-reference-error-1181338534566980395
Fix ReferenceError in position-floating-panel tests
2026-01-13 22:54:29 -05:00
google-labs-jules[bot] 05c091c26f Fix unit tests: Expose HTMLStyleElement in JSDOM setup
This change addresses a `ReferenceError: HTMLStyleElement is not defined` failure in `tests/position-floating-panel.test.mjs`. The `popoverEngine.js` source code performs an `instanceof HTMLStyleElement` check, which requires the class to be available in the global scope. While JSDOM provides this class, the test setup was not exposing it to the global object.

- Updated `tests/position-floating-panel.test.mjs` to add `global.HTMLStyleElement = windowRef.HTMLStyleElement;` in the `beforeEach` block.
2026-01-14 03:52:53 +00:00
thePR0M3TH3AN 05a922687f Merge pull request #1213 from PR0M3TH3AN/fix-comment-event-validation-test-12140441605457442206
Fix validation failure in comment event unit test
2026-01-13 22:43:53 -05:00
google-labs-jules[bot] 6735eb0dea Fix comment event validation test case
Added missing root kind (K) and root author (P) tags to the mock event in `tests/nostr/comment-events.test.mjs`. This fixes a test failure where the event was being rejected by strict validation logic in `isVideoCommentEvent` because the tags derived from the definition address were not present in the event itself.

The added tags use whitespace and mixed casing to preserve the test's intent of verifying robust tag parsing.
2026-01-14 03:42:53 +00:00
thePR0M3TH3AN fe30449418 Merge pull request #1212 from PR0M3TH3AN/fix-comment-event-tests-815291605250186737
Fix comment event unit tests and normalization logic
2026-01-13 22:23:28 -05:00
google-labs-jules[bot] f3075b8929 Fix unit tests for comment events and improve target normalization logic
- Updated `subscribeVideoComments` test to expect `#A` filter keys (uppercase), matching the implementation and other tests.
- Improved `normalizeCommentTarget` in `js/nostr/commentEvents.js` to correctly derive `parentKind` and `parentAuthorPubkey` from the `parentCommentEvent` object if available.
- Enhanced `parentAuthorRelay` resolution to look up the specific `p` tag for the author pubkey instead of defaulting to the first found `p` tag.
- Updated `publishComment` test expectations to remove duplicate tags (implementation correctly deduplicates) and reflect improved metadata derivation (correct `K` tag and `P` relay).
- Added async wait to `subscribeVideoComments` test to prevent race condition in unsubscribe assertion.
2026-01-14 03:22:25 +00:00
thePR0M3TH3AN dd82cc6949 Merge pull request #1211 from PR0M3TH3AN/lint-fixes-token-replacement-418374991526815797
Fix design token linting errors
2026-01-13 21:53:11 -05:00
google-labs-jules[bot] a5e7e48fea Fix lint:tailwind-brackets errors by using design tokens
Replaced arbitrary Tailwind values with standard design tokens in HTML files to pass the linting checks:
- `components/upload-modal.html`: Replaced `text-[10px]` with `text-4xs` (approx. 10.4px).
- `views/channel-profile.html`: Replaced `max-sm:text-[0.7rem]` with `max-sm:text-2xs` (0.7rem).
- `views/channel-profile.html`: Replaced `max-sm:h-[3.2rem]` and `max-sm:w-[3.2rem]` with `max-sm:h-12` and `max-sm:w-12` (standard 3rem/48px spacing).
2026-01-14 02:51:02 +00:00
thePR0M3TH3AN 560da42081 Merge pull request #1210 from PR0M3TH3AN/codex/define-design-tokens-and-refactor-css
Add measurement tokens and replace raw sizing literals in CSS
2026-01-13 21:40:16 -05:00
thePR0M3TH3AN 990c7f1695 Add measurement tokens for layout and media sizing 2026-01-13 21:37:54 -05:00
thePR0M3TH3AN a85f915ead Merge pull request #1209 from PR0M3TH3AN/codex/add-and-use-breakpoint-token-and-helpers
Add --breakpoint-lg token and helpers for media-query usage
2026-01-13 21:29:15 -05:00
thePR0M3TH3AN 06c3d9a978 Add breakpoint token helpers for media queries 2026-01-13 21:26:53 -05:00
thePR0M3TH3AN 8f687e2eb1 Merge pull request #1208 from PR0M3TH3AN/codex/refactor-inline-styles-to-use-css-classes
Use design tokens for moderation fixtures styling
2026-01-13 21:20:36 -05:00
thePR0M3TH3AN a79503937e Use tokens for moderation fixtures styling 2026-01-13 21:19:08 -05:00
thePR0M3TH3AN 7719815d78 Merge pull request #1207 from PR0M3TH3AN/codex/audit-and-refactor-.style-usages
Replace inline .style usage with CSS classes/variables and stylesheet-driven state
2026-01-13 21:15:16 -05:00
thePR0M3TH3AN b48edbb055 Refactor inline styles to CSS rules 2026-01-13 21:13:32 -05:00
thePR0M3TH3AN f80002b573 Merge pull request #1206 from PR0M3TH3AN/codex/refactor-theme-synchronization-in-iframe_forms
Refactor iframe theme accent sync to use computed styles & data-attributes
2026-01-13 20:50:23 -05:00
thePR0M3TH3AN a697a1de5f Refactor iframe theme accent sync 2026-01-13 20:48:05 -05:00