Repository navigation
Tab hover card: page snapshot thumbnails - #33
Merged
Merged
Conversation
Hovering a tab now shows a quick visual snapshot of its page at the top of the hover card, like macOS tab previews. A new TabThumbnailFetcher (cloned from the description fetcher's CDP harness) issues Page.captureScreenshot; since background tabs are detached and hidden, the workhorse capture happens at switch-away time while the outgoing tab's compositor surface still holds the on-screen frame, refreshed on load-complete and hover for visible tabs. Shots are decoded and downscaled off-main (512px cap), cached on the pill like pageDescription, and cleared on navigation. The card's snapshot band is aspect-fill center-cropped (portrait mobile-emulation captures stay undistorted) and live-fills with the existing re-spring idiom; blank tabs keep their "Ask anything…" card unchanged. Co-Authored-By: Claude Fable 5 <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.
What
Hovering a tab pill now shows a quick visual snapshot of the page at the top of the hover card — like macOS tab previews — above the existing title / host / description / pin+split row. Blank "New Tab" tabs keep their current "Ask anything…" card with no image band.
How
TabThumbnailFetcher(src/tab_thumbnail_fetcher.cc/h): clone of theTabDescriptionFetcherCDP harness, issuingPage.captureScreenshot(JPEG, quality 70). Results route through the existingBroHandler::OnDevToolsMethodResultobserver; both fetchers filter by their own pending message id.WasHidden(true), so they produce no frames):SetActiveBrowser, while the outgoing tab's compositor surface still holds the on-screen frame (the workhorse);OnTabThumbnailAvailable(bro_mac.mm) via ImageIO with a 512px cap (~1MB/tab worst case); theNSImagecaches on the pill likepageDescriptionand is cleared whentabURLchanges.Verification
Built with cmake+ninja and drove a live instance headlessly (isolated
BRO_USER_DATA_DIR, CDP on 9224, AX-driven — no focus stealing): three tabs on distinct colored pages, six switch cycles, then window screenshots of the card in each state — background tab shows its switch-away snapshot, active tab shows a fresh shot, blank tab is unchanged. No crashes;Page.captureScreenshotconfirmed returning data on CEF 151 per-tab targets.🤖 Generated with Claude Code