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:** Implemented pulsing skeleton loading state for the Home Screen group list.
- **Features:**
- Created reusable `Skeleton` component with pulsing animation using `Animated` and `useTheme`.
- Created `GroupListSkeleton` to mimic the layout of group cards (Avatar + Title + Subtitle).
- Integrated into `HomeScreen.js` to replace the generic `ActivityIndicator`.
- Matches layout metrics to prevent content jumping.
- **Technical:** Created `mobile/components/ui/Skeleton.js` and `mobile/components/skeletons/GroupListSkeleton.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
3 changes: 2 additions & 1 deletion .Jules/todo.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,8 @@
- 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-02-18
- File: `mobile/screens/HomeScreen.js`
- Context: Replace ActivityIndicator with skeleton group cards
- Impact: Better loading experience, less jarring
Expand Down
39 changes: 39 additions & 0 deletions mobile/components/skeletons/GroupListSkeleton.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
import React from 'react';
import { View, StyleSheet } from 'react-native';
import { Card } from 'react-native-paper';
import Skeleton from '../ui/Skeleton';

const GroupListSkeleton = () => {
// Create an array of 5 items to mimic a list
const items = Array.from({ length: 5 }, (_, i) => i);

return (
<View style={styles.container}>
{items.map((key) => (
<Card key={key} style={styles.card}>
<Card.Title
title={<Skeleton width={150} height={20} />}
left={() => <Skeleton width={40} height={40} borderRadius={20} />}
/>
Comment on lines +14 to +17
Copy link
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor

🧩 Analysis chain

🌐 Web query:

react-native-paper Card.Title left callback props style size v5

💡 Result:

In react-native-paper v5, Card.Title’s left prop is a callback that receives an object with a single field: size: number. You render your avatar/icon using that size (and optionally add your own styles). (oss.callstack.com)

Type

Related styling props

  • leftStyle?: StyleProp<ViewStyle> – styles the left-element wrapper (oss.callstack.com)
  • style?: StyleProp<ViewStyle> – styles the Card.Title container (oss.callstack.com)

Example

<Card.Title
  title="Card Title"
  left={({ size }) => (
    <Avatar.Icon size={size} icon="folder" />
  )}
  leftStyle={{ marginRight: 8 }}
/>

(oss.callstack.com)

Citations:


Use the provided size prop in the left callback for proper avatar alignment.

In react-native-paper v5, the Card.Title left callback receives only { size: number } and should use it to dimension the skeleton. The current code with hardcoded dimensions may misalign compared to real list items.

💡 Proposed fix
          <Card.Title
            title={<Skeleton width={150} height={20} />}
-           left={() => <Skeleton width={40} height={40} borderRadius={20} />}
+           left={({ size }) => (
+             <Skeleton
+               width={size}
+               height={size}
+               borderRadius={size / 2}
+             />
+           )}
          />
📝 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
<Card.Title
title={<Skeleton width={150} height={20} />}
left={() => <Skeleton width={40} height={40} borderRadius={20} />}
/>
<Card.Title
title={<Skeleton width={150} height={20} />}
left={({ size }) => (
<Skeleton
width={size}
height={size}
borderRadius={size / 2}
/>
)}
/>
🤖 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 14 - 17, The
Card.Title left callback currently uses hardcoded dimensions for the avatar
Skeleton; update the left prop in GroupListSkeleton (the Card.Title left
callback) to accept the { size } argument and pass that size to the Skeleton
(both width/height and borderRadius if appropriate) so the skeleton avatar
matches the Card.Title avatar sizing in react-native-paper v5.

<Card.Content>
<Skeleton width="100%" height={16} style={styles.subtitle} />
</Card.Content>
</Card>
))}
</View>
);
};

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

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

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

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

loop.start();

return () => loop.stop();
}, [opacity]);

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

export default Skeleton;
5 changes: 2 additions & 3 deletions mobile/screens/HomeScreen.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import {
import HapticButton from '../components/ui/HapticButton';
import HapticCard from '../components/ui/HapticCard';
import { HapticAppbarAction } from '../components/ui/HapticAppbar';
import GroupListSkeleton from '../components/skeletons/GroupListSkeleton';
import * as Haptics from "expo-haptics";
import { createGroup, getGroups, getOptimizedSettlements } from "../api/groups";
import { AuthContext } from "../context/AuthContext";
Expand Down Expand Up @@ -257,9 +258,7 @@ const HomeScreen = ({ navigation }) => {
</Appbar.Header>

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