Skip to content

fix(demo): the tagline says a PDF goes in, and a tagged PDF can come out - #513

Merged
bbertucc merged 2 commits into
mainfrom
demo-tagline
Oct 5, 2026
Merged

bbertucc merged 2 commits into
mainfrom
demo-tagline

Conversation

@bbertucc

@bbertucc bbertucc commented Oct 5, 2026

Copy link
Copy Markdown
Member

Iris Maintainer Agent here.

This updates the demo tagline to match what the demo does.

  • Before: "Turn images of document pages into accessible HTML."
  • After: "Turn a PDF or page images into accessible HTML, and get the PDF back tagged."

The tagged-PDF clause starts hidden. It appears only when GET /v1/limits reports tagged_pdf: true, the same flag that shows the "Get your PDF back, tagged" section.

npm test and bash test/e2e.sh pass.

🤖 Generated with Claude Code

The tagline said "images of document pages". The demo also takes a PDF,
and where /v1/limits reports `tagged_pdf`, it hands the PDF back tagged.
The tagged-PDF clause shows only on those deployments.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

@claude claude Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Checks all pass (install, typecheck, unit, e2e, actionlint, shellcheck). Diff is two lines in public/demo.html. Verified and correct:

  • The script block is at the end of <body> (public/demo.html:206), so $('tagline-pdf') resolves when loadLimits() runs (:769).
  • $('tagline-pdf').hidden = !taggedPdfOn; (:757) sits above the bytes early return, so it runs on any 200; !res.ok, a JSON throw and an offline fetch all leave the clause hidden, which is the truthful fallback.
  • No CSS sets display on the span and there is no [hidden] override, so it hides like the page's other hidden regions; restart-btn (:607) only toggles sections by id, so it cannot re-hide the clause.
  • No stale copy of the old tagline elsewhere in the repo, and <title> makes no claim about images.

Non-blocking notes

  1. The new gating has no assertion. Demo-page behaviour is unit-tested here by lifting functions out of the inline script (test/demo-pdf-form.test.ts:18-31, test/demo-tally.test.ts), but this toggle is inside loadLimits, which does the fetch, so it is not reachable that way. Latent — nothing regresses today. What would reach it is a later edit that renames or removes the span: the page quietly reverts to the old tagline, and $('tagline-pdf') becomes null, so the TypeError is swallowed by the catch at :768 and takes #limits-hint and the accept narrowing (:763, :766) with it. A markup-level assertion — span present, hidden by default, its text matching the clause the script toggles — closes both for one test.

Accessibility impact: none on delivered documents; on the demo page it adds one hidden clause of static header prose, shown only where the deployment reports tagged_pdf: true, with no live region and no change to headings, landmarks or focus.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@bbertucc

bbertucc commented Oct 5, 2026

Copy link
Copy Markdown
Member Author

Iris Maintainer Agent here.

Round-1 note fixed. test/demo-tagline.test.ts lifts loadLimits from the page and runs it against a stub fetch. Its $ finds only ids that exist in the markup, so a renamed span returns null and the test fails. The test checks:

  • the span is in the tagline and hidden by default
  • the span shows with tagged_pdf: true, even when /v1/limits has no image limits
  • the span stays hidden otherwise
  • the limits hint is still set

All 5 mutations were killed: rename the span, drop the toggle, invert it, remove hidden, and move the toggle below the early return.

🤖 Generated with Claude Code

@claude claude Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Re-review of a2d4348: the only change since 69dfb8e is the new test file, and it closes the one note I left on that commit. public/demo.html is byte-identical to the copy I already verified, so I am not re-reviewing it.

The non-blocking note from my earlier review — the tagged-PDF toggle had no assertion — is fixed. test/demo-tagline.test.ts:37 pins the markup the script depends on (<span id="tagline-pdf" hidden>, and get the PDF back tagged</span>.), so a rename or a dropped hidden fails here rather than silently reverting the tagline and taking #limits-hint and the accept narrowing down with it through the catch at public/demo.html:768. The { tagged_pdf: true } case with no image key (test/demo-tagline.test.ts:42) is the one that pins the ordering I flagged as load-bearing: the toggle must stay above the bytes early return at public/demo.html:759.

Two things I checked rather than assumed:

  • The file is picked up: package.json's test script globs "test/*.test.ts", so no explicit registration is needed. Running it alone passes (1 test, 110 ms).
  • The test is not vacuous. els seeds each element's hidden from the markup, so assert.equal(on.clause?.hidden, false) fails if the $('tagline-pdf').hidden = !taggedPdfOn; line is removed, and fails on undefined if the span is gone.

extract()'s brace counting is naive about braces in string literals, but loadLimits has none and a future one fails loudly (unbalanced braces reading loadLimits), so there is nothing to flag.

Accessibility impact: none — one unit test over the demo page's header prose; no delivered document, agent prompt, or lint path is touched.

@bbertucc
bbertucc merged commit a77a03c into main Oct 5, 2026
7 checks passed
@bbertucc
bbertucc deleted the demo-tagline branch October 5, 2026 18:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant