Show folder for search results in mobile app (#1665)

This commit is contained in:
Leendert de Borst
2026-02-09 13:42:20 +01:00
committed by Leendert de Borst
parent 2b82ad6565
commit f9986894d1
2 changed files with 11 additions and 2 deletions

View File

@@ -1177,7 +1177,7 @@ export default function ItemsScreen(): React.ReactNode {
isLoadingItems ? (
<SkeletonLoader count={1} height={60} parts={2} />
) : (
<ItemCard item={itm} onItemDelete={onItemDelete} />
<ItemCard item={itm} onItemDelete={onItemDelete} showFolderPath={!!searchQuery} />
)
}
ListEmptyComponent={renderEmptyComponent() as React.ReactElement}

View File

@@ -19,12 +19,13 @@ import { getFieldValue, FieldKey } from '@/utils/dist/core/models/vault';
type ItemCardProps = {
item: Item;
onItemDelete?: (itemId: string) => Promise<void>;
showFolderPath?: boolean;
};
/**
* Item card component for displaying vault items in a list.
*/
export function ItemCard({ item, onItemDelete }: ItemCardProps): React.ReactNode {
export function ItemCard({ item, onItemDelete, showFolderPath = false }: ItemCardProps): React.ReactNode {
const colors = useColors();
const { t } = useTranslation();
const { showConfirm } = useDialog();
@@ -257,6 +258,11 @@ export function ItemCard({ item, onItemDelete }: ItemCardProps): React.ReactNode
serviceNameRow: {
alignItems: 'center',
flexDirection: 'row',
flexWrap: 'wrap',
},
folderPath: {
color: colors.textMuted,
fontSize: 14,
},
});
@@ -284,6 +290,9 @@ export function ItemCard({ item, onItemDelete }: ItemCardProps): React.ReactNode
<ItemIcon item={item} style={styles.logo} />
<View style={styles.itemInfo}>
<View style={styles.serviceNameRow}>
{showFolderPath && item.FolderPath && (
<Text style={styles.folderPath}>{item.FolderPath} &gt; </Text>
)}
<Text style={styles.serviceName}>
{getItemName(item)}
</Text>