Repository navigation
feat: a shared scene's link shows a frame of the scene and its title (D565) - #118
Merged
Merged
Conversation
…(D565) Share sends a 1200x630 JPEG of the canvas beside the scene. The Worker keeps it as cards/<id>.jpg, outside the content hash, first card kept, and /s/<id> rewrites the /play page's og and twitter tags with the scene's title, its link and, when it has one, /api/card/<id>.jpg.
Contributor
|
Claude finished @lnorton89's task in 19s —— View job Review of #118The change is correct and well-tested for what it covers. I found no rule violations: there is no 1. First-card-wins can be squatted (
2. The "right size" check is only a magic-byte check (
Minor
Summary: the change is sound, with the two points above. I left no inline comments. |
Its Linux CUDA binary began answering 404 and failed npm ci. The site runs CLIP in the browser (D560) and never uses it; the CPU binaries are kept.
11 of 12 tasks
…00x630 readCard checked only a JPEG's first and last bytes and its byte size, so any JPEG under 160 KB was kept, whatever its dimensions. jpegSize walks the segment markers to the first SOF and reads its height and width without decoding. D565 now also states that first-card-wins can be claimed by anyone who knows a scene's text, and why it is accepted. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01W2BaQir6MZbp4JBpp3CZyT
# Conflicts: # docs/DECISIONS_BY_AREA.md
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.
Pasted into a chat or a post, every
/s/<id>link showed the sandbox's own card. Now it shows the scene.cardFromCanvas(site/src/lib/play/card.ts) copies the canvas, crops the largest centred 1200x630 part, and encodes a JPEG under 160 KB, sent ascardbeside the scene.cards/<id>.jpg(site/worker/share-card.ts). It is outside the content hash, so ids and old links are unchanged, and a scene keeps the first card it gets. Anything that is not a JPEG of the right size is dropped and the scene is still shared./s/<id>rewrites the page's social tags: the scene's title, its link, and/api/card/<id>.jpgwhen it has a card. A scene without one keeps the generic picture with its own title.Decision D565; roadmap and site README updated (the README says how to delete a card with its scene).
Checked: site unit tests (340, including
share-worker.test.ts, which drives the Worker's routes end to end against a fake bucket),tsc,eslint, and the conventions tests.Not checked: the capture in a real browser, the full site build and Playwright smoke test, the deployed Worker, and a real link preview. Not deployed.
Update (from the bot review):
readCardchecked only the JPEG's first and last bytes and its byte size. NowjpegSizewalks the segment markers to the first frame header (SOF) and reads its height and width without decoding the picture, so only a 1200x630 JPEG is kept. The Worker's pixel constants are pinned tocard.ts's by a test.cards/<id>.jpg.tsc, eslint and the conventions tests.cargo-denyfailure is not from this branch. It is RUSTSEC-2026-0543 (chronounmaintained) and is fixed by fix: local time comes from jiff; chrono is unmaintained (D566) #120. Rerun after that merges.