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 skeleton loading states for the HomeScreen group list.
- **Features:**
- Created generic `Skeleton` primitive with pulsing animation.
- Created `GroupListSkeleton` component matching `HapticCard` layout.
- Integrated into `HomeScreen` to replace simple spinner.
- Accessible with `accessibilityRole="progressbar"`.
- **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-09
- File: `mobile/screens/HomeScreen.js`
- Context: Replace ActivityIndicator with skeleton group cards
- Impact: Better loading experience, less jarring
Expand Down
67 changes: 67 additions & 0 deletions mobile/components/skeletons/GroupListSkeleton.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
import React from 'react';
import { View, StyleSheet, FlatList } from 'react-native';
import { Card } from 'react-native-paper';
import Skeleton from '../ui/Skeleton';

const GroupListSkeleton = () => {
const dummyData = [1, 2, 3, 4, 5]; // Render 5 skeleton items

const renderItem = () => (
<Card style={styles.card} mode="elevated">
<Card.Title
title={<Skeleton width={150} height={20} style={styles.skeletonTitle} />}
subtitle={<Skeleton width={100} height={16} style={styles.skeletonSubtitle} />}
left={(props) => (
<Skeleton
width={props.size}
height={props.size}
borderRadius={props.size / 2}
style={styles.skeletonAvatar}
/>
)}
/>
<Card.Content>
<Skeleton width={120} height={16} style={styles.skeletonStatus} />
</Card.Content>
</Card>
);

return (
<View style={styles.container} accessible={true} accessibilityLabel="Loading groups">
<FlatList
data={dummyData}
renderItem={renderItem}
keyExtractor={(item) => item.toString()}
contentContainerStyle={styles.list}
scrollEnabled={false} // Disable scrolling for skeleton state
/>
</View>
);
};

const styles = StyleSheet.create({
container: {
flex: 1,
},
list: {
padding: 16,
},
card: {
marginBottom: 16,
},
skeletonTitle: {
marginTop: 4,
marginBottom: 4,
},
skeletonSubtitle: {
marginTop: 4,
},
skeletonAvatar: {
marginRight: 8,
},
skeletonStatus: {
marginTop: 8,
}
});

export default GroupListSkeleton;
60 changes: 60 additions & 0 deletions mobile/components/ui/Skeleton.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
import React, { useEffect, useRef } from 'react';
import { Animated, StyleSheet } 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 animation = Animated.loop(
Animated.sequence([
Animated.timing(opacity, {
toValue: 1,
duration: 1000,
useNativeDriver: true,
}),
Animated.timing(opacity, {
toValue: 0.3,
duration: 1000,
useNativeDriver: true,
}),
])
);
animation.start();

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

return (
<Animated.View
style={[
{ opacity },
style,
]}
accessibilityRole="progressbar"
accessibilityLabel="Loading..."
>
Comment on lines +30 to +37
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 | 🟠 Major

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
# Check if files exist and examine the current Skeleton.js implementation
echo "=== Checking Skeleton.js ==="
if [ -f "mobile/components/ui/Skeleton.js" ]; then
  cat -n mobile/components/ui/Skeleton.js
else
  echo "File not found at mobile/components/ui/Skeleton.js"
  # Try to find it
  find . -name "Skeleton.js" -type f 2>/dev/null | head -10
fi

Repository: Devasy/splitwiser

Length of output: 1817


🏁 Script executed:

#!/bin/bash
# Check GroupListSkeleton.js
echo "=== Checking GroupListSkeleton.js ==="
if [ -f "mobile/components/skeletons/GroupListSkeleton.js" ]; then
  cat -n mobile/components/skeletons/GroupListSkeleton.js
else
  echo "File not found at mobile/components/skeletons/GroupListSkeleton.js"
  # Try to find it
  find . -name "GroupListSkeleton.js" -type f 2>/dev/null | head -10
fi

Repository: Devasy/splitwiser

Length of output: 2201


Do not announce each skeleton block as a progressbar.

Every Skeleton instance exposes itself as a separate progressbar with "Loading..." label via lines 35–36. In GroupListSkeleton.js, the renderItem() function creates 4 Skeleton instances per card (title, subtitle, avatar, status), which renders 5 times in a FlatList—resulting in 20 total progressbar announcements. This creates repetitive noise for screen-reader users and poor focus navigation, even though the container already has a high-level "Loading groups" announcement (line 30 of GroupListSkeleton).

Make this primitive decorative by default with accessibility opt-in only when needed.

Proposed fix
-const Skeleton = ({ width, height, borderRadius = 4, style }) => {
+const Skeleton = ({
+  width,
+  height,
+  borderRadius = 4,
+  style,
+  accessible = false,
+  accessibilityLabel,
+}) => {
@@
     <Animated.View
+      accessible={accessible}
       style={[
         { opacity },
         style,
       ]}
-      accessibilityRole="progressbar"
-      accessibilityLabel="Loading..."
+      accessibilityRole={accessible ? "progressbar" : undefined}
+      accessibilityLabel={accessible ? (accessibilityLabel || "Loading") : undefined}
     >
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@mobile/components/ui/Skeleton.js` around lines 30 - 37, The Skeleton
component is announcing every instance as a progressbar via the Animated.View
accessibilityRole and accessibilityLabel; change the primitive to be decorative
by default by removing or disabling those attributes and adding an explicit
opt-in prop (e.g., a boolean prop like announce or
accessibleLabel/announceAccessibility) that, when provided/true, sets
accessibilityRole="progressbar" and accessibilityLabel to the given string.
Update the Animated.View usage in Skeleton.js to default to non-accessible
(accessible={false} or omit accessibility props) and wire the new prop so
callers (only when needed) can opt-in to screen-reader announcements; update
GroupListSkeleton renderers to not opt-in so the high-level "Loading groups"
remains the single announcement.

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

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

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 @@ -10,6 +10,7 @@ import {
TextInput,
useTheme,
} from "react-native-paper";
import GroupListSkeleton from "../components/skeletons/GroupListSkeleton";
import HapticButton from '../components/ui/HapticButton';
import HapticCard from '../components/ui/HapticCard';
import { HapticAppbarAction } from '../components/ui/HapticAppbar';
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