Skip to content

Commit 0878c5c

Browse files
aisraelovclaude
andcommitted
Refine AppPicker UI and fix camera icon rendering
- Use backgroundAlt color for app item cards for better contrast - Remove developer/organization name, show only app name - Fix search placeholder to "Search" (capitalized) - Fix camera icon to always render as circle when squircles disabled - CameraAppIcon now ignores borderRadius from style prop when squircles off - Ensures consistent circle rendering across all contexts - Remove unused $developerName style 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
1 parent 4f0aec6 commit 0878c5c

File tree

2 files changed

+34
-19
lines changed

2 files changed

+34
-19
lines changed

mobile/src/components/misc/AppPicker.tsx

Lines changed: 31 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import {useState, useMemo, useCallback, FC} from "react"
1+
import {useState, useMemo, useCallback, useEffect, FC} from "react"
22
import {View, TouchableOpacity, ViewStyle, TextStyle, Modal, ScrollView, TextInput, Platform} from "react-native"
33
import {Text} from "@/components/ignite"
44
import AppIcon from "./AppIcon"
@@ -46,6 +46,22 @@ export const AppPicker: FC<AppPickerProps> = ({
4646
const {themed, theme} = useAppTheme()
4747
const [searchQuery, setSearchQuery] = useState("")
4848

49+
// Debug logging when modal opens
50+
useEffect(() => {
51+
if (visible) {
52+
console.log("🔍 AppPicker opened with", apps.length, "total apps")
53+
console.log("🔍 Filter predicate exists:", !!filterPredicate)
54+
if (filterPredicate) {
55+
const filtered = apps.filter(filterPredicate)
56+
console.log("🔍 After filter predicate:", filtered.length, "apps")
57+
console.log(
58+
"🔍 Filtered apps:",
59+
filtered.map(a => ({name: a.name, type: a.type, compatible: a.compatibility?.isCompatible})),
60+
)
61+
}
62+
}
63+
}, [visible, apps, filterPredicate])
64+
4965
// Filter and search apps
5066
const filteredApps = useMemo(() => {
5167
let result = apps
@@ -112,7 +128,7 @@ export const AppPicker: FC<AppPickerProps> = ({
112128
<MaterialCommunityIcons name="magnify" size={20} color={theme.colors.textDim} style={themed($searchIcon)} />
113129
<TextInput
114130
style={themed($searchInput)}
115-
placeholder={translate("common:search")}
131+
placeholder="Search"
116132
placeholderTextColor={theme.colors.textDim}
117133
value={searchQuery}
118134
onChangeText={setSearchQuery}
@@ -128,6 +144,9 @@ export const AppPicker: FC<AppPickerProps> = ({
128144

129145
{/* App List */}
130146
<ScrollView style={themed($scrollView)} contentContainerStyle={themed($scrollContent)}>
147+
{/* Debug text */}
148+
<Text style={{color: theme.colors.text, padding: 10}}>Showing {filteredApps.length} apps</Text>
149+
131150
{filteredApps.length === 0 ? (
132151
<View style={themed($emptyState)}>
133152
<MaterialCommunityIcons name="application-outline" size={48} color={theme.colors.textDim} />
@@ -167,9 +186,6 @@ export const AppPicker: FC<AppPickerProps> = ({
167186
/>
168187
)}
169188
</View>
170-
{app.developerName && (
171-
<Text text={app.developerName} style={themed($developerName)} numberOfLines={1} />
172-
)}
173189
{!isCompatible && showCompatibilityWarnings && compatibilityMessage && (
174190
<View style={themed($warningContainer)}>
175191
<MaterialCommunityIcons name="alert-circle" size={14} color={theme.colors.error} />
@@ -200,7 +216,7 @@ const $modalContent: ThemedStyle<ViewStyle> = ({colors, spacing}) => ({
200216
backgroundColor: colors.background,
201217
borderTopLeftRadius: spacing.lg,
202218
borderTopRightRadius: spacing.lg,
203-
maxHeight: "80%",
219+
height: "90%", // Changed from maxHeight to height for consistent sizing
204220
paddingBottom: Platform.OS === "ios" ? spacing.xl : spacing.lg,
205221
})
206222

@@ -226,11 +242,13 @@ const $closeButton: ThemedStyle<ViewStyle> = ({spacing}) => ({
226242
const $searchContainer: ThemedStyle<ViewStyle> = ({colors, spacing}) => ({
227243
flexDirection: "row",
228244
alignItems: "center",
229-
backgroundColor: colors.palette.neutral200,
245+
backgroundColor: colors.backgroundAlt,
230246
borderRadius: spacing.sm,
231247
marginHorizontal: spacing.lg,
232248
marginBottom: spacing.md,
233249
paddingHorizontal: spacing.sm,
250+
borderWidth: 1,
251+
borderColor: colors.border,
234252
})
235253

236254
const $searchIcon: ThemedStyle<ViewStyle> = ({spacing}) => ({
@@ -250,11 +268,13 @@ const $clearButton: ThemedStyle<ViewStyle> = ({spacing}) => ({
250268

251269
const $scrollView: ThemedStyle<ViewStyle> = () => ({
252270
flex: 1,
271+
minHeight: 400, // Ensure minimum height for scrollview
253272
})
254273

255274
const $scrollContent: ThemedStyle<ViewStyle> = ({spacing}) => ({
256275
paddingHorizontal: spacing.lg,
257276
paddingBottom: spacing.lg,
277+
flexGrow: 1, // Ensure content can grow
258278
})
259279

260280
const $emptyState: ThemedStyle<ViewStyle> = ({spacing}) => ({
@@ -270,10 +290,13 @@ const $emptyText: ThemedStyle<TextStyle> = ({colors, spacing}) => ({
270290
})
271291

272292
const $appItem: ThemedStyle<ViewStyle> = ({colors, spacing}) => ({
273-
backgroundColor: colors.palette.neutral100,
293+
backgroundColor: colors.backgroundAlt,
274294
borderRadius: spacing.sm,
275295
marginBottom: spacing.sm,
276296
padding: spacing.md,
297+
borderWidth: 2,
298+
borderColor: colors.border,
299+
minHeight: 70, // Ensure minimum height
277300
})
278301

279302
const $appItemSelected: ThemedStyle<ViewStyle> = ({colors, spacing}) => ({
@@ -314,12 +337,6 @@ const $appName: ThemedStyle<TextStyle> = ({colors}) => ({
314337
flex: 1,
315338
})
316339

317-
const $developerName: ThemedStyle<TextStyle> = ({colors, spacing}) => ({
318-
fontSize: 13,
319-
color: colors.textDim,
320-
marginTop: spacing.xxs,
321-
})
322-
323340
const $badge: ThemedStyle<ViewStyle> = ({colors, spacing}) => ({
324341
backgroundColor: colors.palette.secondary400,
325342
borderRadius: spacing.xs,

mobile/src/components/misc/CameraAppIcon.tsx

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -36,9 +36,9 @@ export const CameraAppIcon: React.FC<CameraAppIconProps> = ({size = "medium", st
3636
const containerSize = style?.width || config.container
3737
const iconSizeValue = style?.width ? (style.width as number) * 0.55 : config.icon // Scale icon to ~55% of container
3838

39-
// Use border radius matching other app icons
40-
// Squircles use theme.spacing.md, regular circles use borderRadius: 60 (which creates a circle)
41-
const borderRadius = enableSquircles ? (style?.borderRadius ?? theme.spacing.md) : 60
39+
// Use border radius: squircles use theme.spacing.md, circles always use 60 (perfect circle)
40+
// When squircles are disabled, always use 60 to create a perfect circle regardless of style prop
41+
const borderRadius = enableSquircles ? theme.spacing.md : 60
4242

4343
const iconContent = <MaterialCommunityIcons name="camera-outline" size={iconSizeValue} color={theme.colors.text} />
4444

@@ -56,7 +56,6 @@ export const CameraAppIcon: React.FC<CameraAppIconProps> = ({size = "medium", st
5656
borderRadius: borderRadius,
5757
overflow: "hidden",
5858
},
59-
style,
6059
]}>
6160
{iconContent}
6261
</SquircleView>
@@ -72,7 +71,6 @@ export const CameraAppIcon: React.FC<CameraAppIconProps> = ({size = "medium", st
7271
height: containerSize,
7372
borderRadius: borderRadius,
7473
},
75-
style,
7674
]}>
7775
{iconContent}
7876
</View>

0 commit comments

Comments
 (0)