Skip to content

Delete video url#1023

Merged
LeviXIII merged 14 commits into
mainfrom
delete-video-url
Jun 5, 2026
Merged

Delete video url#1023
LeviXIII merged 14 commits into
mainfrom
delete-video-url

Conversation

@TimRl
Copy link
Copy Markdown
Contributor

@TimRl TimRl commented Jun 3, 2026

Delete video url
Format: #1001

Project: 1023-delete-video-url

Summary

Allow video to be temporarily stored (all media download strategies except for auto-download) as well as permanently stored (all media download strategies)

Changes

Added a delete video and it also clears the file, allows for users to "save" in stream only to avoid redownloading a video file every time as well as allows for streaming in stream only and you can clear the video in stream only as well as stream and save to not have to store videos that were needed for in the past.

Testing Checklist

Edit Metadata modal — draft & save semantics

  • Edit a field (font size / direction / corpus marker), click Cancel or X → change is not saved (reopen confirms old value).
  • Edit a field, click Save Changes → change persists after reload.
  • With a local video set, click Clear, then Cancel/X → video intact; local file not deleted; player still works.
  • Click Clear, then Save Changes → reference removed, local file deleted, "Show Video" toggle disappears, player closes.
  • Clear a URL video + Save → reference removed, nothing deleted.
  • "File missing" badge shows when the local file is gone but the reference remains.

Edit Metadata modal — video file size

  • A downloaded/local video shows its file size (base-1000, e.g. 841 MB) matching the file on disk.
  • Pointer-only (not downloaded) video shows the size from the LFS pointer.
  • URL video shows no size row.

Modal responsiveness

  • Narrow window: modal fits with side margins; long URL truncates; Clear / Free up space buttons not cut off (wrap if needed).
  • Expanding the window does not make the modal shrink unexpectedly.

Video size limit

  • A video up to 1.5 GB is accepted (previously 900 MB); over 1.5 GB is rejected with a clear message.

Navigation card — video icon & badge states

  • A document referencing a video shows a video icon (URL or file based).
  • Globe → remote URL ("Web video").
  • Checkdownloaded/saved (shows size).
  • Down arrowavailable to download / stream on demand (pointer, not loaded; shows size).
  • Cloudloaded (temporary) this session ("cleared on reload"; shows size).
  • VideoOff → reference present but file missing.
  • In auto-download, a not-downloaded pointer shows a muted, status-only down arrow (no click action).

Navigation card — click actions

  • stream-only / stream-and-save, click a down-arrow video → prompt offers Load video / Save to project / Cancel.
  • Load video → caches for this session only; badge flips to cloud immediately.
  • Save to project (not yet loaded) → downloads to files/; badge flips to check immediately.
  • Click a cloud (already-loaded) video → prompt offers only Save to project / Cancel (no "Load video"); moves the cached copy into the project (no re-download); badge flips to check.
  • Click a check (downloaded) video → Free up space confirmation → reverts to pointer; badge updates immediately.
  • Cancelling any prompt makes no changes and clears the card spinner.
  • In auto-download, card download/free actions are disabled.
  • While an action runs, the card icon shows a spinner and is not clickable; spinner clears on completion/cancel/error.

Navigation card — live updates from other sources (no manual refresh)

  • Downloading / freeing / saving a video from the editor updates the matching card badge.
  • A sync that pointerizes videos updates the affected cards.
  • Switching media strategy re-evaluates card actions/badges.

Card ↔ editor live sync

  • With a chapter open in the editor, click Load video on its card → editor shows "Loading video…", then plays from the session cache (no manual "Load" in the editor).
  • Click Save to project on the card → editor shows loading, then plays from the saved project copy (including the fresh-download case).
  • Free up space from the card → editor reverts to the "Streaming mode" placeholder.
  • Open Show Video while a card load/save is already running → editor shows the loading state (in-flight check), then plays when done.
  • Only the editor showing that exact video reacts; unrelated open editors are not disturbed.

Stream-only add prompt (pick a local file in the modal)

  • In stream-only, pick a local video → prompt "Save this video to the project?" appears.
  • Save to project → file stays in files/, survives reload and sync (not pointerized).
  • Stream only → plays now; pointerizes after sync; re-streams after reload.
  • Dismiss/Escape → behaves as Stream only.
  • In auto-download / stream-and-saveno prompt.
  • Enter a URL (not a file) → no prompt; streams directly.

Session disk cache on sync (stream-only)

  • Add a "Stream only" video, syncfiles/ becomes a pointer (space freed), but the video still plays this session with no re-download.
  • Reload the window → video re-streams (session cache cleared); not stored in the project.
  • The cached copy lives under the extension's global storage, outside the project tree.

"Free up space" (Edit Metadata modal button)

  • stream-and-save: download a video → Free up space appears → confirm → file reverts to pointer, reference kept, download overlay returns, disk freed.
  • stream-only + Save to project: same, and the file is removed from the persisted allowlist (re-streams / gone after reload).
  • Button appears in all three save paths without reload: pick + Save to project; after a sync uploads the video; "Show video" → Save video overlay.
  • Button not shown for: auto-download, stream-only session "Load" copy, URL videos, an unsynced local file (before first sync), or no video.
  • After freeing space, the video can be re-streamed / re-downloaded normally.

Media strategy switching — preservation & prompts

  • Switching to a less restrictive mode (stream-only → stream-and-save / → auto-download; stream-and-save → auto-download) preserves existing local audio/video.
  • auto-download → stream-and-save: if videos exist, prompt offers Keep Both / Keep Video Only / Keep Audio Only / Free All; if no videos, the usual audio-only prompt.
  • → stream-only with local videos: prompt offers to keep video only (audio is never kept, except unsynced recordings) and reports the count of synced, deletable audio files to be removed.
  • stream-and-save → stream-only: prompt asks whether to preserve videos.
  • Unsynced local audio/video is never erased on a switch.
  • Synced media is removed when moving to a more restrictive mode (e.g. auto-download → stream-only).
  • Video counts are accurate (audio/.webm not counted as video).
  • Picking a strategy option but not completing the switch, then choosing a different target, behaves as if only the new target was chosen (no stale input).
  • A video with real bytes already in files/ plays without re-downloading (no false "needs download").

Regression / cross-cutting

  • Remote URL videos still stream and play normally.
  • "Show Video" toggle is hidden when there's no usable reference (no URL/local).
  • Audio attachments unaffected (in-memory cache; play/record works after sync).
  • auto-download projects behave as before (files kept, no prompts, no Free up space).
  • Robust LFS upload: large/multiple videos sync without timing out on slow links; uploads retry/resume and report progress.

LeviXIII and others added 9 commits May 27, 2026 16:17
- Implemented a video stream cache to manage large videos outside the project directory, ensuring they do not pollute the project structure.
- Added functionality to clear the video stream cache on extension activation for seamless re-streaming of previously loaded videos.
- Updated video file handling to allow for user-initiated clean-up of media files, protecting user-saved videos from being reverted to pointers.
- Introduced confirmation prompts for replacing or deleting local video files to prevent accidental data loss.
- Enhanced the video player and editor components to handle video availability states and requests for playable URLs more effectively.
@TimRl TimRl self-assigned this Jun 3, 2026
@TimRl TimRl linked an issue Jun 3, 2026 that may be closed by this pull request
@TimRl
Copy link
Copy Markdown
Contributor Author

TimRl commented Jun 3, 2026

/build

@github-actions
Copy link
Copy Markdown

github-actions Bot commented Jun 3, 2026

@TimRl
Copy link
Copy Markdown
Contributor Author

TimRl commented Jun 3, 2026

/build

@github-actions
Copy link
Copy Markdown

github-actions Bot commented Jun 3, 2026

TimRl added 4 commits June 4, 2026 11:08
…t switch and more granular preserving of either audio or video depending on the context.
…everything, updated notifications, the video reflects the status from the cards and it's just overall more robust
@TimRl
Copy link
Copy Markdown
Contributor Author

TimRl commented Jun 5, 2026

/build

@github-actions
Copy link
Copy Markdown

github-actions Bot commented Jun 5, 2026

@LeviXIII LeviXIII merged commit 5123f7f into main Jun 5, 2026
3 checks passed
@LeviXIII LeviXIII deleted the delete-video-url branch June 5, 2026 15:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

We need a dedicated delete button for removing video urls

2 participants