Skip to content

🎨 Palette: Add haptic feedback to flight card swipe#60

Open
TargetMisser wants to merge 2 commits intomainfrom
palette/haptic-feedback-swipe-11524619721532182718
Open

🎨 Palette: Add haptic feedback to flight card swipe#60
TargetMisser wants to merge 2 commits intomainfrom
palette/haptic-feedback-swipe-11524619721532182718

Conversation

@TargetMisser
Copy link
Copy Markdown
Owner

Added haptic feedback to the flight card swipe action to provide tactile confirmation when the pinning threshold is reached. This improvement makes the interaction feel more deliberate and responsive.


PR created automatically by Jules for task 11524619721532182718 started by @TargetMisser

- Integrated expo-haptics in SwipeableFlightCard
- Added light haptic impact when swipe threshold is reached
- Managed gesture state with useRef to ensure single trigger per crossing
- Documented pattern in .Jules/palette.md

Co-authored-by: TargetMisser <52361977+TargetMisser@users.noreply.github.com>
@google-labs-jules
Copy link
Copy Markdown

👋 Jules, reporting for duty! I'm here to lend a hand with this pull request.

When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down.

I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job!

For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with @jules. You can find this option in the Pull Request section of your global Jules UI settings. You can always switch back!

New to Jules? Learn more at jules.google/docs.


For security, I will only act on instructions from the user who triggered this task.

@vercel
Copy link
Copy Markdown

vercel bot commented Apr 8, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
flight-work-app Ready Ready Preview, Comment, Open in v0 Apr 8, 2026 1:05am

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds haptic feedback during the flight card swipe gesture to provide tactile confirmation when the pin/unpin threshold is crossed.

Changes:

  • Integrates expo-haptics into SwipeableFlightCard to trigger a light impact when the swipe threshold is reached.
  • Tracks a per-gesture “already triggered” flag and resets it on release/termination to avoid repeated firing within a single continuous swipe.
  • Adds a .Jules/palette.md note documenting the approach.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

File Description
src/screens/FlightScreen.tsx Triggers a one-time haptic when the swipe crosses the pinning threshold and resets the trigger on gesture end/cancel.
.Jules/palette.md Adds an internal note describing the haptics pattern used for continuous gestures.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

onPanResponderMove: (_, g) => {
if (g.dx < 0) translateX.setValue(g.dx);
if (g.dx <= -SWIPE_THRESHOLD && !hasTriggeredHaptic.current) {
Haptics.impactAsync(Haptics.ImpactFeedbackStyle.Light);
Copy link

Copilot AI Apr 8, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Haptics.impactAsync(...) returns a Promise, but it’s being fired-and-forgotten inside onPanResponderMove. If the call rejects (e.g., unsupported platform/runtime), this can surface as an unhandled promise rejection. Consider explicitly swallowing/handling errors (e.g., attach .catch(() => {}) or wrap in a safe helper) so gesture handling can’t trigger runtime warnings/crashes.

Suggested change
Haptics.impactAsync(Haptics.ImpactFeedbackStyle.Light);
Haptics.impactAsync(Haptics.ImpactFeedbackStyle.Light).catch(() => {});

Copilot uses AI. Check for mistakes.
Comment on lines +1 to +3
## 2026-04-08 - Haptic feedback for continuous gestures
**Learning:** When implementing haptic feedback with 'expo-haptics' in continuous gestures (like 'PanResponder'), use a 'useRef' toggle (e.g., 'hasTriggeredHaptic') to ensure the feedback triggers only once when a threshold is crossed.
**Action:** Always include a reset of the haptic trigger ref in both completion ('onPanResponderRelease') and cancellation ('onPanResponderTerminate') handlers.
Copy link

Copilot AI Apr 8, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This PR adds a new .Jules/palette.md note file that isn’t mentioned in the PR description and looks like automation/internal “learning” documentation. If this isn’t intended to ship with the app, consider removing it from the PR (or adding .Jules/ to .gitignore / moving this guidance into an appropriate docs location).

Copilot uses AI. Check for mistakes.
- Implemented light haptic impact when swipe threshold is reached in SwipeableFlightCard.
- Managed gesture state with useRef to ensure single trigger per crossing.
- Documented pattern in .Jules/palette.md.
- Updated package-lock.json to resolve CI installation errors.

Co-authored-by: TargetMisser <52361977+TargetMisser@users.noreply.github.com>
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