ext-apps/examples
Repository files (latest commit first)
Filename Latest commit message Latest commit date
Olivier Chafik 38700569e7
fix(pdf-server): radio + dropdown in fill_form/save (#577)
* fix(pdf-server): fail fast on never-polled viewer + surface batch errors

interact's get_screenshot/get_text waited the full 45s for a viewer that
never mounted (host went idle before iframe reached startPolling), then
timed out with a generic message. Now tracks viewsPolled and fails in ~8s
with a recovery hint. Batch errors were also ordered success-first —
hosts that flatten isError to content[0] showed "Queued: Filled N fields"
and dropped the actual failure entirely. Viewer side: poll even when PDF
load throws, and catch connect() rejection instead of silently blanking.

* fix(pdf-server): radio button + dropdown handling in fill_form and save

Three related bugs around non-text form fields:

Viewer fill_form (mcp-app.ts): writing a string to annotationStorage on
every radio widget trips pdf.js's inverted string coercion
(`value !== buttonValue` → true) — the first-rendered widget checks
itself and clears the rest, so whatever you ask for, you get the first
option. Fix: extract a setFieldInStorage() helper that writes
{value: true} only on the widget whose buttonValue matches, {value: false}
on siblings, matching pdf.js's own change handler. Also covers the
syncFormValuesToStorage() path (localStorage restore).

Save (pdf-annotations.ts): buildAnnotatedPdfBytes only knew about
getTextField/getCheckBox — dropdowns and radios threw in the try block
and fell through the catch, so they were silently dropped on save.
Fix: instanceof dispatch on getFieldMaybe(). For radios, accept either
the option label or a numeric buttonValue (indexed into getOptions()),
since the viewer stores the latter for PDFs with /Opt.

display_pdf output (server.ts): radio groups showed as N identical
`name [Btn]` lines with no way to tell them apart; dropdowns didn't
list their options. Fix: surface buttonValue as exportValue and the
options array from the annotation data already in hand.
2026-04-01 22:28:28 +01:00
..
basic-host chore: bump ext-apps to 1.3.2 (#569) 2026-03-27 17:45:09 +00:00
basic-server-preact chore: bump ext-apps to 1.3.2 (#569) 2026-03-27 17:45:09 +00:00
basic-server-react chore: bump ext-apps to 1.3.2 (#569) 2026-03-27 17:45:09 +00:00
basic-server-solid chore: bump ext-apps to 1.3.2 (#569) 2026-03-27 17:45:09 +00:00
basic-server-svelte chore: bump ext-apps to 1.3.2 (#569) 2026-03-27 17:45:09 +00:00
basic-server-vanillajs chore: bump ext-apps to 1.3.2 (#569) 2026-03-27 17:45:09 +00:00
basic-server-vue chore: bump ext-apps to 1.3.2 (#569) 2026-03-27 17:45:09 +00:00
budget-allocator-server chore: bump ext-apps to 1.3.2 (#569) 2026-03-27 17:45:09 +00:00
cohort-heatmap-server chore: bump ext-apps to 1.3.2 (#569) 2026-03-27 17:45:09 +00:00
customer-segmentation-server chore: bump ext-apps to 1.3.2 (#569) 2026-03-27 17:45:09 +00:00
debug-server chore: bump ext-apps to 1.3.2 (#569) 2026-03-27 17:45:09 +00:00
integration-server chore: bump ext-apps to 1.3.2 (#569) 2026-03-27 17:45:09 +00:00
map-server chore: bump ext-apps to 1.3.2 (#569) 2026-03-27 17:45:09 +00:00
pdf-server fix(pdf-server): radio + dropdown in fill_form/save (#577) 2026-04-01 22:28:28 +01:00
qr-server chore: bump ext-apps to 1.3.2 (#569) 2026-03-27 17:45:09 +00:00
quickstart chore: bump ext-apps to 1.3.2 (#569) 2026-03-27 17:45:09 +00:00
say-server chore: bump ext-apps to 1.3.2 (#569) 2026-03-27 17:45:09 +00:00
scenario-modeler-server chore: bump ext-apps to 1.3.2 (#569) 2026-03-27 17:45:09 +00:00
shadertoy-server chore: bump ext-apps to 1.3.2 (#569) 2026-03-27 17:45:09 +00:00
sheet-music-server chore: bump ext-apps to 1.3.2 (#569) 2026-03-27 17:45:09 +00:00
system-monitor-server chore: bump ext-apps to 1.3.2 (#569) 2026-03-27 17:45:09 +00:00
threejs-server chore: bump ext-apps to 1.3.2 (#569) 2026-03-27 17:45:09 +00:00
transcript-server chore: bump ext-apps to 1.3.2 (#569) 2026-03-27 17:45:09 +00:00
video-resource-server chore: bump ext-apps to 1.3.2 (#569) 2026-03-27 17:45:09 +00:00
wiki-explorer-server chore: bump ext-apps to 1.3.2 (#569) 2026-03-27 17:45:09 +00:00
run-all.ts add EXAMPLE=folder-name support for tests & basic-host (#292) 2026-01-19 20:16:37 +00:00