fix(gotjunk): Long-press should update defaults, not auto-save#33
Merged
fix(gotjunk): Long-press should update defaults, not auto-save#33
Conversation
Windsurf Protocol Implementation: - Created useLongPress hook with iOS Safari compatibility - Added ActionSheetDiscount for quick discount % selection (25%/50%/75%) - Added ActionSheetBid for quick bid duration selection (24h/48h/72h) - Updated ClassificationModal with tap/long-press gesture support - Updated App.tsx to handle discount % and bid duration parameters UX Improvements: - Single tap: Select classification with defaults (75% discount, 48h bid) - Long-press Discount: Opens bottom sheet with 25%/50%/75% options - Long-press Bid: Opens bottom sheet with 24h/48h/72h options - Haptic feedback on long-press trigger and selection - iOS Safari optimizations: touch-action manipulation, prevent context menu Technical: - Pointer Events with Touch/Mouse fallback - 450ms long-press threshold, 10px movement cancellation - Debounce: 800ms between long-press triggers - Mutually exclusive tap/long-press gestures - Helper text: 'Tap to select • Long-press to edit' Fixes #issue (classification modal not allowing option selection)
…uttons Hotfix for PR #31: - Removed whileTap/whileHover from Discount and Bid buttons - Changed from motion.button to plain button elements - Added active:scale-95 CSS for visual feedback - Resolves gesture handler conflict preventing tap selection Issue: Framer Motion's whileTap was consuming tap events before custom useLongPress handlers could process them, breaking tap-to-select functionality. Solution: Use plain button elements with CSS transitions for visual feedback, allowing custom pointer event handlers to work correctly.
Fixes two critical UX issues: 1. Long-press auto-save bug: - BEFORE: Long-press → select value → immediately saves item - AFTER: Long-press → select value → action sheet closes → user taps button to save - Fixed handleDiscountSelect and handleBidSelect to NOT call onClassify 2. Defaults don't persist: - BEFORE: Always reset to 75% discount / 48h bid on each capture - AFTER: Selected values persist as defaults for future captures - Uses localStorage: 'gotjunk_default_discount' and 'gotjunk_default_bid_duration' - Loads saved values on modal mount with lazy useState initialization UX Flow (now correct): 1. User captures photo → modal shows with saved defaults (or 75%/48h first time) 2. User long-presses Discount → action sheet opens 3. User selects 50% → action sheet closes, modal shows '50% OFF' 4. User taps Discount button → saves item with 50% discount 5. Next capture → modal opens with 50% as default Auto-posting investigation: - Auto-save was caused by handleDiscountSelect/handleBidSelect calling onClassify - Framer Motion gesture conflict (fixed in PR #32) may have also contributed - Both issues now resolved Technical: - Removed onClassify calls from action sheet handlers - Added localStorage persistence for user preferences - Added haptic feedback on value selection (vibrate pattern) - Lazy useState initialization to load defaults only once
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Critical UX Fixes
Addresses two major issues reported by user testing:
Issue #1: Long-Press Auto-Saves (Broken Flow)
Problem:
Root Cause:
Solution:
New Flow:
Issue #2: Defaults Don't Persist
Problem:
Root Cause:
Solution:
Persistence:
gotjunk_default_discount→ stores 25, 50, or 75gotjunk_default_bid_duration→ stores 24, 48, or 72UX Flow (Fixed)
First Capture (No Saved Preferences):
Second Capture (Has Saved Preferences):
Changing Default:
Auto-Posting Investigation
Original Report: "Sometimes I don't get an option when taking a pic and it automatically posts"
Root Causes Identified & Fixed:
whileTapwas consuming tap eventsonClassifyimmediatelyPrevention:
Technical Changes
ClassificationModal.tsx:
handleDiscountSelect: RemoveonClassifycall, add localStorage savehandleBidSelect: RemoveonClassifycall, add localStorage saveuseStateinitialization: Lazy load from localStoragelocalStorage Keys:
gotjunk_default_discount: "25" | "50" | "75"gotjunk_default_bid_duration: "24" | "48" | "72"Haptic Feedback:
[10, 50, 10](short buzz, pause, short buzz)Testing Required
Test 1: Long-Press Flow
Test 2: Defaults Persist
Test 3: Changing Defaults
Test 4: Bid Duration
Related PRs
Metrics
🤖 Generated with Claude Code
Co-Authored-By: Claude noreply@anthropic.com