Commit Graph
22 Commits
Author SHA1 Message Date
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 c8a63c57c6 feat(edit): thumbnail + video file upload in Edit modal (steps 2-3/3)
Brings the Edit modal to upload parity with the Upload modal: re-upload a
thumbnail or video file instead of only pasting URLs.

- Wire storage services (r2/s3/storageService) + pubkey/npub accessors into
  EditModal via ModalManager/initEditModal; EditModal constructs a shared
  MediaUploader.
- New editModalUpload.js holds all the upload glue (file-picker wiring, progress,
  storage-unlock checks, field write-back) to keep EditModal under its file-size
  budget. EditModal calls initEditModalUpload(this, context) in one line.
- edit-video-modal.html: "Replace video file…" (under the URL field) and
  "Replace thumbnail file…" (under the thumbnail field), each with a hidden file
  input + status line.
- On thumbnail upload: writes the new URL into the thumbnail field. On video
  upload: writes url + magnet (+ ws/xs hints). All written via setFieldUnlocked,
  which marks the field edited so EditModal.collect actually persists it (gated
  behind storage being configured + unlocked).

setFieldUnlocked is unit-tested (mutation-verified): without the unlock, the
re-upload would silently not save. Build + full lint + unit suite green.

NOTE: the upload/storage flow itself can't be unit-tested (browser + R2/S3);
pending manual verification of editing a video's thumbnail/file.

Co-Authored-By: Claude Opus 4.8 <[email protected]>
2026-06-20 09:09:07 -04:00
thePR0M3TH3ANandClaude Opus 4.8 c62114557c feat(webseed): manage multiple web seeds in the edit modal (slice 3/3)
Completes end-to-end multi-webseed support: the editor can now see, add, and
remove every web seed a video carries.

- magnetShared: promote normalizeWebSeedList to a shared export (videoNotePayload
  now imports it) and add setMagnetWebSeeds(), which replaces a magnet's COMPLETE
  ws= set with exactly the requested list. ensureWebSeeds is append-only, so
  without set-semantics a webseed a user deleted would linger in the magnet;
  setMagnetWebSeeds strips the existing ws= params first, making removal stick.
- edit-video-modal.html: the single "Web seed (ws=)" input becomes a "Web seeds
  (one per line)" textarea with backup-origin help text.
- EditModal: open() populates the field from extractAllWebSeeds() (every seed,
  not just the first). On save, when the field was manually edited the magnet's
  ws set is rebuilt from the field via setMagnetWebSeeds (true add/remove);
  otherwise existing seeds are preserved untouched. The content `ws` field still
  stores the primary (first) seed while the magnet carries the full set.

Mutation-verified (no-strip and no-add both fail the removal/add tests); build,
relevant lints (inline-styles, tokens, innerHTML), and full unit suite green.

Co-Authored-By: Claude Opus 4.8 <[email protected]>
2026-06-19 08:52:11 -04:00
thePR0M3TH3AN 796b6c9ae6 Support per-variant duration and bitrate in NIP-71 metadata 2025-10-29 17:06:19 -04:00
thePR0M3TH3AN b8566b3068 Align modal sizing and mobile behavior 2025-10-15 20:47:36 -04:00
thePR0M3TH3AN 75d185a294 Refine modal markup to use canonical primitives 2025-10-14 20:30:19 -04:00
thePR0M3TH3AN fc095e9796 Add semantic tokens and utilities for modal typography 2025-10-14 14:54:01 -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 a8cb21d20c Refactor modal styles to tokenized palette 2025-10-10 22:26:19 -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 35a041d1be Refine profile and edit modals with design system tokens 2025-10-10 12:16:22 -04:00
thePR0M3TH3AN 12c25f77ee Refactor profile and edit video modals to use base modal primitives 2025-10-10 11:40:39 -04:00
thePR0M3TH3AN dd8b0b9907 Add NSFW and kids toggles to edit modal 2025-10-09 22:10:46 -04:00
thePR0M3TH3AN 0ec2d48142 Sanitize NIP-71 hashtag inputs 2025-10-08 16:39:30 -04:00
thePR0M3TH3AN 073b62459a Align NIP-71 tags legends inside modal panels 2025-10-08 15:17:44 -04:00
thePR0M3TH3AN cb18615c1b Refactor NIP-71 form handling and update edit modal 2025-10-08 12:20:27 -04:00
thePR0M3TH3AN fb07d706b1 Add visibility toggle to edit modal 2025-10-08 10:07:19 -04:00
thePR0M3TH3AN c851abc989 Add comment toggle and magnet hint editing to video forms 2025-09-27 22:39:25 -04:00
thePR0M3TH3AN 1b4bf696b7 Add modal-driven video edit flow 2025-09-27 21:28:20 -04:00