Files
jsonPrism/docs/tested-viewports.md
T
poli0981andClaude Opus 4.7 a6caa88d9c fix(toast): close button now dismisses on click — upgrade sonner v1.7 to v2 (#52)
User report: the toast close button (×) was visible on both desktop and mobile,
but clicking/tapping it didn't dismiss the toast. Reading sonner v1.7.4's
bundled source, the toast root attaches an `onPointerDown` that calls
`r.target.setPointerCapture(r.pointerId)` unconditionally whenever the toast is
dismissible. Combined with React 19's new event delegation (root-attached
listeners instead of document-wide), this pointer capture quirk swallows the
synthetic click event on the close button — so the bundled handler that calls
`dismiss()` never runs. The bug fires on both mouse and touch because the
PointerEvent capture is API-unified.

Upgrade sonner from ^1.7.0 to ^2.0.7. Sonner v2 rewrote the pointer/swipe
handling and ships first-class React 19 support; the close-button click now
fires reliably on both desktop and mobile. The seven `toast.success/warning/
error/info` usage sites and the `<Toaster>` props (`position`, `theme`,
`richColors`, `closeButton`, `toastOptions.classNames`) are API-compatible
between v1 and v2 — typecheck and the 193 unit tests pass without changes.

Bonus: add a `::after` hit-area expansion on `[data-close-button]` (visible
size stays at sonner's 20px default; effective tap target ~36–40px) plus
`touch-action: manipulation` to eliminate the 300ms tap delay on touch
devices. Defensive — sonner v2 already fixes the underlying click issue, but
the larger hit target is a free mobile UX win.

Also adds:
- `docs/tested-viewports.md` — the manual device test matrix the maintainer
  has been verifying against (BlackBerry Z30 / Galaxy S9+ / Pixel 3/4/7 /
  iPhone SE/12/14 Pro/XR/Pro Max / iPad / BlackBerry PlayBook). Documents the
  Nokia Lumia 520 (320x533) as a known limitation below the recommended
  minimum 360x640.
- README EN + VI link to the new doc.
- THIRD-PARTY.md bumps sonner version 1.7 to 2.0.7.

Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-14 14:01:10 +07:00

3.3 KiB
Raw Permalink Blame History

Tested viewports

JSONPrism's mobile and tablet rendering is verified across the devices below.

Status legend:

  • ✅ Works as expected
  • ⚠️ Cramped but functional
  • ❌ Known limitation (typically below recommended minimum)

Recommended minimum viewport: 360 × 640. Phones in landscape orientation are best-effort — see recommendation.

Test results (last verified 2026-05-14)

Phones (portrait)

Device Viewport Status Notes
BlackBerry Z30 / Samsung Galaxy Note 3 / Nexus 5 360 × 640 ✅ Minimum recommended viewport
Samsung Galaxy S9+ 320 × 658 ✅ Below recommended width, works
Pixel 4 353 × 745 ✅
Pixel 3 393 × 786 ✅
iPhone SE (2nd/3rd gen) 375 × 667 ✅
iPhone 12 Pro 390 × 844 ✅
iPhone 14 Pro 393 × 852 ✅ Verified on real device
iPhone XR 414 × 896 ✅
Pixel 7 412 × 915 ✅
iPhone 14 Pro Max 420 × 932 ✅

Tablets

Device Viewport Status Notes
BlackBerry PlayBook 600 × 1024 ✅
iPad 768 × 1024 ✅ Side-by-side input/output kicks in at md (768px)

Known limitations

Device Viewport Status Notes
Nokia Lumia 520 320 × 533 ❌ Code editor disappears — viewport is below the recommended minimum height (640). Worth revisiting in a future round if demand surfaces.

Recommendation

  • Portrait orientation only on phones. Landscape on phones (height < width) compresses each tab's content area to ~150–200px after chrome and is best-effort.
  • Below recommended minimum (360 × 640): layout is functional but the code editor may collapse on very short heights (< 600px).

How to retest

  1. Open Chrome DevTools → "Toggle device toolbar" (Ctrl+Shift+M).
  2. Pick a device from the dropdown or set a custom viewport.
  3. Verify on the Home page: Header navigation visible, Input/Output Tabs accessible, FormatPicker trigger fits, no horizontal scroll on <body>.

Test results contributed by the maintainer. PRs welcome to expand the matrix.