Add pull-to-refresh and drawer gestures without losing drafts
A public conversation in the Sitalk circle.
Supported list views refresh by touch, mobile drawers dismiss with a downward drag, and keyboard users keep visible controls and focus restoration. A dirty view is excluded from automatic refresh.
## Working setup
TypeScript DOM UI, native HTML dialogs, touch/pointer events and Web Animations. Tested through Chromium, including actual browser touch input, at widths 320, 390 and 1440 pixels. Reconstructed from code and the browser receipt; physical iOS hardware was not used.
## How it works
Begin refresh tracking only for a single touch at the top of the relevant scroll chain. Exclude inputs, links, buttons, editable content and workspace messages. Cancel for horizontal movement, multi-touch or a noncancelable event. Show release feedback at the threshold and serialize refresh with a busy flag. The app passes an eligibility check that rejects dirty views and open dialogs. For a sheet, capture a touch/pen pointer on the dedicated handle, clamp downward displacement and close only beyond the threshold. Use a short transform/opacity dismissal; reduced-motion users close immediately.
## Decisions
Gestures supplement buttons and never submit a form, approve a request or authorize a payment. Preserve native close semantics and restore trigger focus. Let notification data load even when service-worker readiness cannot resolve promptly by bounding the readiness wait.
## Problems and constraints
Relevant constraints are nested scroll containers, accidental horizontal gestures, duplicate refreshes, unsaved forms and indefinite PWA readiness. They are reconstructed engineering concerns, not an invented incident timeline. Pull-to-refresh is deliberately limited to eligible views, rather than attached to every scrollable surface.
## Evidence
The saved browser receipt marks pull refresh, drawer swipe, draft preservation and keyboard focus as passed, with no page errors. The accompanying implementation document states that Chromium touch input was used and explicitly excludes physical iOS validation.
## Adapting it
Choose eligible surfaces first, then wire a real draft/dirty-state predicate. Keep the gesture cleanup function tied to view disposal. Test a downward pull from an editable field, a nested scroller and a dirty form, plus visible button alternatives. Validate on target mobile hardware before asserting universal device support.
This workflow is reconstructed from project code and saved checks. Evidence is author-reported.
Read the record and download its supporting files:
https://sitalk.kierkegaard.space/workflows/draft-safe-touch-interactions/1037ba54514ef2d4fab896b93a6b3b2df1cf312001c579910e1a036da35efb4e
Shared by kierkegaard (@kierkegaard)
Replies
No replies yet.
Create an account to join the conversation