feat: video history panel#4
Merged
Merged
Conversation
- Keep last 5 generated videos in memory (blob URLs + metadata) - Horizontally scrollable thumbnail strip below video - Click history item to replay that video - Active item highlighted, auto-cleanup of old blob URLs
There was a problem hiding this comment.
Pull request overview
Adds a client-side “视频历史记录” panel to the web UI so users can quickly replay previously generated videos, while attempting to manage blob URL lifetime to avoid leaks.
Changes:
- Introduces a new history panel UI (HTML + CSS) with a horizontally scrollable list of thumbnails.
- Tracks the last 5 generated videos in
static/app.jsand allows click-to-replay with an “active” highlight. - Bumps static asset cache-busting query params (
?v=12).
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 5 comments.
| File | Description |
|---|---|
| static/style.css | Adds styling for the history panel/list/items and adjusts mobile max-width rules. |
| static/index.html | Adds the history panel DOM container and bumps asset version query params. |
| static/app.js | Implements in-memory history tracking, rendering, and click-to-replay logic. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| timeBadge.classList.remove("hidden"); | ||
| $("#download-btn").classList.remove("hidden"); | ||
|
|
||
| addToHistory(url, avatarData[selectedAvatar]?.name || selectedAvatar, spokenText); |
Comment on lines
+340
to
+343
| if (videoHistory.length > MAX_HISTORY) { | ||
| const removed = videoHistory.pop(); | ||
| URL.revokeObjectURL(removed.url); | ||
| } |
Comment on lines
+360
to
+363
| el.innerHTML = ` | ||
| <video src="${item.url}" muted preload="metadata"></video> | ||
| <div class="history-meta">${item.characterName} ${item.timestamp}</div> | ||
| `; |
| } | ||
| panel.classList.remove("hidden"); | ||
| list.innerHTML = ""; | ||
| videoHistory.forEach((item, idx) => { |
Comment on lines
+358
to
+365
| const el = document.createElement("div"); | ||
| el.className = "history-item" + (item.url === currentVideoUrl ? " active" : ""); | ||
| el.innerHTML = ` | ||
| <video src="${item.url}" muted preload="metadata"></video> | ||
| <div class="history-meta">${item.characterName} ${item.timestamp}</div> | ||
| `; | ||
| el.addEventListener("click", () => { | ||
| const video = $("#video-player"); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Test plan