- Scanned repo for TODO/FIXME/XXX.
- Found no trivial TODOs in JS sources.
- Found non-trivial TODOs in `tests/visual/moderation.spec.ts` related to headless test environment issues.
- Generated `artifacts/todos.txt` with the findings (filtering out false positives).
- Generated `artifacts/issues.md` with issue drafts for the identified non-trivial TODOs.
This fixes a layout issue in the embed player where the body height would collapse to the default video height (150px) because `h-screen` and other utility classes were missing from the generated CSS. Adding `embed.html` to `tailwind.config.cjs` ensures these classes are generated.
Enforce full-width/height video display and dynamic object-fit logic to prevent letterboxing and layout gaps.
- Add robust CSS overrides to 'css/tailwind.source.css' to ensure video fills the stage.
- Update 'VideoModal.js' to dynamically switch between 'cover' and 'contain' based on aspect ratio match.
- Handle ambient canvas positioning to prevent layout shifts.
- 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.
- Update `scripts/agent/review-pr.mjs` to use `runCommand` wrapper for all command executions.
- Increase `maxBuffer` to 10MB to prevent crashes during large test/lint outputs.
- Ensure consistent logging and option handling.
- Add `bg-transparent` to `#embedVideo` to fix visual gap/letterboxing issues.
- Inline the BitVid logo SVG in `embed.html` and use `bv-logo` class with `data-variant="inverse"` to ensure correct white wordmark and themed accent color on the dark overlay.
- Remove black background from embed video to allow transparency
- Update "Watch on Bitvid" button to "Watch on" + white logo
- Fix share URL generation to point to main site instead of embed
- Ensure view counts and reactions are subscribed in embed mode
- Removed background colors from `embed.html` for transparency.
- Added a hover-triggered overlay with "Watch on BitVid" button and stats (views, likes, dislikes).
- Updated `js/ui/components/EmbedPlayerModal.js` to implement stats update methods and handle the overlay elements.
- Updated `js/embed.js` to set the share URL on the overlay after video resolution.
- Verified visual changes with Playwright.
This commit instruments the embed runtime to forward structured logs and lifecycle events
(Nostr, relay, pointer resolution, playback decision, WebTorrent) to the parent window
via `postMessage` when the `embed_debug=1` query parameter is present.
It also adds a defensive guard to `resetTorrentStats` in `js/app.js` to prevent TypeErrors.
Changes:
- Added `js/embedDiagnostics.js` module.
- Modified `js/embed.js` to initialize diagnostics and instrument startup.
- Modified `js/app.js` to instrument playback fallback and patch `resetTorrentStats`.
- Modified `js/webtorrent.js` to instrument peer probing and streaming.
- 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`.
- Fix `TypeError: this.videoModal.resetStats is not a function` by implementing `resetStats` (no-op) in `EmbedVideoModal` and adding a safety guard in `Application.resetTorrentStats`.
- Prevent duplicate `NostrClient` initialization within the same frame by adding idempotent guards in `js/embed.js` and `js/nostr/client.js`.
- Add documentation (`docs/embed-notes.md`) on embed architecture and recommendations for multi-frame resource sharing (SharedWorker).
- Add regression test `tests/embed_playback_check.spec.mjs`.
This commit ensures the existence and correctness of `scripts/agent/smoke-test.mjs`, a Playwright-based regression test suite.
The script:
- Starts a local web server (npx serve) and a local relay (simple-relay.mjs).
- Launches a headless browser to interact with the application.
- Verifies key flows:
- Ephemeral login.
- Video publishing (Kind 30078).
- Direct Message (DM) sending and decryption (Kind 4/1059).
- Generates execution logs and summaries in `artifacts/`.
Also ensures `scripts/agent/simple-relay.mjs` is present as a dependency.
Refactored `EmbedVideoModal.js` to unwrap the fetched HTML content using a `DocumentFragment` before appending it to the DOM. This removes an unnecessary wrapper `div` that was causing stacking context issues, preventing the modal's buttons (Exit, Close, Copy) from being clickable when layered over other UI elements. This change aligns the implementation with `VideoModal.js`.
- Adds --z-modal-always-top: 200 token in css/tokens.css
- Adds .modal-always-on-top utility class in css/tailwind.source.css
- Applies class to EventDetailsModal, EmbedVideoModal, and ShareNostrModal