You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@magpie.apache.org by "potiuk (via GitHub)" <gi...@apache.org> on 2026/09/17 14:04:23 UTC
[PR] fix(preview): make capture work on this site, and mark previews as previews [magpie-site]
potiuk opened a new pull request, #189:
URL: https://github.com/apache/magpie-site/pull/189
Two follow-ups to #188, which merged before these landed.
## The capture never worked here
Reported from a real preview:
```
Could not capture the page: Attempting to parse an unsupported color function "oklch"
```
`html2canvas` 1.4.1 parses CSS colours itself and predates the modern colour
functions. This site is Tailwind 4, whose palette is `oklch` throughout — so
the capture could not have worked on **any** page, not just the one that was
tried. #188 shipped a screenshot feature that could never take a screenshot of
this site.
Swapped to **`html2canvas-pro` 2.4.3** — MIT, the maintained fork that added
`oklch`, `lab`, `lch` and `color()` support. Vendored the same way, with the
same checksum discipline:
```
file sha256 22d7b55530426ae0652748225ba1fedccb207ec9da0dff83a52dedd6fbe24611
250,171 bytes
```
### A file swap alone would have failed too
Its UMD bundle exposes `window.html2canvas` as a **module namespace**, not a
callable — the function is `.default`, where the old package exposed it
directly. Replacing only the vendored file would have traded the colour error
for `window.html2canvas is not a function`.
I checked by loading the actual bundle in a VM rather than trusting the fork's
drop-in claim. The overlay now resolves both shapes and throws a clear message
if neither is present, so a future library change fails loudly instead of
mysteriously.
## Previews now say they are previews
A staged URL gets forwarded. Nothing on the page distinguished
`magpie-pr180.staged.apache.org` from the published site, and they look
identical.
A small amber bar sits at the top right of every preview naming the repository,
the pull request and the commit it was built from, linking to the PR. It is
deliberately **not dismissible** — the moment it can be turned off is the
moment someone screenshots a preview and presents it as the site.
It hides with the rest of the overlay chrome during a capture, so it never
appears in a screenshot; the caption strip burned into the image already
carries the same facts in a form that survives being pasted.
## Verification
- 110/110 tests, `prek` + zizmor clean
- The vendored bundle loads in a VM and the overlay's resolution expression
finds a function
- The published script — `logic.mjs` with `export ` stripped, concatenated with
`review.js` — parses
Still unverified, as in #188: whether a programmatically-written clipboard
image pastes into GitHub's comment box on **Safari**. The download fallback
exists for that answer being "no".
🤖 Generated with [Claude Code](https://claude.com/claude-code)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@magpie.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] fix(preview): make capture work on this site, and mark previews as previews [magpie-site]
Posted by "potiuk (via GitHub)" <gi...@apache.org>.
potiuk merged PR #189:
URL: https://github.com/apache/magpie-site/pull/189
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@magpie.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org