Draw the byline the card has been throwing away (GRYT-913) - #392
Merged
Conversation
`author` and `publishedAt` have been on `LinkPreviewData` for as long as the card has existed, the server fills both wherever a page declares them, and `LinkPreviewCard` drew neither. So an article arrived with its byline dropped, and a MakerWorld model with its creator dropped — the two most human facts on the card. They go under the description, not above the title: it is attribution rather than the headline. `cardByline` is pure and lives in `embedUtils` because the interesting part is not the happy case. `article:published_time` is free text as far as this app is concerned, and real pages ship empty strings, the Unix epoch out of a broken template, and dates a century out. Every one of those has to come back as a line that is not drawn rather than as "Invalid Date" under somebody's link. Next year is allowed through — a post dated slightly ahead is an ordinary embargo, and a card refusing to show it would be the odd one out. 2099 is not. `check-card-byline.mjs` is new and mostly about the empty cases. Not in here: the MakerWorld, Printables and Thingiverse logos. `check-embed-icons` refuses an icon for a provider `@gryt/core` does not have, which is the correct answer — core#10 adds the providers, and the artwork follows the release that carries them. Co-Authored-By: Claude Opus 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.
authorandpublishedAthave been onLinkPreviewDatafor as long as the card has existed. The server fills both wherever a page declares them.LinkPreviewCarddrew neither.So an article arrived with its byline dropped on the floor, and — since server#134 — a MakerWorld model arrives with "Mr. Anderson" and the upload date and shows neither. The two most human facts on the card.
They go under the description rather than above the title: attribution, not the headline.
Why it is a function and not three lines of JSX
The happy case is easy. The reason
cardBylineis pure, inembedUtils, and has its own check is everything else —article:published_timeis free text as far as this app is concerned, and real pages ship:""/" ""not a date""1970-01-01T00:00:00Z"— a template that filled in the epoch"2199-01-01""2027-01-01"Without that, a broken template on somebody's blog puts "Invalid Date" under their link.
Not in here: the logos
MakerWorld, Printables and Thingiverse artwork is ready (
SiBambulab,SiPrintables,SiThingiverseall exist inreact-icons) but cannot merge yet.check-embed-icons.mjsrefuses an icon for a provider@gryt/coredoes not have:Which is the check doing its job. core#10 adds the providers; the artwork follows the core release that carries them, with the
@gryt/corebump in the same change.Verification
yarn lint(tsc -b+ eslint,--max-warnings 0), the newyarn test:card-byline, andyarn test:embed-iconsall pass. The new check is wired intopackage.jsonand CI.Not verified on screen — GRYT-911 still has the dev client stuck behind the auth splash.
🤖 Generated with Claude Code