Repository navigation
Polish exports: logo card on Band covers, readable PDF callouts, no stranded callouts - #325
Conversation
…tranded callouts - A logo that wouldn't show up on the Band cover's color (more than a quarter of its pixels under 3:1 against it, the WCAG minimum for graphics) sits on a white card in PDF, Word, HTML and the GIF title card, as it already did in PowerPoint. The check and the carded drawing are shared in exporters/branding.js, and PowerPoint now uses them too. - PDF callout labels use a darker shade of their color, at least 4.5:1 on the tint (amber on cream was about 2:1), like Word, HTML and Markdown. - PDF keeps short callouts placed after a screenshot on the screenshot's page, so one no longer starts the next page on its own. - The GIF title card counts every step, not just those with a screenshot, so the total matches the step numbers on the frames. - Word code blocks have padding; tables span the text (or column) width with a shaded header row. - HTML: callouts placed after a step title sit in the step body with the rest of the step, and the step number lines up with the first line of a long title.
|
@codex review |
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 819d321abd
ℹ️ 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".
| raster.fillRoundRect(card, 0, 0, card.width, card.height, Math.round(pad * 0.9), [255, 255, 255, 255]); | ||
| raster.drawImage(card, img, pad, pad); |
There was a problem hiding this comment.
Check logo contrast against the card before making it white
For a transparent white logo on a light band such as #AAAAAA, the contrast check requests a card, but drawing the logo onto this white background makes it disappear completely. I reproduced this with coverLogo: it returns carded: true, and the opaque logo pixels become indistinguishable from the card, whereas the original logo had approximately 2.32:1 contrast against the band. This newly affects PDF, Word, HTML, and GIF band covers. Choose a card color that contrasts with the logo, or retain the original background when a white card would reduce contrast.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Fixed in 62674d6: the card is now white or dark slate, whichever the logo contrasts with better, and there is no card when neither beats the band. The PowerPoint picture-cover card follows the same choice. Regression test uses a white logo on #AAAAAA.
A logo that was faint on the band always got a white card, so a white logo on a light band (#AAAAAA, say) vanished into its card. The card is now white or dark slate, whichever the logo stands out on, and is left off when neither would make the logo clearer than the band itself. The PowerPoint picture cover's card follows the same choice.
Polish exports: logo card on Band covers, readable PDF callouts, no stranded callouts (land #325 on main)
Issue
No issue filed. Builds on #324 (this PR's base is that branch); merge #324 first and this one retargets to
main.Summary
These are the smaller fixes from the same review of every export format:
Changes
exporters/branding.js:luminance,contrast,logoNeedsCardandcoverLogo.coverLogoreturns the logo itself, or the logo drawn on a white rounded card with padding.exporters/pptx.jsdrops its own copies and uses these.exporters/pdf.js:coverLogo.labelcolor.drawImagetakes akeepWithheight: the height of the callouts right after the screenshot, when they're short (under about a third of a page).exporters/docx.js:brand-logo-card.png).codeBoxProps: borders in the code block's own fill color, set off from the text, pad the box, and an indent keeps the padding inside the text column.table()is 100% of its container, with a shaded header row.exporters/html.js:on-cardclass on the header logo, styled as a white card..step-body..step-headaligns to the top.exporters/gif.js:titleCardMeta(ast)counts every step.tests/unit/export-polish.test.js(new):docs/BRANDING.md: a note on the logo card.Area
Testing
bash tests/run_test.shpassesbash tests/run_test.shwas not run.npm testpasses: 1,665 tests, 1,639 passed, 0 failed, 26 skipped.tests/e2e/exports.test.jspasses on a private Xvfb display, andnpm run translationslists nothing missing.Checked on Ubuntu 26.04:
The Word file has not been opened in Microsoft Word yet.
Screenshots or recordings
All from the same guide, exported on
mainand on this branch.Band covers, left to right: PDF, Word, GIF title card, HTML. On
mainthe dark wordmark nearly disappears, and the GIF says 6 steps:PDF callout labels:
The PDF's last two pages. On
main, the "Escalate" callout is alone on the last page; now the screenshot moves there with it:Word code block and table:
HTML at phone width, with a long step title:
Rollout notes
None.
Checklist
t(), andnpm run translationslists nothing missing