Privacy-first password manager with built-in email aliasing. Fully encrypted and self-hostable.
Make logos rounded in all apps consistently
Leendert de Borstaf273d5d648b
diff --git a/apps/browser-extension/src/entrypoints/popup/components/Items/ItemIcon.tsx b/apps/browser-extension/src/entrypoints/popup/components/Items/ItemIcon.tsxindex e51d305d4..283c9d34f 100644--- a/apps/browser-extension/src/entrypoints/popup/components/Items/ItemIcon.tsx+++ b/apps/browser-extension/src/entrypoints/popup/components/Items/ItemIcon.tsx@@ -10,6 +10,11 @@ import React from 'react';import type { ItemTypeIconKey } from '@aliasvault/models/icons';+/**+ * Corner rounding for raster logos, proportional to the icon size so every size looks the same.+ */+const LOGO_ROUNDING = 'rounded-[17%]';+type ItemIconProps = {item: Item;className?: string;@@ -86,7 +91,7 @@ const ItemIcon: React.FC<ItemIconProps> = ({ item, className = 'w-8 h-8' }) => {if (chosen?.Kind === LogoKinds.Custom) {const uploadedSrc = item.Logo ? SqliteClient.imgSrcFromBytes(item.Logo) : null;if (uploadedSrc) {- return <img src={uploadedSrc} alt={item.Name ?? 'Item'} className={`${className} flex-shrink-0`} />;+ return <img src={uploadedSrc} alt={item.Name ?? 'Item'} className={`${className} flex-shrink-0 ${LOGO_ROUNDING}`} />;}}@@ -115,7 +120,7 @@ const ItemIcon: React.FC<ItemIconProps> = ({ item, className = 'w-8 h-8' }) => {<imgsrc={logoSrc}alt={item.Name || 'Item'}- className={`${className} flex-shrink-0`}+ className={`${className} flex-shrink-0 ${LOGO_ROUNDING}`}onError={(e) => {// On error, replace with placeholder iconconst target = e.target as HTMLImageElement;diff --git a/apps/browser-extension/src/entrypoints/popup/pages/items/ItemDetails.tsx b/apps/browser-extension/src/entrypoints/popup/pages/items/ItemDetails.tsxindex ee4f87ed6..a5a22215e 100644--- a/apps/browser-extension/src/entrypoints/popup/pages/items/ItemDetails.tsx+++ b/apps/browser-extension/src/entrypoints/popup/pages/items/ItemDetails.tsx@@ -154,7 +154,7 @@ const ItemDetails: React.FC = (): React.ReactElement => {{/* Header with name, logo, and URLs */}<div className="flex justify-between items-start"><div className="flex items-start gap-3">- <ItemIcon item={item} className="w-12 h-12 rounded-lg" />+ <ItemIcon item={item} className="w-12 h-12" /><div><h1 className="text-lg font-bold text-gray-900 dark:text-white">{item.Name || t('items.untitled')}diff --git a/apps/browser-extension/src/entrypoints/popup/pages/items/RecentlyDeleted.tsx b/apps/browser-extension/src/entrypoints/popup/pages/items/RecentlyDeleted.tsxindex 2c3396ed6..69ac99c40 100644--- a/apps/browser-extension/src/entrypoints/popup/pages/items/RecentlyDeleted.tsx+++ b/apps/browser-extension/src/entrypoints/popup/pages/items/RecentlyDeleted.tsx@@ -196,7 +196,7 @@ const RecentlyDeleted: React.FC = () => {{/* Item card content (simplified) */}<div className="flex-1 min-w-0"><div className="flex items-center gap-2">- <ItemIcon item={item} className="w-6 h-6 rounded" />+ <ItemIcon item={item} className="w-6 h-6" /><span className="font-medium text-gray-900 dark:text-white truncate">{item.Name || t('items.untitled')}</span>diff --git a/apps/mobile-app/app/(tabs)/items/[manifestId]/[id]/index.tsx b/apps/mobile-app/app/(tabs)/items/[manifestId]/[id]/index.tsxindex c7f3d8ce4..c92282b27 100644--- a/apps/mobile-app/app/(tabs)/items/[manifestId]/[id]/index.tsx+++ b/apps/mobile-app/app/(tabs)/items/[manifestId]/[id]/index.tsx@@ -342,7 +342,6 @@ const styles = StyleSheet.create({justifyContent: 'center',},logo: {- borderRadius: 4,height: 48,width: 48,},diff --git a/apps/mobile-app/app/(tabs)/items/deleted.tsx b/apps/mobile-app/app/(tabs)/items/deleted.tsxindex 93b880593..f65c4a9d1 100644--- a/apps/mobile-app/app/(tabs)/items/deleted.tsx+++ b/apps/mobile-app/app/(tabs)/items/deleted.tsx@@ -213,7 +213,6 @@ export default function RecentlyDeletedScreen(): React.ReactNode {flexDirection: 'row',},itemLogo: {- borderRadius: 4,height: 32,marginRight: 12,width: 32,diff --git a/apps/mobile-app/components/items/ItemCard.tsx b/apps/mobile-app/components/items/ItemCard.tsxindex efcd3670a..1e51e9e91 100644--- a/apps/mobile-app/components/items/ItemCard.tsx+++ b/apps/mobile-app/components/items/ItemCard.tsx@@ -306,7 +306,6 @@ export function ItemCard({ item, onItemDelete, onItemDuplicate, showFolderPath =marginLeft: 6,},logo: {- borderRadius: 4,height: 32,marginRight: 12,width: 32,diff --git a/apps/mobile-app/components/items/ItemIcon.tsx b/apps/mobile-app/components/items/ItemIcon.tsxindex 6a32f0e7b..c5b30da30 100644--- a/apps/mobile-app/components/items/ItemIcon.tsx+++ b/apps/mobile-app/components/items/ItemIcon.tsx@@ -26,6 +26,11 @@ import {*/const SVG_DATA_URI_PREFIX = 'data:image/svg+xml;base64,';+/**+ * Corner radius of a logo.+ */+const LOGO_RADIUS_RATIO = 0.17;+/*** Item icon props.*/@@ -133,6 +138,7 @@ function LogoImage({ dataUri, style }: { dataUri: string; style?: ImageStyle }):const svgWidth = Number(style?.width ?? styles.logo.width);const svgHeight = Number(style?.height ?? styles.logo.height);const isSvg = dataUri.startsWith(SVG_DATA_URI_PREFIX);+ const borderRadius = Math.round(svgWidth * LOGO_RADIUS_RATIO);// Decode and sanitize an SVG once per logo and size, not on every render.const svgXml = useMemo(() => {@@ -143,7 +149,7 @@ function LogoImage({ dataUri, style }: { dataUri: string; style?: ImageStyle }):}, [dataUri, isSvg, svgWidth, svgHeight]);if (!isSvg) {- return <Image source={{ uri: dataUri }} style={[styles.logo, style]} />;+ return <Image source={{ uri: dataUri }} style={[styles.logo, style, { borderRadius }]} />;}const fallback = (@@ -163,17 +169,12 @@ function LogoImage({ dataUri, style }: { dataUri: string; style?: ImageStyle }):* malformed SVGs that would otherwise crash the native renderer* (e.g. zero-dimension SVGs triggering UIGraphicsBeginImageContext failures).*/+ // react-native-svg does not clip to a border radius, so a wrapping view does the rounding.return (- <SvgXml- xml={svgXml}- width={svgWidth}- height={svgHeight}- onError={() => {- console.warn('SvgXml failed to render SVG logo');- }}- fallback={fallback}+ <Viewstyle={{- borderRadius: styles.logo.borderRadius,+ borderRadius,+ overflow: 'hidden',width: svgWidth,height: svgHeight,marginLeft: Number(style?.marginLeft ?? 0),@@ -181,7 +182,17 @@ function LogoImage({ dataUri, style }: { dataUri: string; style?: ImageStyle }):marginTop: Number(style?.marginTop ?? 0),marginBottom: Number(style?.marginBottom ?? 0),}}- />+ >+ <SvgXml+ xml={svgXml}+ width={svgWidth}+ height={svgHeight}+ onError={() => {+ console.warn('SvgXml failed to render SVG logo');+ }}+ fallback={fallback}+ />+ </View>);}@@ -288,7 +299,6 @@ function sanitizeSvg(xml: string, targetWidth: number, targetHeight: number): stconst styles = StyleSheet.create({logo: {- borderRadius: 4,height: 32,width: 32,},diff --git a/apps/mobile-app/components/items/ItemLogoPicker.tsx b/apps/mobile-app/components/items/ItemLogoPicker.tsxindex 4bf6bd7e2..5abed5fce 100644--- a/apps/mobile-app/components/items/ItemLogoPicker.tsx+++ b/apps/mobile-app/components/items/ItemLogoPicker.tsx@@ -42,7 +42,6 @@ export const ItemLogoPicker: React.FC<ItemLogoPickerProps> = ({ item, pendingSelpaddingHorizontal: 10,},icon: {- borderRadius: 6,height: 28,width: 28,},diff --git a/apps/mobile-app/components/items/LogoPickerModal.tsx b/apps/mobile-app/components/items/LogoPickerModal.tsxindex aeec3d878..5ed4f3188 100644--- a/apps/mobile-app/components/items/LogoPickerModal.tsx+++ b/apps/mobile-app/components/items/LogoPickerModal.tsx@@ -92,7 +92,6 @@ export const LogoPickerModal: React.FC<LogoPickerModalProps> = ({ isOpen, onCloswidth: 44,},previewIcon: {- borderRadius: 6,height: 30,width: 30,},diff --git a/apps/web/src/components/items/ItemIcon.tsx b/apps/web/src/components/items/ItemIcon.tsxindex 85be81cb3..e13a3fcb8 100644--- a/apps/web/src/components/items/ItemIcon.tsx+++ b/apps/web/src/components/items/ItemIcon.tsx@@ -63,7 +63,7 @@ const ItemIcon: React.FC<ItemIconProps> = ({ item, altText, sizeClass = 'w-10 h-if (chosen?.Kind === LogoKinds.Custom) {const uploadedSrc = item.Logo ? SqliteClient.imgSrcFromBytes(item.Logo) : null;if (uploadedSrc && !imageFailed) {- return <img src={uploadedSrc} alt={altText ?? item.Name ?? 'Item'} className={`${sizeClass} flex-shrink-0 rounded-lg`} loading="lazy" decoding="async" onError={() => setImageFailed(true)} />;+ return <img src={uploadedSrc} alt={altText ?? item.Name ?? 'Item'} className={`${sizeClass} flex-shrink-0 rounded-[17%]`} loading="lazy" decoding="async" onError={() => setImageFailed(true)} />;}}@@ -79,7 +79,7 @@ const ItemIcon: React.FC<ItemIconProps> = ({ item, altText, sizeClass = 'w-10 h-const logoSrc = item.Logo && !imageFailed ? SqliteClient.imgSrcFromBytes(item.Logo) : null;if (logoSrc) {- return <img src={logoSrc} alt={altText ?? item.Name ?? 'Item'} className={`${sizeClass} flex-shrink-0 rounded-lg`} loading="lazy" decoding="async" onError={() => setImageFailed(true)} />;+ return <img src={logoSrc} alt={altText ?? item.Name ?? 'Item'} className={`${sizeClass} flex-shrink-0 rounded-[17%]`} loading="lazy" decoding="async" onError={() => setImageFailed(true)} />;}return <SvgIcon svg={ItemTypeIconSvgs.Placeholder} sizeClass={sizeClass} />;