Commit Graph
72 Commits
Author SHA1 Message Date
thePR0M3TH3AN e8e2b04de7 fix(nip71): keep upload mirrors in sync 2026-07-26 12:51:00 -04:00
thePR0M3TH3ANandClaude Fable 5 35a50611fe upload: in-modal "Upload destination" storage picker (#44)
The storage summary gains a connection <select> (hidden with fewer than two
connections) listing every configured connection with the default labelled.
Selection is a per-modal override — loadFromStorage re-resolves the summary
and credentials immediately, stale selections fall back to the default, and
the account default stays untouched. Picker logic lives in
uploadModalStorageUnlock.js for UploadModal's file-size budget.

Co-Authored-By: Claude Fable 5 <[email protected]>
2026-07-03 21:24:13 -04:00
thePR0M3TH3ANandClaude Opus 4.8 5466d97544 [ui] Remove NIP-71 authoring sections from upload/edit modals (#58)
bitvid authors kind-30078 and MIRRORS to NIP-71; it never authors NIP-71 directly.
Verified before removing: the My Videos mirror (buildNip71MirrorEvent) derives
everything from the bitvid note itself (duration/dims are auto-captured at upload,
contentWarning comes from the NSFW toggle, imeta is built from the video), and the
only consumer of the form's NIP-71 metadata (publishNip71Video) is gated behind
FEATURE_PUBLISH_NIP71: false — the fields fed a dead path and confused uploaders.

Removed from the upload modal: "NIP-71 Technical" (content warning, duration,
summary + Customize toggle) and the IMETA variant editor. Removed from the edit
modal: kind (21/22) selector, published_at, alt, duration, content warning,
summary, IMETA, text tracks, segments, participants, references. KEPT in both:
hashtags (they feed hashtag feeds, the suggestion chips, and the mirror's t tags)
and the web seeds / torrent (xs) inputs (bitvid-note fields, not NIP-71). All the
JS plumbing is missing-DOM tolerant, so no wiring changes were needed to collect.

Compatibility: existing videos' NIP-71 extras survive a save. EditModal keeps the
video's full stored metadata (storedNip71Metadata) and merges the edited hashtags
into it on submit instead of replacing it with the reduced form's empty output
(t mirror key kept in sync).

Also fixes a latent pre-existing bug the reduction exposed: nip71Edited compared
the submit-side copy AFTER publishedAt normalization (string→timestamp,
delete-empty) against an UN-normalized original, so any video with publishedAt
made every save look "edited". Both sides now share normalizeCollectedNip71.

Tests: +2 in edit-modal-submit-state (stored extras survive a hashtag edit;
untouched save keeps nip71Edited false). Modal/payload/mirror suites green
(39 + 7). Lint + build green.

Co-Authored-By: Claude Opus 4.8 <[email protected]>
2026-07-02 15:18:10 -04:00
thePR0M3TH3ANandClaude Opus 4.8 3df398d7ad [upload] Suggest one-tap hashtag chips from the user's past videos (#45)
The upload modal's Hashtags section now shows chips of the user's most-used past
hashtags ("Reuse a tag from your videos:"). Clicking one adds it to the NIP-71 't'
repeater; already-added chips dim + disable; the row is hidden for users with no
past tags.

- js/utils/hashtagSuggestions.js: pure rankHashtagsByFrequency(videos) — count =
  number of the user's videos using each tag, normalized (case + '#') and deduped
  per video, ranked by count then alphabetically. Reads video.nip71.hashtags, falls
  back to raw event 't' tags minus bitvid's fixed t=video marker.
- app.getUserHashtagSuggestions() sources the user's own videos via
  nostrService.getActiveVideosByAuthors([pubkey]) and ranks them (top 12), injected
  into the modal as getHashtagSuggestions.
- UploadModal renders the chips on open and wires clicks through the existing
  Nip71FormManager (addRepeaterEntry + setFieldValue, dedup via collectRepeaterValues).

Tests: tests/hashtag-suggestions.test.mjs (5 — per-video counting, normalization,
marker exclusion, tie-break + limit, empty input). Lint + build green.

Co-Authored-By: Claude Opus 4.8 <[email protected]>
2026-07-01 20:59:56 -04:00
thePR0M3TH3ANandClaude Opus 4.8 ce7ef9ef2d feat(webseed): upload form accepts multiple web seeds (slice 2/3)
Let uploaders declare a backup origin at creation time so the swarm can keep
streaming when the primary CDN is overloaded.

- upload-modal.html: the single "Web Seed (ws)" input becomes a "Web seeds
  (one per line)" textarea with help text explaining the backup-origin use
  case and the byte-identical-file requirement.
- UploadModal: in upload mode the R2/CDN url stays the primary webseed and any
  textarea entries follow it (passed as [primaryUrl, textarea]); external mode
  already flowed the field through. All parsing stays in the payload layer.
- videoNotePayload.normalizeWebSeedList now splits every entry (array OR
  string) on newlines/commas, so the upload-modal's [url, "a\nb"] shape and a
  plain multi-line string both expand + dedupe correctly.

Mutation-verified (array entries no longer split fails the upload-shape test);
build + full unit suite green. Lints relevant to the change (inline-styles,
tokens, innerHTML) pass.

Note: npm run lint also reports pre-existing file-size violations in unrelated
files (SignerManager, watchHistory, playbackService, webtorrent, etc.) that
grew in earlier commits — none are touched here. Flagging separately.

Co-Authored-By: Claude Opus 4.8 <[email protected]>
2026-06-19 08:36:13 -04:00
google-labs-jules[bot]andPR0M3TH3AN 106f7640c4 fix(exploreData): trigger refresh immediately on visibility change
- `handleVisibility` only scheduled intervals but didn't trigger an immediate refresh when returning to the tab.
- This caused `tests/unit/services/exploreDataService.test.mjs` to fail (assertion `0 !== 1`).
- Added explicit calls to `refreshWatchHistoryTagCounts` and `refreshTagIdf` when `document.hidden` becomes false.

Co-authored-by: PR0M3TH3AN <[email protected]>
2026-02-18 15:10:29 +00:00
google-labs-jules[bot]andPR0M3TH3AN f16a1ff5e4 Content Audit: Fix HTML accepted types and moderation config
Co-authored-by: PR0M3TH3AN <[email protected]>
2026-02-17 22:15:53 +00:00
Claude d0a6c9622b feat: add Playwright agent testability infrastructure
Add test harness (window.__bitvidTest__), data-testid attributes, relay
override support, and Playwright fixtures so agents can programmatically
login, seed relay data, and inspect app state during E2E testing.

- js/testHarness.js: exposes loginWithNsec, getAppState, relay overrides
- data-testid attrs on login/upload/video modals, header buttons, feed
- simple-relay.mjs: HTTP seeding API (POST /seed, GET /events, /health)
- bitvidTestFixture.ts: reusable Playwright fixture with mock relay
- agent-testability.spec.ts: E2E tests validating the infrastructure

https://claude.ai/code/session_01XnrszNmdqrAGd8g8qhAn4G
2026-02-10 05:09:46 +00:00
google-labs-jules[bot] e1324c1bfc Truncate Storage Status fields in Upload Modal
Truncate Provider, Bucket, and URL Style fields to prevent layout overflow.
Add `title` attribute for native tooltips on hover.
Add `tabindex="0"` for keyboard accessibility.
2026-01-25 21:19:42 +00:00
google-labs-jules[bot] 070c054043 Refactor upload flow for immediate uploads and fix logging crash
- Refactored `UploadModal.js` to trigger uploads immediately on file selection.
- Added progress bars and result fields (Video URL, Magnet, Torrent) to the UI.
- Fixed a crash in `r2Service.js` caused by `userLogger.debug` usage.
- Exposed `prepareUpload` and `uploadFile` methods in `r2Service` and `s3UploadService` for granular control.
- Updated `upload-modal.html` with new UI elements.
2026-01-25 20:53:16 +00:00
google-labs-jules[bot] 2062ba0889 Refactor Upload Modal to use read-only storage status
Simplified the Upload Modal by removing inline storage configuration forms.
The modal now displays the active storage provider (read-only) or prompts the user
to configure storage via the Profile Modal if missing.

Changes:
- Refactored `js/ui/components/UploadModal.js` to consume stored credentials directly.
- Updated `components/upload-modal.html` to remove complex forms.
- Updated `tests/ui/uploadModal-integration.test.mjs` to match new UI structure.
- Removed race-prone logic for saving credentials within the upload flow.
2026-01-25 19:20:08 +00:00
google-labs-jules[bot] a33092fc47 feat(upload): support presigned multipart manifest for S3 uploads
- Updated `js/s3-quick.js` to support new manifest structure: `{ bucket, key, uploadId, parts: [{partNumber, url}] }`.
- Added logic to sort parts, upload chunks, collect ETags, and call `completeUrl` if present.
- Updated `js/ui/components/UploadModal.js` to handle manifest flow, validate new structure, and alert user if completion is manual (missing `completeUrl`).
- Updated `components/upload-modal.html` with new placeholder example and documentation note.
- Verified logic with reproduction script and UI with Playwright.
2026-01-25 02:44:49 +00:00
google-labs-jules[bot] adad6a07a4 feat: Add S3 quick upload with presigned manifest support
- Add `js/s3-quick.js` with `uploadWithManifest` and `uploadWithKeys`.
- Update `components/upload-modal.html` to add "Use presigned manifest" toggle and warning.
- Update `js/ui/components/UploadModal.js` to wire up the manifest upload flow.
- Add local persistence for quick S3 settings (though mainly handled by existing storage settings).
- Ensure keys are only used for client-side uploads or replaced by manifest flow.
2026-01-25 01:38:41 +00:00
thePR0M3TH3AN 999235d71e Add S3 storage option to upload modal 2026-01-24 20:00:00 -05:00
google-labs-jules[bot] f75531d2db chore(ai): format sources and fix moderation bugs (agent)
- Format `css/tailwind.source.css` with Prettier.
- Add allowlist entry for `VideoCard.js` media query pixel value in `scripts/check-design-tokens.mjs`.
- Remove accidental artifact `js/ui/dm/jules_session_4520373547615093905.zip`.
- Fix bug in `js/app.js` and `js/services/moderationActionController.js` where blocked users' videos were not correctly hidden in the UI immediately after blocking.
- Fix bug in `tests/app/moderation-overrides.test.mjs` where `userBlocks` mocks were insufficient to reflect state changes.
2026-01-22 14:58:35 +00:00
google-labs-jules[bot] 69e81920ce Add Playwright automation aids for disclaimer and modals
- Added `data-testid` attributes to key modals (Disclaimer, Login, Upload, Video, Profile, Lockdown) to facilitate reliable selection in Playwright tests.
- Updated `js/disclaimer.js` and `js/index.js` to respect a new `playwright-bypass-disclaimer` localStorage flag, allowing automated tests to skip the disclaimer modal entirely.
2026-01-22 05:18:36 +00:00
google-labs-jules[bot] 2b446e8ddd Refactor upload modal for generic storage and read-only config
- Updates Upload Modal UI labels to be provider-agnostic (e.g., 'Storage Credentials', 'Endpoint').
- Implements a read-only 'Summary View' for configured storage connections, collapsing the editable form by default.
- Adds 'Manage Storage' button that navigates to the Profile Modal's storage pane.
- Updates `initUploadModal.js` to inject the navigation callback.
- Updates `r2Service.js` status messages to be generic.
- Fixes unlock flow to ensure UI updates after storage unlock.
2026-01-16 15:44:22 +00:00
google-labs-jules[bot] cf9d1c08be Refactor UploadModal to use StorageService for secure R2 credentials 2026-01-16 02:35:00 +00:00
thePR0M3TH3AN a3374f0569 Guard upload when info hash is unavailable 2026-01-14 21:38:27 -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
google-labs-jules[bot] a0ef54434a Implement 2-step wizard for R2 credentials with public access verification
- Added `deleteObject` to `js/storage/r2-s3.js` for cleanup.
- Added `verifyPublicAccess` to `js/services/r2Service.js` to test bucket configuration.
- Refactored `components/upload-modal.html` to support wizard steps.
- Updated `js/ui/components/UploadModal.js` to manage wizard state and trigger verification.
2026-01-12 20:16:30 +00:00
google-labs-jules[bot] f45f027a56 Refine R2 upload UX with bucket auto-creation attempt and clearer guidance
- Updated `R2Service` to attempt bucket creation via S3 API (`ensureBucketExists`) before upload. This improves the UX for users with Admin keys or custom domains while gracefully failing (with a warning) for users with minimal permissions.
- Modified `UploadModal` helper text to explicitly instruct users about enabling "Public Access" in the Cloudflare dashboard for new buckets.
- Updated `js/r2.js` to ensure the "Public Bucket URL" is always sanitized to include the `https://` protocol, fixing potential webseed generation issues.
2026-01-12 19:40:07 +00:00
google-labs-jules[bot] 7dc2977cf2 Update Cloudflare R2 upload to use minimal permissions and add progress bar
- Removed requirement for Cloudflare API Token, Zone ID, and Worker Token from Upload Modal and R2Service.
- Simplified R2 configuration to require only Account ID, S3 Access Keys, and a user-provided Public Bucket URL.
- Added a read-only field in Upload Modal displaying the derived target bucket name (npub-based) for user reference.
- Implemented client-side torrent info hash calculation using `WebTorrent` (via `js/utils/torrentHash.js`) to generate magnet links before upload.
- Added a visual upload progress bar to the Upload Modal.
- Updated `js/r2.js` to ensure the Public Bucket URL always includes the `https://` protocol.
2026-01-12 18:53:22 +00:00
google-labs-jules[bot] 66bfc3c395 Refactor 'Learn How' button in Upload Modal to an inline link that auto-closes the modal.
- Replaced the button with a simple text link (`<a id="link-r2-help">`) inside the R2 credentials section.
- Added a click event listener in `UploadModal.js` to call `this.close()` when the link is clicked, allowing users to navigate to the setup guide without obstruction.
2026-01-09 19:09:45 +00:00
google-labs-jules[bot] dc6daa07f7 Add "Upload Content" guide, sidebar link, and improved modal button
- Create `assets/svg/upload-content-icon.svg`
- Create `content/upload-content.md` with Cloudflare R2 setup instructions
- Create `views/upload-content.html` to render the guide
- Add "Upload Content" link to `components/sidebar.html`
- Add styled "Learn How" button to `components/upload-modal.html` in the R2 credentials section
2026-01-09 03:39:05 +00:00
google-labs-jules[bot] cd38fd0c2a Add "Upload Content" guide and link in Upload Modal
- Create `assets/svg/upload-content-icon.svg`
- Create `content/upload-content.md` with Cloudflare R2 setup instructions
- Create `views/upload-content.html` to render the guide
- Add "Learn How" link to `components/upload-modal.html` in the R2 credentials section
2026-01-09 03:31:00 +00:00
google-labs-jules[bot] 44aed00b5e Add thumbnail upload support to UploadModal and R2Service
- Added file input and browse button for thumbnails in `upload-modal.html`.
- Updated `UploadModal.js` to handle thumbnail file selection and UI toggling.
- Updated `r2Service.js` to upload thumbnail file (if present) to R2 and update metadata.
- Ensured thumbnail keys are derived from video keys for consistent naming.
2026-01-09 03:03:35 +00:00
google-labs-jules[bot] caca630c66 Refactor Upload Modal to Unified UI
- Replaces split "Custom" vs "Cloudflare" forms with a single unified form
- Implements source switching between "Upload File" and "External Link"
- Consolidates NIP-71 advanced fields into a single collapsible section
- Moves R2 storage configuration to a dedicated, collapsible settings block
- Improves responsiveness and modernizes the UI layout
- Updates internal JS logic to handle unified form submission and validation
2026-01-08 14:27:36 +00:00
thePR0M3TH3AN 5045f2a0cb Merge pull request #1147 from PR0M3TH3AN/feat/r2-webtorrent-integration-8330031922940880613
feat: add client-side R2 to WebTorrent generation flow
2026-01-08 08:59:47 -05:00
google-labs-jules[bot] 9028f77464 feat: add client-side R2 to WebTorrent generation flow
Integrates WebTorrent client-side seeding into the Cloudflare R2 upload path.
- Adds `uploadFile` to `r2Service` for generic file uploads.
- Updates `UploadModal` to offer an optional "Create torrent & seed" flow.
- Generates magnet links and .torrent files in the browser after R2 upload.
- Uploads the .torrent file to R2 and populates `xs` tag.
- Populates `ws` (Web Seed) with the R2 public URL.
- Adds UI progress indicators for hashing and torrent upload.
- Enforces a 2GB file size limit for browser seeding to prevent crashes.
- Adds a mandatory legal rights confirmation checkbox for R2 uploads.
2026-01-08 13:50:53 +00:00
google-labs-jules[bot] e2acdd6b12 fix(ui): use flex layout in UploadModal to fix advanced options overflow
- Converted .modal-sheet to flex flex-col to support dynamic content
- Added flex-1 min-h-0 to .modal-body to ensure proper scrolling
- Removed fixed max-height constraints that clipped expanded content
2026-01-08 04:28:53 +00:00
thePR0M3TH3AN 99e2c60e52 Make upload modal body scrollable 2026-01-07 23:05:37 -05:00
google-labs-jules[bot] c85d129b56 Streamline upload modal form fields and logic
- Rename "Legacy description" to "Video description"
- Group technical NIP-71 fields (Event Type, IMETA, Tracks, Segments) into a hidden "Advanced Options" section
- Automate "Summary" field to mirror "Video description" by default (with unlock toggle)
- Automate "Web seed" field to mirror "Hosted video URL"
- Automate "Content Warning" based on NSFW toggle status
- Maintain visibility of Hashtags in the main form flow
- Apply changes consistently to both Custom and Cloudflare R2 upload modes
2026-01-08 02:52:48 +00:00
thePR0M3TH3AN 796b6c9ae6 Support per-variant duration and bitrate in NIP-71 metadata 2025-10-29 17:06:19 -04:00
thePR0M3TH3AN 316a542277 Align modal close buttons with sidebar styling 2025-10-17 11:03:21 -04:00
thePR0M3TH3AN 74874ccc28 Fix modal scroll handling and backdrop styling 2025-10-15 20:23:13 -04:00
thePR0M3TH3AN e767316501 feat: add semantic color palette and lint guard 2025-10-14 15:18:02 -04:00
thePR0M3TH3AN fc095e9796 Add semantic tokens and utilities for modal typography 2025-10-14 14:54:01 -04:00
thePR0M3TH3AN 11b30b3a14 Refactor progress meters to semantic components 2025-10-14 07:07:02 -04:00
thePR0M3TH3AN 92794d47dc refactor: centralize styling system usage 2025-10-12 16:31:13 -04:00
thePR0M3TH3AN 3f1238b5a9 Remove legacy CSS and enable design system by default 2025-10-12 06:58:50 -04:00
thePR0M3TH3AN 8265f9e2de Add design system feature flag and runtime integration 2025-10-11 16:11:43 -04:00
thePR0M3TH3AN a4e75392af Refine modal primitives for auth and zap flows 2025-10-10 22:40:55 -04:00
thePR0M3TH3AN a8cb21d20c Refactor modal styles to tokenized palette 2025-10-10 22:26:19 -04:00
thePR0M3TH3AN 5f3209b410 Refactor legacy modals to shared primitives 2025-10-10 21:49:49 -04:00
thePR0M3TH3AN 83496c653e Improve accessibility semantics for modals 2025-10-10 18:52:55 -04:00
thePR0M3TH3AN 6302e007b8 Align form component spacing with shared utilities 2025-10-10 18:35:56 -04:00
thePR0M3TH3AN 0bea3d83cd Align modal form groups with design system containers 2025-10-10 16:35:46 -04:00
thePR0M3TH3AN d3da77a869 refactor: apply shared form control classes 2025-10-10 16:22:39 -04:00
thePR0M3TH3AN 3b14de35da chore: adopt gpl licensing and lowercase bitvid 2025-10-10 12:56:46 -04:00