Sidepanel review feedback: leaks, races, dedup#7
Open
huyqnguyen-it wants to merge 13 commits into
Open
Conversation
Hide the "add note" text box when switching to Screenshots, History, and Export tabs in the side panel. The note bar now only appears on the Live Feed tab when actively recording.
Added Start/Stop recording button with visual state indicators: - "Record" button (red) displayed when idle - "Stop" button (gray) displayed when recording - State automatically syncs with recording session
Add capture button (📸) in note bar during recording. Screenshot events now display clickable thumbnail previews that open the annotator. Visual styling includes blue highlight for screenshot event items in the feed.
- Replace sort toggle with auto-scroll and pause button - Sync screenshot previews between Live Feed and Screenshots tab using shared cache - Fix note-bar appearing on non-feed tabs during recording - Add error handling to record/capture button handlers - Fix auto-scroll targeting wrong element (#feed → #tab-feed) - Change feed capture button from emoji to text label
…pdates - Capture request/response body for all network requests (fetch and XHR) - Add redaction for request body sensitive data - Add "Include req/res body" export option (default off) - Make feed items expandable on click to show full details - Add Pretty/Raw toggle and Copy buttons for JSON body content - Switch feed updates from polling to event-driven via chrome.storage.onChanged - Add lightweight session state polling (5s) separate from feed rendering - Fix renderBodyBlock to always return DOM element - Export markdown includes request/response body when enabled
- Remove 5s polling interval in sidepanel; now event-driven via chrome.storage.onChanged - Add session:flush handler in service worker for on-demand buffer flush - Implement 500ms debounced flush for faster feed appearance
- Always include req/res body in network exports (removed networkBody filter gate) - Removed duplicate "Include req/res body" checkbox from export options - Quick Copy now uses export filter checkboxes instead of hardcoded filters - Notes flush immediately for instant feed appearance - Debounced 500ms flush for faster event feed updates
- Implement video capture using chrome.tabCapture - Rename Screenshots tab/filter to Media (images + videos) - Add inline video player with Open and Download buttons - Export videos in ZIP, JSON, and Markdown reports - Fix race condition: refresh cache before event write for preview - Fix video loss: defer stream cleanup until after onstop handler - Fix video storage: write to chrome.storage (bypass buffer) - Disable Add Note button when input empty - Show "Record first" on video button when no active session
Video onstop handler was reading all storage as a stale snapshot then writing back, overwriting events flushed concurrently by the service worker. Now sends video events through the buffer first, with a fresh- read fallback. Also switched loadFeed to read media directly from IndexedDB so video blobs survive (message passing strips them).
Match screenshot behavior — clicking video thumbnail opens a popup player instead of expanding inline details. Removed inline controls and added hover/cursor styles consistent with screenshot thumbnails.
- Track object URLs with separate feed/gallery lists and revoke on re-render to stop the blob URL leak when sessions are switched or the gallery redraws. - Add a beforeunload handler that stops the tab capture stream and revokes tracked URLs so closing the sidepanel mid-recording no longer leaks MediaStream tracks. - Cross-reference the duplicated IndexedDB schema between sidepanel.js openMediaDB() and lib/storage.js so future version bumps stay in sync; add a TODO for the sessionId index. - Only fall back to a direct chrome.storage write when the service worker is genuinely unreachable, eliminating the race with flushBuffer when a video save lands after session:stop. - Replace the knownEventCount counter with a knownEventIds Set keyed by timestamp:type so the onChanged listener can dedupe duplicates instead of drifting against the event buffer. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
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.
Single-commit PR covering the six fixes from the review feedback.
Summary
<video src=\"blob:…\">elements.sidepanel.js:openMediaDBandlib/storage.jsso future version bumps stay in sync; TODO for thesessionIdindex.chrome.storagefallback on video save only triggers when the service worker is genuinely unreachable, eliminating theflushBufferrace.knownEventCountcounter replaced with aknownEventIdsSet keyed bytimestamp:type, so theonChangedlistener skips duplicates instead of drifting.getMediaFromDBfull-table-scan improvement — left as a TODO since the index requires a coordinated DB version bump.Scope note
A previous PR (#6) stacked additional enhancement work on top of these fixes — persistent capture stream, tab-close auto-stop, toast system, recording-target bar, URL clamping. That PR is closed. The enhancement work continues on branch
feat/sidepanel-capture-enhancementsand will land in a follow-up PR once it stabilizes.Test plan
🤖 Generated with Claude Code