Skip to content

Commit 49b4ec2

Browse files
Devasygoogle-labs-jules[bot]coderabbitai[bot]
authored
[jules] style: Add haptic feedback to all mobile buttons (#276)
* [jules] style: Add haptic feedback to all mobile buttons Co-authored-by: Devasy23 <110348311+Devasy23@users.noreply.github.com> * [jules] fix: Fix closing tag syntax error in FriendsScreen.js Co-authored-by: Devasy23 <110348311+Devasy23@users.noreply.github.com> * [jules] refactor: Use shared withHapticFeedback HOC Co-authored-by: Devasy23 <110348311+Devasy23@users.noreply.github.com> * Update mobile/components/ui/HapticMenu.js Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> --------- Co-authored-by: google-labs-jules[bot] <161369871+google-labs-jules[bot]@users.noreply.github.com> Co-authored-by: Devasy23 <110348311+Devasy23@users.noreply.github.com> Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
1 parent ffaa12c commit 49b4ec2

23 files changed

Lines changed: 240 additions & 94 deletions

.Jules/changelog.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,13 @@
77
## [Unreleased]
88

99
### Added
10+
- **Mobile Haptics:** Implemented system-wide haptic feedback for all interactive elements.
11+
- **Features:**
12+
- Created `HapticButton`, `HapticIconButton`, `HapticFAB`, `HapticCard`, `HapticList`, `HapticCheckbox`, `HapticMenu`, `HapticSegmentedButtons`, `HapticAppbar` (including `HapticAppbarAction`, `HapticAppbarBackAction`) wrappers.
13+
- Integrated into all screens (`Home`, `GroupDetails`, `AddExpense`, `Friends`, `Account`, `EditProfile`, `Login`, `Signup`, `JoinGroup`, `GroupSettings`, `SplitwiseImport`).
14+
- Uses `expo-haptics` with `Light` impact style for subtle feedback.
15+
- **Technical:** Centralized haptic logic in `mobile/components/ui/` to ensure consistency and maintainability.
16+
1017
- **Mobile Accessibility:** Completed accessibility audit for all mobile screens.
1118
- **Features:**
1219
- Added `accessibilityLabel` to all interactive elements (buttons, inputs, list items).

.Jules/todo.md

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -94,11 +94,12 @@
9494
- Size: ~55 lines
9595
- Added: 2026-01-01
9696

97-
- [ ] **[style]** Haptic feedback on all button presses
98-
- Files: All button interactions across mobile
99-
- Context: Add Expo.Haptics.impactAsync(Light) to buttons
100-
- Impact: Tactile feedback makes app feel responsive
101-
- Size: ~40 lines
97+
- [x] **[style]** Haptic feedback on all button presses
98+
- Completed: 2026-02-07
99+
- Files: `mobile/components/ui/Haptic*.js`, `mobile/screens/*.js`
100+
- Context: Created comprehensive Haptic UI system wrapping React Native Paper components
101+
- Impact: Tactile feedback makes app feel responsive and native
102+
- Size: ~400 lines
102103
- Added: 2026-01-01
103104

104105
---
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
import { Appbar } from 'react-native-paper';
2+
import { withHapticFeedback } from './hapticUtils';
3+
4+
const HapticAppbarAction = withHapticFeedback(Appbar.Action);
5+
const HapticAppbarBackAction = withHapticFeedback(Appbar.BackAction);
6+
7+
export { HapticAppbarAction, HapticAppbarBackAction };
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
import { Button } from 'react-native-paper';
2+
import { withHapticFeedback } from './hapticUtils';
3+
4+
const HapticButton = withHapticFeedback(Button);
5+
6+
export default HapticButton;

mobile/components/ui/HapticCard.js

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
import { Card } from 'react-native-paper';
2+
import { withHapticFeedback } from './hapticUtils';
3+
4+
const HapticCard = withHapticFeedback(Card, { onlyWhenHandler: true });
5+
6+
// Attach subcomponents
7+
HapticCard.Content = Card.Content;
8+
HapticCard.Actions = Card.Actions;
9+
HapticCard.Cover = Card.Cover;
10+
HapticCard.Title = Card.Title;
11+
12+
export default HapticCard;
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
import { Checkbox } from 'react-native-paper';
2+
import { withHapticFeedback } from './hapticUtils';
3+
4+
const HapticCheckboxItem = withHapticFeedback(Checkbox.Item);
5+
6+
export default HapticCheckboxItem;

mobile/components/ui/HapticFAB.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
import { FAB } from 'react-native-paper';
2+
import { withHapticFeedback } from './hapticUtils';
3+
4+
const HapticFAB = withHapticFeedback(FAB);
5+
6+
export default HapticFAB;
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
import { IconButton } from 'react-native-paper';
2+
import { withHapticFeedback } from './hapticUtils';
3+
4+
const HapticIconButton = withHapticFeedback(IconButton);
5+
6+
export default HapticIconButton;

mobile/components/ui/HapticList.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
import { List } from 'react-native-paper';
2+
import { withHapticFeedback } from './hapticUtils';
3+
4+
const HapticListItem = withHapticFeedback(List.Item, { onlyWhenHandler: true });
5+
const HapticListAccordion = withHapticFeedback(List.Accordion, { onlyWhenHandler: true });
6+
7+
export { HapticListItem, HapticListAccordion };

mobile/components/ui/HapticMenu.js

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
import React from 'react';
2+
import { Menu } from 'react-native-paper';
3+
import { withHapticFeedback } from './hapticUtils';
4+
5+
const HapticMenuItem = withHapticFeedback(Menu.Item);
6+
7+
const HapticMenu = React.forwardRef(({ children, ...props }, ref) => {
8+
return <Menu ref={ref} {...props}>{children}</Menu>;
9+
});
10+
HapticMenu.displayName = 'HapticMenu';
11+
12+
HapticMenu.Item = HapticMenuItem;
13+
14+
export default HapticMenu;

0 commit comments

Comments
 (0)