Pathbuilder import, frontend: by code, paste, file or sheet PDF (#958) #1363
Loading…
Reference in a new issue
No description provided.
Delete branch "feat/958-pathbuilder-import-frontend"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Frontend for the Pathbuilder import (#958, IS-429); the backend is #1361.
What it does
"Import from Pathbuilder…" opens one dialog with three ways in: Code (default; the browser fetches
https://pathbuilder2e.com/json.php?id=<code>, 15 s timeout, digits-only check first), Paste or file (pasted JSON or a .json file), Character sheet PDF. A fetch that fails for any reason (network, CORS, challenge page,success:false) shows the link, switches to Paste and keeps the code as provenance. The preview saves nothing: name, class, level, what will happen (create / update / replace, the last behind a checkbox), Not read (always shown, with reasons), warnings, matched vs kept-as-text entries, numbers that differ from Pathbuilder's, and for update/replace the changes. Import saves withcommit=1&expected_version=<previewed version>; a stale 409 hands the page the current sheet and previews again; 503 says busy with Try again; success closes the dialog and the sheet shows an "Imported from Pathbuilder" banner.Entry points
SheetPage.jsx, the no-sheet branch).Where the drawing and the brief differ: the drawing (lane9.html
pathbuilder()) shows only a paste box and a one-line summary; the code, PDF, report and confirm flow follow the brief. The server's warning about differing numbers is not repeated under Warnings, since "Numbers that differ" lists the same figures.CSP
webapp/frontend/nginx.conf:connect-src 'self'becomesconnect-src 'self' https://pathbuilder2e.com; nothing else changed. No test or e2e file asserts the header.docs/API.mdsaid the origin must be allowed; its sentence now says it is. I built thefrontend-prodimage and ran it;curl -IreturnsContent-Security-Policy: default-src 'self'; script-src 'self'; style-src 'self' 'unsafe-inline'; img-src 'self'; connect-src 'self' https://pathbuilder2e.com; font-src 'self'; frame-ancestors 'none'.Wording for review
Checks (docker-test, committed code via git archive)
ImportPathbuilder.test.jsx(28 tests) plus 2 new and 1 updated inSheetPage.test.jsx; full suite with--maxWorkers=3: 294 files, 5792 passed, 1 skippedbuildsuite: frontend-prod image built; CSP header checked as aboveNot covered: a real Pathbuilder fetch (their server was mocked), a real PDF upload through the stack, and the replace flow on the built stack (unit-tested only).
Also: CATALOGUE
IS-429row extended; changelog fragmentchangelog.d/958-pathbuilder-import-frontend.added.md.🤖 Generated with Claude Code