Skip to content

fix+feat: crash fix, null-safety, device-consistent PDFs, Height combo (verified E2E) - #8

Merged
pythonsst merged 4 commits into
mainfrom
feat/height-combobox
Jun 28, 2026
Merged

fix+feat: crash fix, null-safety, device-consistent PDFs, Height combo (verified E2E)#8
pythonsst merged 4 commits into
mainfrom
feat/height-combobox

Conversation

@pythonsst

Copy link
Copy Markdown
Owner

Comprehensive, fully-verified branch addressing the crashes, the cross-device PDF issues, and the Height field — all checked with an automated end-to-end harness (5 templates × desktop/mobile, real PDF downloads). Supersedes #7 (its commits are included here); recommend merging this and closing #7.

Fixes

  1. Crash when editing/clearing a field (Cannot read properties of undefined (reading 'label')). FramedDoc cached paginated pages in state; after an edit it briefly laid out stale pages against shorter data → out-of-range row index. Now cached pages are tagged with the data signature and only used when they match; nodeFor is null-safe.
  2. Strict null-safety — enabled noUncheckedIndexedAccess + noImplicitOverride; fixed the 15 unsafe index accesses it surfaced (non-empty tuples for the template/heading lists, guarded loops, etc.). tsc is 0 errors.
  3. Device-consistent PDFs — Royal used a viewport-responsive grid (sm:grid-cols-2) inside the A4 document, so a phone collapsed it to 1 column and paginated to 2 pages while desktop showed 1. Made it always 2 columns; added a regression test that forbids sm:/md:/lg:/xl: in any template.
  4. Filename — Hindi/non-Latin names slugify to empty → now biodata.pdf instead of biodata-biodata.pdf.

Feature

  • Height is a type-or-select combo — a text input backed by a <datalist> of common heights (4'6"–6'6" with cm). Pick one or type your own. New combo field type in the data model.

E2E verification (automated, headless)

  • 5 templates × {desktop, mobile}: every PDF downloads, identical bytes per template across devices, zero crashes when clearing fullName/fatherName/pob, "Clear all", and retyping; zero console errors.
  • Hindi (शिव शंकर तिवारी) + Devanagari header + photo + long values: render correctly in the PDF (no tofu) — the image-PDF captures the browser's own rendering, so any script works.
  • Multi-page overflow: long content paginates with no content loss; empty doc → valid 1-page PDF, no crash.
  • npm run lint clean · npm test 43/43 · next build green.

🤖 Generated with Claude Code

pythonsst and others added 3 commits June 28, 2026 04:19
Render the Height field as a text input backed by a <datalist> of common
heights (4'6"–6'6" with cm), so users can pick a value or type their own.
Adds a 'combo' field type to the data model.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
- Royal used a viewport-responsive grid (grid-cols-1 sm:grid-cols-2) inside the
  document, so on a narrow phone it collapsed to one column, measured taller,
  and paginated to 2 pages while desktop showed 1 — a different PDF per device.
  The A4 document must never use viewport breakpoints; make it always 2 columns.
  Now identical on desktop and mobile (verified: same unit heights, 1 page).
- Add a regression test asserting no template uses sm:/md:/lg:/xl: classes.
- PDF filename: a non-Latin (e.g. Hindi) name slugifies to empty; fall back to
  "biodata.pdf" instead of "biodata-biodata.pdf".

Verified via full E2E (5 templates × desktop/mobile): all download identical
PDFs per template, no crashes clearing/retyping fields. 43 unit tests pass.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@vercel

vercel Bot commented Jun 27, 2026

Copy link
Copy Markdown
Contributor

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
snapbiodata Ready Ready Preview, Comment Jun 28, 2026 2:26am

Reset the file input's value after a successful read, so picking the same file
again (e.g. after removing it) still fires change. Found via rapid-interaction
stress testing (add → remove → add).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@pythonsst
pythonsst merged commit f89fcde into main Jun 28, 2026
3 checks passed
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