Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions .Jules/changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,14 @@
## [Unreleased]

### Added
- **Mobile Skeleton Loading:** Added a skeleton loading state for the Groups list on the Home screen.
- **Features:**
- Created a generic `Skeleton` component using `react-native-reanimated` for smooth pulsing animations.
- Created a specific `GroupListSkeleton` that mimics the layout of the actual `HapticCard` list.
- Improved perceived performance and reduced layout shift when loading the home screen.
- Added proper accessibility labels (`progressbar` role) to the loading state.
- **Technical:** Created `mobile/components/ui/Skeleton.js` and `mobile/components/skeletons/GroupListSkeleton.js`. Integrated into `mobile/screens/HomeScreen.js`.

- **Password Strength Meter:** Added a visual password strength indicator to the signup form.
- **Features:**
- Real-time strength calculation (Length, Uppercase, Lowercase, Number, Symbol).
Expand Down
10 changes: 8 additions & 2 deletions .Jules/todo.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,9 @@
- Impact: Native feel, users can easily refresh data
- Size: ~150 lines

- [ ] **[ux]** Complete skeleton loading for HomeScreen groups
- File: `mobile/screens/HomeScreen.js`
- [x] **[ux]** Complete skeleton loading for HomeScreen groups
- Completed: 2026-04-07
- Files modified: `mobile/components/ui/Skeleton.js`, `mobile/components/skeletons/GroupListSkeleton.js`, `mobile/screens/HomeScreen.js`
- Context: Replace ActivityIndicator with skeleton group cards
- Impact: Better loading experience, less jarring
- Size: ~40 lines
Expand Down Expand Up @@ -143,6 +144,11 @@

## ✅ Completed Tasks

- [x] **[ux]** Complete skeleton loading for HomeScreen groups
- Completed: 2026-04-07
- Files modified: `mobile/components/ui/Skeleton.js`, `mobile/components/skeletons/GroupListSkeleton.js`, `mobile/screens/HomeScreen.js`
- Impact: Users now see a skeleton loading state instead of an activity indicator while groups are loading on the home screen.

- [x] **[ux]** Comprehensive empty states with illustrations
- Completed: 2026-01-01
- Files modified: `web/components/ui/EmptyState.tsx`, `web/pages/Groups.tsx`, `web/pages/Friends.tsx`
Expand Down
53 changes: 53 additions & 0 deletions mobile/components/skeletons/GroupListSkeleton.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
import React from 'react';
import { View, StyleSheet, ScrollView } from 'react-native';
import { Card } from 'react-native-paper';
import Skeleton from '../ui/Skeleton';

const GroupListSkeleton = () => {
// Array of 5 items to show while loading
const skeletonItems = Array.from({ length: 5 }, (_, i) => i);

return (
<View
style={styles.container}
accessible={true}
accessibilityRole="progressbar"
accessibilityLabel="Loading groups"
>
<ScrollView contentContainerStyle={styles.list}>
{skeletonItems.map((item) => (
<Card key={item} style={styles.card}>
<Card.Title
title={<Skeleton width={120} height={20} />}
left={(props) => (
<View {...props}>
<Skeleton width={40} height={40} borderRadius={20} />
</View>
)}
/>
<Card.Content>
<Skeleton width={150} height={16} style={styles.statusSkeleton} />
</Card.Content>
Comment on lines +20 to +30
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🧹 Nitpick | 🔵 Trivial

Skeleton layout may not match the actual card structure.

Looking at HomeScreen.js (lines 194-207 in context), the actual group cards use HapticCard.Title with a subtitle prop for the settlement status, not a separate Card.Content block. The skeleton here uses Card.Content which may cause a slight layout shift when data loads.

Consider using the subtitle prop on Card.Title to better match the actual layout:

♻️ Proposed fix to match actual card layout
           <Card key={item} style={styles.card}>
             <Card.Title
               title={<Skeleton width={120} height={20} />}
+              subtitle={<Skeleton width={150} height={16} style={styles.statusSkeleton} />}
               left={(props) => (
                 <View {...props}>
                   <Skeleton width={40} height={40} borderRadius={20} />
                 </View>
               )}
             />
-            <Card.Content>
-              <Skeleton width={150} height={16} style={styles.statusSkeleton} />
-            </Card.Content>
           </Card>
#!/bin/bash
# Verify the actual card structure in HomeScreen.js
echo "=== Checking HapticCard structure in HomeScreen.js ==="
rg -A 20 'HapticCard.Title' mobile/screens/HomeScreen.js
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@mobile/components/skeletons/GroupListSkeleton.js` around lines 20 - 30, The
skeleton layout uses a separate Card.Content block for the status which causes a
layout shift; update GroupListSkeleton.js to put the status Skeleton into the
Card.Title's subtitle prop (so Card.Title renders title={<Skeleton .../>}
subtitle={<Skeleton style={styles.statusSkeleton} .../>}) keep the existing
left={(props)=>...} avatar skeleton, and remove the Card.Content block; ensure
you use the same styles.statusSkeleton sizing and borderRadius as currently
defined so the skeleton matches the HapticCard.Title subtitle structure seen in
HomeScreen.js.

</Card>
))}
</ScrollView>
</View>
);
};

const styles = StyleSheet.create({
container: {
flex: 1,
},
list: {
padding: 16,
},
card: {
marginBottom: 16,
},
statusSkeleton: {
marginTop: 4,
},
});

export default GroupListSkeleton;
61 changes: 61 additions & 0 deletions mobile/components/ui/Skeleton.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
import React, { useEffect } from 'react';
import { View, StyleSheet } from 'react-native';
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🧹 Nitpick | 🔵 Trivial

Remove unused View import.

View is imported but not used in this component.

🧹 Proposed cleanup
-import { View, StyleSheet } from 'react-native';
+import { StyleSheet } from 'react-native';
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
import { View, StyleSheet } from 'react-native';
import { StyleSheet } from 'react-native';
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@mobile/components/ui/Skeleton.js` at line 2, The import line in the Skeleton
component unnecessarily includes View; remove View from the import statement
(i.e., change "import { View, StyleSheet } from 'react-native';" to only import
StyleSheet) so the unused symbol is not imported in the Skeleton component.

import Animated, {
useSharedValue,
useAnimatedStyle,
withRepeat,
withTiming,
withSequence,
cancelAnimation,
} from 'react-native-reanimated';
import { useTheme } from 'react-native-paper';

const Skeleton = ({ width, height, borderRadius = 4, style }) => {
const theme = useTheme();
const opacity = useSharedValue(0.3);

useEffect(() => {
opacity.value = withRepeat(
withSequence(
withTiming(0.7, { duration: 1000 }),
withTiming(0.3, { duration: 1000 })
),
-1,
true
);

return () => {
cancelAnimation(opacity);
};
}, []);

const animatedStyle = useAnimatedStyle(() => {
return {
opacity: opacity.value,
};
});

return (
<Animated.View
style={[
styles.skeleton,
{
width,
height,
borderRadius,
backgroundColor: theme.colors.surfaceVariant,
},
animatedStyle,
style,
]}
/>
);
};

const styles = StyleSheet.create({
skeleton: {
overflow: 'hidden',
},
});

export default Skeleton;
Loading
Loading