Skip to content

fix: properly merge PR #415 tap & hold feature#419

Merged
masonfox merged 1 commit into
developfrom
fix/pr-415-cherry-pick
Apr 16, 2026
Merged

fix: properly merge PR #415 tap & hold feature#419
masonfox merged 1 commit into
developfrom
fix/pr-415-cherry-pick

Conversation

@masonfox
Copy link
Copy Markdown
Owner

Summary

Fixes PR #415 which was marked as MERGED in GitHub but the commits never actually made it into the develop branch. This PR cherry-picks the three orphaned feature commits to restore the tap & hold to select functionality.

Problem: PR #415 shows as merged, but the feature code is missing from develop (except for useLongPress.ts which was added separately in commit 9f2ca50).

Solution: Cherry-picked the three orphaned commits and squashed them into a single commit with proper attribution.


Changes

Modified Files (5)

  1. hooks/useBookListView.ts - Added enterSelectModeWithSelection() function
  2. components/Books/BookListItem.tsx - Integrated useLongPress hook + keyboard accessibility
  3. components/Books/DraggableBookList.tsx - Added long-press props and wiring
  4. app/shelves/[id]/page.tsx - Wired up long-press handlers to list views

New Files (1)

  1. __tests__/hooks/useLongPress.test.ts - Comprehensive test suite (22 tests)

Note: hooks/useLongPress.ts already existed on develop (added by commit 9f2ca50) and matches the final PR version, so it was kept unchanged.


Feature: Tap & Hold to Select

Implements long-press gesture to enter select mode on shelf items, eliminating the need to scroll to the top to press the "Select" button.

Key Features:

  • Long-press (500ms) on book card body enters select mode and auto-selects the item
  • Separate touch targets: drag handle (200ms) vs card body (500ms) to avoid conflicts
  • 10px movement tolerance to prevent activation during scrolling
  • Keyboard accessibility: Space and Enter keys trigger selection
  • ARIA attributes for screen readers
  • Mobile-focused UX improvement

Behavior:

  1. User long-presses on book card (NOT in select mode)
  2. After 500ms: enters select mode + selects that book
  3. BulkActionBar appears at bottom
  4. User can tap other books to select/deselect
  5. Existing "Select" button still works

Testing

All 4044 tests pass (includes 22 new useLongPress tests)
Build succeeds with no TypeScript errors

Test Coverage

  • Mouse events (down, up, move, leave)
  • Touch events (start, end, cancel, move)
  • Keyboard events (Space, Enter)
  • Movement tolerance (cancels when exceeding 10px)
  • Configurable delay and tolerance options
  • Memory leak prevention (cleanup on unmount)
  • ARIA attributes for accessibility

Original Commits

This PR incorporates the following orphaned commits:

  • b88e3fc - feat: implement tap & hold to select shelf items
  • 990c8aa - fix: implement @review feedback (iteration 1)
  • f623bb4 - fix: add onTouchCancel handler and Enter key accessibility support

References

Resolves: #414
Fixes: #415

PR #415 was marked as merged but commits never made it to develop branch.
Cherry-picked the three feature commits to restore functionality:

- Add enterSelectModeWithSelection to useBookListView
- Integrate useLongPress hook in BookListItem
- Wire up long-press handlers in DraggableBookList and shelves page
- Add keyboard accessibility (Space/Enter keys)
- Add comprehensive test coverage (22 tests)

Note: hooks/useLongPress.ts already existed on develop from commit 9f2ca50
and matches the final PR version, so it was kept unchanged.

Original commits:
- b88e3fc feat: implement tap & hold to select shelf items
- 990c8aa fix: implement @review feedback (iteration 1)
- f623bb4 fix: add onTouchCancel handler and Enter key accessibility support

Resolves #414
Fixes #415

Co-authored-by: OpenCode <assistant@opencode.ai>
@codecov
Copy link
Copy Markdown

codecov Bot commented Apr 16, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.

Impacted file tree graph

@@             Coverage Diff             @@
##           develop     #419      +/-   ##
===========================================
+ Coverage    78.70%   78.82%   +0.12%     
===========================================
  Files          167      168       +1     
  Lines         7559     7607      +48     
  Branches      1850     1860      +10     
===========================================
+ Hits          5949     5996      +47     
  Misses        1127     1127              
- Partials       483      484       +1     
Flag Coverage Δ
unittests 78.82% <ø> (+0.12%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.
see 1 file with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@masonfox
Copy link
Copy Markdown
Owner Author

@copilot /review

Copy link
Copy Markdown
Contributor

Copilot AI commented Apr 16, 2026

@copilot /review

Ran review checks on commit 3409496: PR workflow run 24510256705 is green (tests + Docker build), targeted long-press tests pass locally (22/22), and build succeeds. No additional code changes were required.

UI screenshot: N/A (no UI changes made in this review pass).

@masonfox masonfox merged commit d8fa6e1 into develop Apr 16, 2026
4 of 5 checks passed
@masonfox masonfox deleted the fix/pr-415-cherry-pick branch April 16, 2026 12:44
Copilot stopped work on behalf of masonfox due to an error April 16, 2026 12:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants