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
7 changes: 7 additions & 0 deletions .Jules/changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,13 @@
## [Unreleased]

### Added
- **Mobile Skeleton Loading States:** Replaced generic activity indicators with animated skeleton layouts on the HomeScreen.
- **Features:**
- Created reusable pulsing `Skeleton` UI primitive.
- Created `GroupListSkeleton` to match actual group card layout.
- Reduced layout shift during data fetching.
- Optimized accessibility for screen readers (`role="progressbar"`, container-level labels to minimize noise).
- **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
6 changes: 5 additions & 1 deletion .Jules/todo.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,11 @@
- Impact: Native feel, users can easily refresh data
- Size: ~150 lines

- [ ] **[ux]** Complete skeleton loading for HomeScreen groups
- [x] **[ux]** Complete skeleton loading for HomeScreen groups
- Completed: 2026-04-04
- Files: `mobile/components/ui/Skeleton.js`, `mobile/components/skeletons/GroupListSkeleton.js`, `mobile/screens/HomeScreen.js`
- Context: Replaced ActivityIndicator with pulsing skeleton group cards
- Impact: Better loading experience, less jarring
Comment on lines +60 to +64
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.

⚠️ Potential issue | 🟡 Minor

Remove duplicated metadata for the completed task entry.

This task now has two overlapping detail blocks; keep a single canonical block to prevent future inconsistency.

🧹 Proposed cleanup
 - [x] **[ux]** Complete skeleton loading for HomeScreen groups
   - Completed: 2026-04-04
   - Files: `mobile/components/ui/Skeleton.js`, `mobile/components/skeletons/GroupListSkeleton.js`, `mobile/screens/HomeScreen.js`
   - Context: Replaced ActivityIndicator with pulsing skeleton group cards
   - Impact: Better loading experience, less jarring
-  - File: `mobile/screens/HomeScreen.js`
-  - Context: Replace ActivityIndicator with skeleton group cards
-  - Impact: Better loading experience, less jarring
-  - Size: ~40 lines
-  - Added: 2026-01-01
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In @.Jules/todo.md around lines 60 - 64, Remove the duplicated metadata block
for the completed task "- [x] **[ux]** Complete skeleton loading for HomeScreen
groups" so only a single canonical detail block remains; find the two
overlapping detail sections that list "Completed: 2026-04-04", "Files:
`mobile/components/ui/Skeleton.js`,
`mobile/components/skeletons/GroupListSkeleton.js`,
`mobile/screens/HomeScreen.js`", "Context: Replaced ActivityIndicator with
pulsing skeleton group cards" and "Impact: Better loading experience, less
jarring", delete the redundant one and ensure the remaining block contains all
four metadata lines exactly once.

- File: `mobile/screens/HomeScreen.js`
- Context: Replace ActivityIndicator with skeleton group cards
- Impact: Better loading experience, less jarring
Expand Down
43 changes: 43 additions & 0 deletions mobile/components/skeletons/GroupListSkeleton.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
import React from 'react';
import { View, StyleSheet } from 'react-native';
import { Card } from 'react-native-paper';
import Skeleton from '../ui/Skeleton';

const GroupListSkeleton = ({ count = 4 }) => {
return (
<View
accessible={true}
accessibilityRole="progressbar"
accessibilityLabel="Loading groups"
style={styles.container}
>
{Array.from({ length: count }).map((_, index) => (
<Card key={`group-skeleton-${index}`} style={styles.card}>
<Card.Title
title={<Skeleton width={150} height={20} />}
left={() => <Skeleton width={40} height={40} borderRadius={20} />}
/>
<Card.Content>
<View style={styles.contentRow}>
<Skeleton width={120} height={16} />
</View>
</Card.Content>
</Card>
))}
</View>
);
};

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

export default GroupListSkeleton;
55 changes: 55 additions & 0 deletions mobile/components/ui/Skeleton.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
import React, { useEffect, useRef } from 'react';
import { Animated, View, StyleSheet } from 'react-native';
import { useTheme } from 'react-native-paper';

const Skeleton = ({ width, height, borderRadius = 4, style }) => {
const theme = useTheme();
const animatedValue = useRef(new Animated.Value(0.3)).current;

useEffect(() => {
const animation = Animated.loop(
Animated.sequence([
Animated.timing(animatedValue, {
toValue: 0.7,
duration: 1000,
useNativeDriver: true,
}),
Animated.timing(animatedValue, {
toValue: 0.3,
duration: 1000,
useNativeDriver: true,
}),
])
);

animation.start();

return () => {
animation.stop();
};
}, [animatedValue]);

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

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

export default Skeleton;
6 changes: 2 additions & 4 deletions mobile/screens/HomeScreen.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import { useContext, useEffect, useState } from "react";
import { Alert, FlatList, RefreshControl, StyleSheet, View } from "react-native";
import {
ActivityIndicator,
Appbar,
Avatar,
Modal,
Expand All @@ -17,6 +16,7 @@ import * as Haptics from "expo-haptics";
import { createGroup, getGroups, getOptimizedSettlements } from "../api/groups";
import { AuthContext } from "../context/AuthContext";
import { formatCurrency, getCurrencySymbol } from "../utils/currency";
import GroupListSkeleton from "../components/skeletons/GroupListSkeleton";

const HomeScreen = ({ navigation }) => {
const { token, logout, user } = useContext(AuthContext);
Expand Down Expand Up @@ -257,9 +257,7 @@ const HomeScreen = ({ navigation }) => {
</Appbar.Header>

{isLoading ? (
<View style={styles.loaderContainer}>
<ActivityIndicator size="large" />
</View>
<GroupListSkeleton count={4} />
) : (
<FlatList
data={groups}
Expand Down
Loading