[codex] Render inline media in citation popovers#66
Conversation
|
Landed as Validation on exact PR head
Exact-head CI:
Live deployment proof:
|
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: d3b0873174
ℹ️ 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".
| return [...mediaUrls].some( | ||
| (url) => comparableUrl(url) === comparableUrl(entry.expandedUrl), | ||
| ); |
There was a problem hiding this comment.
Strip lost-range status media placeholders
When an imported media entity has no usable range, the normal archive shape stores the media entity's expandedUrl as the /status/.../photo/1 URL while extractTweetMedia stores the actual media_url_https as item.url (src/lib/archive/parsing.ts lines 64-66 and 189-193). In that case the raw trailing https://t.co/... remains in the rendered text because this lost-range check only compares entry.expandedUrl to the pbs media URLs, and isOwnStatusMediaUrl() is only applied to the raw trailing t.co URL, so the main malformed media-only placeholder scenario is still not suppressed.
Useful? React with 👍 / 👎.
Summary
t.coplaceholders while retaining real linksRoot cause
Timeline rows already contained
media_json, but the compact AI-report contexts dropped it before rendering citations. Some imported media entities also have no usable text range, leaving the raw mediat.cotoken visible in the popover.Validation
pnpm run checkpnpm test(141 files, 1,175 tests)pnpm buildpnpm test src/routes/today.test.tsx src/components/MarkdownViewer.test.tsx src/lib/period-digest.test.ts src/lib/search-discussion.test.tspnpm test src/lib/moderation-state.test.tspnpm test src/lib/backup.test.ts