Repository navigation
Conversation
Co-Authored-By: Antigravity <antigravity@google.com>
[Low impact] The change affects cover images in the playground’s novel browsing and parsing views. Fix the HTTP route and preserve image bytes in alternate fetch modes before merging. FindingsSummaryAdds
Reviews (1) · Last reviewed commit: "fix(playground): extract getCoverUrl hel..." · Reviewed by Greptile |
| if (cover.startsWith('http://') || cover.startsWith('https://')) { | ||
| return `/${cover}`; |
There was a problem hiding this comment.
getCoverUrl turns an http:// cover into /http://..., but Vite only mounts the proxy at /https:. Popular and search cards now request a local path instead of the image URL, so valid HTTP covers that previously loaded directly stop displaying. Add HTTP proxy support or leave HTTP URLs unchanged.
| <div className="relative mb-2 overflow-hidden rounded-lg bg-muted aspect-[3/4]"> | ||
| <img | ||
| src={novel.cover || '/static/coverNotAvailable.webp'} | ||
| src={getCoverUrl(novel.cover)} |
There was a problem hiding this comment.
Routing catalogue covers through the proxy breaks them when the user selects Node Fetch or Curl in Settings. proxy.ts sends Node Fetch responses through text() and Curl responses through a string, which changes JPEG, PNG, and WebP bytes. These cards previously loaded images directly. Preserve image bytes in both modes or use a separate image route before sending all covers through this proxy.
Knowledge Base Used: Plugin browser application
|
@rajarsheechatterjee can you check this pr? |
|
Could you check if the comments are valid? |
… alternate fetch modes
… url normalization
|
@rajarsheechatterjee Yes, both comments from Greptile were valid:
I've pushed follow-up commits addressing both issues:
|
Summary
Unifies playground cover image resolution through a defensive
getCoverUrlutility:/https:...), resolving 403 Forbidden / CORS anti-hotlink blocks in catalogue views."" + undefined === "undefined") when novel covers are missing.Evidence
Before:
novel-card.tsxrequested raw cover URLs without proxying, causing broken images on popular/catalogue views due to CORS / anti-hotlinking protections.parse-novel.tsxstring concatenation evaluatedundefinedcover to"/undefined"instead of falling back to default asset.{ "totalCards": 20, "loadedImages": 0, "naturalWidth": 0 }After:
getCoverUrlsafely routes HTTP/HTTPS covers through the local reverse proxy while cleanly falling back to/static/coverNotAvailable.webpon falsy values.{ "totalCards": 20, "loadedImages": 20, "naturalWidth": 600, "naturalHeight": 800 }Merge Danger
Door: two-way
Purely frontend dev playground UI helper. Reversible with zero impact on plugin scraper schemas or production runtime contracts.
Blast Radius: Localized
Scattered across playground cover renderings in
novel-card.tsxandparse-novel.tsx. No production build or package distribution artifacts affected.Checklist
type(scope): description