From 52c8eba74e6774af7783e8023a31f4bc6967f53f Mon Sep 17 00:00:00 2001
From: "google-labs-jules[bot]"
<161369871+google-labs-jules[bot]@users.noreply.github.com>
Date: Sat, 4 Apr 2026 20:12:39 +0000
Subject: [PATCH] [jules] enhance: Add skeleton loading state for HomeScreen
groups
- Created reusable `Skeleton` UI primitive with `Animated.loop`.
- Created `GroupListSkeleton` to match actual group card layout.
- Replaced generic `ActivityIndicator` in `HomeScreen` with skeleton loading.
- Optimized accessibility by adding `accessibilityRole="progressbar"` to the skeleton container.
Co-authored-by: Devasy23 <110348311+Devasy23@users.noreply.github.com>
---
.Jules/changelog.md | 7 +++
.Jules/todo.md | 6 +-
.../components/skeletons/GroupListSkeleton.js | 43 +++++++++++++++
mobile/components/ui/Skeleton.js | 55 +++++++++++++++++++
mobile/screens/HomeScreen.js | 6 +-
5 files changed, 112 insertions(+), 5 deletions(-)
create mode 100644 mobile/components/skeletons/GroupListSkeleton.js
create mode 100644 mobile/components/ui/Skeleton.js
diff --git a/.Jules/changelog.md b/.Jules/changelog.md
index 11fc864..f6e6c7d 100644
--- a/.Jules/changelog.md
+++ b/.Jules/changelog.md
@@ -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).
diff --git a/.Jules/todo.md b/.Jules/todo.md
index ebb0c7a..03dec77 100644
--- a/.Jules/todo.md
+++ b/.Jules/todo.md
@@ -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
- File: `mobile/screens/HomeScreen.js`
- Context: Replace ActivityIndicator with skeleton group cards
- Impact: Better loading experience, less jarring
diff --git a/mobile/components/skeletons/GroupListSkeleton.js b/mobile/components/skeletons/GroupListSkeleton.js
new file mode 100644
index 0000000..44eb726
--- /dev/null
+++ b/mobile/components/skeletons/GroupListSkeleton.js
@@ -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 (
+
+ {Array.from({ length: count }).map((_, index) => (
+
+ }
+ left={() => }
+ />
+
+
+
+
+
+
+ ))}
+
+ );
+};
+
+const styles = StyleSheet.create({
+ container: {
+ padding: 16,
+ },
+ card: {
+ marginBottom: 16,
+ },
+ contentRow: {
+ marginTop: 4,
+ },
+});
+
+export default GroupListSkeleton;
diff --git a/mobile/components/ui/Skeleton.js b/mobile/components/ui/Skeleton.js
new file mode 100644
index 0000000..c9afea8
--- /dev/null
+++ b/mobile/components/ui/Skeleton.js
@@ -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 (
+
+ );
+};
+
+const styles = StyleSheet.create({
+ skeleton: {
+ overflow: 'hidden',
+ },
+});
+
+export default Skeleton;
diff --git a/mobile/screens/HomeScreen.js b/mobile/screens/HomeScreen.js
index d2f3c38..8ec27f1 100644
--- a/mobile/screens/HomeScreen.js
+++ b/mobile/screens/HomeScreen.js
@@ -1,7 +1,6 @@
import { useContext, useEffect, useState } from "react";
import { Alert, FlatList, RefreshControl, StyleSheet, View } from "react-native";
import {
- ActivityIndicator,
Appbar,
Avatar,
Modal,
@@ -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);
@@ -257,9 +257,7 @@ const HomeScreen = ({ navigation }) => {
{isLoading ? (
-
-
-
+
) : (