diff --git a/Home.md b/Home.md index 8d44db4..72f615e 100644 --- a/Home.md +++ b/Home.md @@ -170,3 +170,18 @@ When building_number is entered in the manual asset form or location form, it au ## Links - [README](https://gitea.ourpad.casa/shawn/canteen-asset-tracker/src/branch/main/README.md) - [PROJECT.md](https://gitea.ourpad.casa/shawn/canteen-asset-tracker/src/branch/main/PROJECT.md) + +## T11c - Pull-to-Refresh + Swipe Gestures + +**Date:** 2026-05-21 + +Mobile touch gesture support for the asset list: + +- **Pull-to-refresh:** touchstart/touchmove/touchend on `#assetsListView` with visual pull indicator (spinner, drag progress, "Release to refresh" label). Only activates when scrolled to top. +- **Swipe-to-delete:** Left-swipe on `.asset-item-swipe-wrap` items reveals delete background. Swipe past 60px threshold to activate, snap-back otherwise. +- **Undo toast:** After delete, `#undoToast` appears at bottom with 5-second auto-dismiss. Undo button cancels the deletion. +- **Desktop fallback:** `body.has-mouse` class shows a 🔄 Refresh button in the toolbar. Mouse detection via mousemove event. +- **Gesture isolation:** PTR only triggers at scroll top; swipe requires horizontal movement (rejects vertical scroll). +- **Idempotent init:** `_ptrInited` and `_swipeInited` guards prevent duplicate event listeners on tab switches. + +**Implementation:** Single consolidated implementation replacing 2 prior conflicting versions. Removed duplicate `let ptrState` declaration that caused SyntaxError.