Mobile compliance: Safari Storybook testing and a Capacitor reference app

Aperta
#841 1 commento 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

@horner ci sta già lavorando.

Dal 28/11/2026.

  • #843 di @horner — aperta

Valutazione

Difficoltà
4/5
Tempo stimato
3-5 giorni
Idoneità per principianti
25/100
Tipo di issue
Funzionalità
Chiarezza
Specificata chiaramente
Stato di attività
Ferma
Stack tecnologico
react, typescript

Direzione di ricerca

Start with src/components/Textarea/Textarea.stories.tsx, tests/mobile/README.md, and the measurements in PRs #842 and #843; most implementation work is already underway there. Verify the story-root and fixture width caps in the browser and mobile suites before adding the requested Capacitor reference app. Done means documented Capacitor setup plus recorded Safari/iOS checks at the listed portrait and landscape widths.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

Problem and reported evidence

The reporter supplied an iPhone Safari screenshot of Textarea / Default where the Notes / “Add a note…” field extends beyond the right edge of the visible canvas. The source footer is also cut off. Storybook should provide a reliable way to evaluate controls on a phone, and consumers need a working example of the mobile application setup those controls require.

Reproduction starting point:

  1. Open the linked story in Safari on an iPhone in portrait orientation.
  2. Observe the field and surrounding canvas with Safari's browser controls visible.
  3. Focus the field, enter text, and compare with the keyboard open/closed and after rotation.

The clipping is reported from the supplied screenshot; it has not been independently reproduced for this ticket. Device model, iOS/Safari version, CSS viewport, and zoom state were not supplied and should be recorded during reproduction. Keyboard/rotation checks above are additional test cases, not confirmed failures.

Objective 1: configure and test Storybook for mobile Safari

  • Reproduce and isolate the Textarea clipping: distinguish Storybook manager/iframe sizing, decorators/story wrappers, and the component itself. At inspected commit 7aa294d4, the Default story uses a fixed w-96 wrapper; investigate this as a possible contributor rather than assume a viewport-meta or component defect.
  • Audit manager and preview viewport configuration, responsive canvas sizing/padding, safe areas, dynamic viewport height, and Safari toolbar behavior. Ordinary Storybook navigation, canvas, mobile sandbox, and fullscreen preview should remain usable.
  • Make Textarea and representative control stories fit narrow screens without clipped fields or unintended document-level horizontal scrolling. Fix the underlying sizing rather than hiding overflowing content. Preserve user zoom and accessible text sizing.
  • Extend existing mobile coverage with a Textarea regression and representative text input, select/popover, modal, and composed form interactions. Verify focus, touch targets, keyboard visibility, scrolling to the active field, and overlays within the visible viewport.

Objective 2: create a Capacitor mobile reference app

Provide a runnable Capacitor example with two clearly selectable views:

  1. Storybook catalog: show the existing component stories inside the mobile app for browsing and testing.
  2. Bare application page: render representative @mieweb/ui controls directly, with no Storybook manager, iframe, runtime, or decorator dependency. Include the reported Textarea case and a small usable form so developers can compare the same controls in both environments.
  • Use the library's public imports, required styles, theme/providers, and a responsive application shell. Share example data/composition where practical so Storybook and the bare view exercise comparable controls.
  • Demonstrate correct viewport setup, safe-area handling, field sizing, input/focus behavior, keyboard handling, scrolling, and overlay placement in Capacitor's iOS WKWebView. The bare page should also run directly in a browser for comparison with Safari.
  • Package the built web assets for the native app; document any development-only live-server configuration separately. The reference build should not depend on a developer's running Storybook server.
  • Document clean-checkout install/build/sync/run steps, iOS signing prerequisites, the tested library revision, and how a consumer builds and deploys the example. State platform support and any Android follow-up explicitly.

Acceptance and test evidence

  • Verify 320, 375, 390, and 430 CSS-pixel portrait widths plus landscape. Textarea's complete field remains visible and usable, including with long content; any intentionally horizontally scrolling control is documented.
  • Record a test matrix for Safari (Storybook and bare page) and Capacitor iOS (catalog and bare page), including expanded/collapsed browser controls where applicable, keyboard open/closed, rotation, and larger text.
  • Build on the existing browser and Appium/XCUITest suites, retaining meaningful viewport/bounds assertions and screenshots. Run simulator coverage first, then a physical-iPhone check for native keyboard, focus zoom, and safe-area behavior. Record device/OS, build/commit, results, and untested cases; browser emulation alone is not physical-device evidence.
  • Publish the mobile integration guidance with the example and link it from Storybook so consumers can reproduce the supported setup.

Existing work and duplicate check

Searched open and closed issues for mobile, Safari, Capacitor, Textarea, Storybook, and mobile testing. No existing issue was found covering both objectives. Coordinate with these related items:

  • #349 — open mobile consistency/policy work; use its guidance rather than establish a competing policy.
  • #575 / #621 — closed issue and merged fix for navigation hidden behind iOS browser controls; preserve and regression-test that behavior.
  • #540 — merged mobile Storybook sandbox and iPhone Safari tests. Reuse this infrastructure. Its fullscreen/standalone previews still run Storybook fixtures and do not replace the independent bare application page requested here. See existing mobile testing documentation.
  • #672 — existing rich-text keyboard/menu focus issue; coordinate component-specific fixes rather than duplicate them here.

iPhone Safari truncates the Notes input at the right edge in the Textarea Default Storybook story

Root cause investigation

The clipping reproduces in Chromium at phone width before input focus. Both deployed manager and preview documents already contain width=device-width, initial-scale=1.

The centered preview's intrinsic sizing combines the Textarea fixture's 384px fixed width with 32px of brand-decorator padding and 32px of Storybook-root padding: 448px total. At a 390px viewport the field starts at x=32 and ends at x=416; the source footer follows the expanded parent. The field itself fills its fixture rather than imposing that fixed width.

An isolated diagnostic copy of the deployed assets established that both the centered root and the immediate fixture need a parent-width cap. A root-only cap still leaves 416px of document width; a fixture-only cap leaves 448px. Both caps together produce a 390px document and a fully visible 326px field. The same approach fixes sampled AudioPlayer, Input, Select, QuickLinksCard and Tabs stories at their tested widths while preserving desktop Textarea sizing. Tabs at 320px and the calendar's internal minimum width remain separate component-level cases.

A source audit found 171 candidate outer fixed-width declarations across 52 CSF files; this is a candidate set, not a count of confirmed failing stories. See the updated two-phase plan in PR #842 for measurements, audit boundaries, the few-line shared CSS proposal, and the focused Phase 1 checklist.

These screenshots compare the diagnostic Chromium preview before and after the CSS constraints. They are not a production deployment or iOS-device validation; Safari/native verification remains pending.

Diagnostic before

Diagnostic Chromium at 390px before shared width constraints

Diagnostic after

Diagnostic Chromium at 390px after shared width constraints

Docs page follow-up

Native Safari testing of the branch preview revealed additional clipping on Textarea Docs (screenshot below). Inline Docs has a separate centered zoom wrapper, so the original story-root cap did not constrain it. On the reported page, a Chromium reproduction measured the primary field beginning at x=-4.5, while raw installation code and the Controls table expanded the document to 607px in a 390px viewport.

Commit 139d63a6 in PR #843 caps the inline zoom wrapper and contains authored code and Controls in local scroll areas. The code and Controls regions are keyboard-focusable and named; native table semantics are preserved. It also moves default fixture caps into Tailwind's base layer so a story's own narrower width utility keeps precedence.

New tests cover Docs at 320/390/430px, initial field visibility before any horizontal scrolling, local code/table keyboard scrolling, manager iframe containment, and unchanged desktop sizing. The local reproduction now has no document-level horizontal overflow. Cloudflare deployed this commit successfully. Retest the updated Docs; the published page was verified in Chromium with no document-level horizontal overflow. Native Safari retesting remains pending.

Mobile Safari Textarea Docs clips the leading field edge and widens the page

Lingua principale
TypeScript
Stelle
2
Fork
7
Merge medio
1g 12h
PR unite (30g)
62

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di mieweb/ui

Tutte le issue di mieweb/ui

Issue simili

Altre issue su TypeScript

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.