-
Notifications
You must be signed in to change notification settings - Fork 23
Mobile: Add Pull-to-Refresh with Haptics #268
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
vrajpatelll
merged 5 commits into
main
from
jules-mobile-pull-to-refresh-14011509928752649065
Jan 30, 2026
Merged
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
7188da9
[jules] enhance: Add pull-to-refresh with haptics to mobile lists
google-labs-jules[bot] ce3c20a
[jules] fix: Resolve backend test failures due to incorrect mocking
google-labs-jules[bot] 1c9b25a
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] 4f1a892
[jules] fix: Correct argument unpacking in aggregation test assertion
google-labs-jules[bot] 4840434
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
Large diffs are not rendered by default.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
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
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
Oops, something went wrong.
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🧩 Analysis chain
🏁 Script executed:
Repository: Devasy/splitwiser
Length of output: 101
🏁 Script executed:
sed -n '50,70p' mobile/screens/GroupDetailsScreen.jsRepository: Devasy/splitwiser
Length of output: 661
🏁 Script executed:
sed -n '1,30p' mobile/screens/GroupDetailsScreen.jsRepository: Devasy/splitwiser
Length of output: 1025
🏁 Script executed:
rg -n "onRefresh" mobile/screens/GroupDetailsScreen.jsRepository: Devasy/splitwiser
Length of output: 135
🏁 Script executed:
rg -n "Haptics" mobile/screens/ -A 2 -B 2Repository: Devasy/splitwiser
Length of output: 2227
🏁 Script executed:
sed -n '40,55p' mobile/screens/GroupDetailsScreen.jsRepository: Devasy/splitwiser
Length of output: 671
🏁 Script executed:
Repository: Devasy/splitwiser
Length of output: 162
🌐 Web query:
expo-haptics impactAsync can it reject throw error💡 Result:
Yes.
expo-haptics’sHaptics.impactAsync()returns aPromise<void>and it can reject (throw) in at least these cases:UnavailabilityErrorif it doesn’t exist, which rejects the promise. (In current source it checksExpoHaptics.impactAsyncand throws if missing.) [2]awaits the native module call, so any native-side error would also reject the promise. [2]The official docs only state that it “fulfills once native haptics functionality is triggered” and don’t enumerate errors, but it is still a Promise and (per the implementation) can reject as above. [1][2]
Practical usage: wrap it in
try/catchif you need to be safe on all platforms/builds. [1][2]Sources: Expo docs for
impactAsync()[1],expo-hapticsimplementation (Haptics.ts) [2].Harden refresh flow against haptics failures.
Haptics.impactAsynccan reject if haptics is unavailable on the platform or if the native call fails. If it rejects,fetchDatais never called andisRefreshingremains true, leaving the UI in a stuck state. Wrap intry/finallyand use.catch()to suppress haptics errors so the refresh flow always completes.✅ Suggested fix
const onRefresh = async () => { setIsRefreshing(true); - await Haptics.impactAsync(Haptics.ImpactFeedbackStyle.Light); - await fetchData(false); - setIsRefreshing(false); + try { + await Haptics.impactAsync(Haptics.ImpactFeedbackStyle.Light).catch(() => {}); + await fetchData(false); + } finally { + setIsRefreshing(false); + } };🤖 Prompt for AI Agents