Skip to content

Show plugin screenshots and icons in marketplace link previews - #4786

Merged
brsbl merged 7 commits into
mainfrom
bb/improve-plugin-marketplace-link-previews-thr_ag5nqdcxtg
Oct 3, 2026
Merged

brsbl merged 7 commits into
mainfrom
bb/improve-plugin-marketplace-link-previews-thr_ag5nqdcxtg

Conversation

@brsbl

@brsbl brsbl commented Oct 3, 2026 •

Copy link
Copy Markdown
Collaborator

Human comments

What was wrong

Plugin share images were text-only in production. The image route fetched screenshots from getbb.app inside the Worker serving getbb.app, and that request failed.

What changed

  • Plugin links now unfurl with the plugin's screenshot, icon, category, and author avatar.
  • Screenshots and icons load directly from the marketplace R2 bucket.
  • Images too large to decode safely are skipped, falling back to the next screenshot or the icon card.
  • SVG icons that embed images are rejected and show the default icon.
  • Long plugin names shrink to fit on one line.
  • The site and the share card now share one plugin icon map.

No route, og:image, or response-code changes.

How you verified

  • Dev app: rendered /marketplace/og/<id> against the live catalog seeded into local R2. The table below shows the results.
  • Dev app: bb-sidebar (4500×3156 screenshots) renders the icon card instead of decoding them.
  • Dev app: "LaunchDarkly Feature Flags" fits on one line on the no-screenshot card.
  • New tests cover R2 loading through the route's loader and skipping oversized screenshots.
  • Remote CI: pending on the latest head.

Before: merge base 621b52e · After: 7714ec1 · 1200×630, the route's exact output. In the dev app the base code can reach getbb.app, so its cards show a small screenshot; production shows text only.

Plugin / state Before After
Advisor · screenshot Before Advisor After Advisor
Account Pool Balanced · long name Before Account Pool Balanced After Account Pool Balanced
Agent Board · unmapped icon name Before Agent Board After Agent Board
Agent Proxy · no screenshot Before Agent Proxy After Agent Proxy

BB-Thread-ID: thr_ag5nqdcxtg

AGENT GENERATED

🤖 Generated with Claude Code

Load screenshots, icons, and avatars for plugin share images from the
marketplace R2 bucket instead of fetching getbb.app from inside the
Worker, which failed and left every card on the text fallback. Redesign
the card around the plugin screenshot with the plugin icon, category,
and author avatar, and share the plugin icon map with the site.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 3, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-03T01:27:27.506639Z c0127db PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: c0127db35c

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +167 to +169
const titleSize = screenshot
? Math.min(44, Math.floor(384 / (name.length * 0.48)))
: 64;

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Scale titles on no-screenshot cards

When a plugin has no screenshot and a moderately long display name, this branch fixes the title at 64px even though its text column is now only 760px wide and the name may retain up to 40 characters. Names that fit the previous 1000px/52px layout can therefore overflow into the large icon or be clipped off-card; apply the same width-based scaling used for screenshot cards to this layout.

Useful? React with 👍 / 👎.

Comment on lines +339 to +342
for (const url of declared) {
const image = await loadImage(url, loadAsset);
if (image) return image;
}

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Bound retries across all screenshot candidates

When a valid manifest lists several unreachable external screenshots, this serial loop gives every candidate its own five-second fetch timeout, so the OG response can now stall for roughly 30 seconds before rendering the fallback. The schema permits up to six screenshot URLs, while the previous implementation made only one timed request; use a request-wide deadline or parallel/bounded loading so social crawlers do not time out before receiving the card.

Useful? React with 👍 / 👎.

brsbl and others added 3 commits October 2, 2026 18:33
Reject screenshots and icons whose decoded size would exceed a pixel
budget, unsupported image types, and oversized bodies before inlining
them, so resvg never decodes multi-megapixel images inside the Worker.
Scale long titles on cards without a screenshot so they no longer run
under the icon tile.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Detect PNG and JPEG from their signatures before applying the pixel
budget so a mislabeled image cannot bypass it, and reject SVG icons
that embed raster images, which resvg would otherwise decode at full
size.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@brsbl brsbl changed the title Make marketplace plugin share cards visual Show plugin screenshots and icons in marketplace link previews Oct 3, 2026
brsbl and others added 3 commits October 2, 2026 18:38
Cap SVG icons at 64 KB and reject any SVG that declares a DOCTYPE or
entities or contains image or feImage elements under any namespace
prefix, so embedded rasters cannot bypass the pixel budget.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@brsbl
brsbl merged commit c4b72f6 into main Oct 3, 2026
34 checks passed
@brsbl
brsbl deleted the bb/improve-plugin-marketplace-link-previews-thr_ag5nqdcxtg branch October 3, 2026 03:43
brsbl added a commit that referenced this pull request Oct 3, 2026
Resolves the conflicts with #4786 (icons moved to marketplace-icons.ts)
and #4791 (shared install badge). Only plugins installed by default now
show "Built in"; opt-in official plugins like Tasks show their install
counts, matching the in-app plugin store.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
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.

1 participant