Skip to content

Self-hosted, Self-Improving, Federated Everything App — dev management, agent orchestration, persistent mind, digital twin, second brain, and creative pipeline from a single dashboard over Tailscale to port the user into the OS

fix: Give app icons accessible names (#7957)

[._.]/ Adam Eivy3f60a3f91bb2
diff --git a/client/src/components/AppContextPicker.jsx b/client/src/components/AppContextPicker.jsx
index fa6dfe19e8..01d9d589e5 100644
--- a/client/src/components/AppContextPicker.jsx
+++ b/client/src/components/AppContextPicker.jsx
@@ -48,6 +48,7 @@ export default function AppContextPicker({
appId={selectedApp.id}
hasAppIcon={!!selectedApp.appIconPath}
size={14}
+ ariaLabel={selectedApp.name}
className="mt-0.5 shrink-0 text-gray-400"
/>
<div className="min-w-0">
diff --git a/client/src/components/AppIcon.jsx b/client/src/components/AppIcon.jsx
index 9479fca5c2..70eb3a19ee 100644
--- a/client/src/components/AppIcon.jsx
+++ b/client/src/components/AppIcon.jsx
@@ -173,8 +173,9 @@ function getAppIconUrl(appId) {
return `${base}/api/apps/${appId}/icon`;
}
-export default function AppIcon({ icon, appId, hasAppIcon, size = 24, className = '', ariaLabel, fillContainer = false }) {
+export default function AppIcon({ icon, appId, hasAppIcon, size = 24, className = '', ariaLabel, appName, fillContainer = false }) {
const [imgError, setImgError] = useState(false);
+ const accessibleName = ariaLabel || appName;
// Show real app icon image if the app has one detected. When fillContainer is
// set, the consumer has wrapped us in a sized + clipped tile (e.g. w-8 h-8
@@ -189,24 +190,21 @@ export default function AppIcon({ icon, appId, hasAppIcon, size = 24, className
const imgEl = (
<img
src={getAppIconUrl(appId)}
- alt={ariaLabel || ''}
+ alt={accessibleName || 'Application icon'}
className={`w-full h-full rounded-[22%] object-cover ${className}`}
onError={() => setImgError(true)}
/>
);
- if (ariaLabel) {
- return <span role="img" aria-label={ariaLabel} className={wrapperClass} style={wrapperStyle}>{imgEl}</span>;
- }
- return <span aria-hidden="true" className={wrapperClass} style={wrapperStyle}>{imgEl}</span>;
+ return <span className={wrapperClass} style={wrapperStyle}>{imgEl}</span>;
}
// Fall back to SVG icon
const IconComponent = icons[icon] || icons.package;
- if (ariaLabel) {
+ if (accessibleName) {
return (
- <span role="img" aria-label={ariaLabel}>
+ <span role="img" aria-label={accessibleName}>
<IconComponent size={size} className={className} />
</span>
);
diff --git a/client/src/components/AppIcon.test.jsx b/client/src/components/AppIcon.test.jsx
new file mode 100644
index 0000000000..64fce9947d
--- /dev/null
+++ b/client/src/components/AppIcon.test.jsx
@@ -0,0 +1,25 @@
+import { render, screen } from '@testing-library/react';
+import { describe, expect, it } from 'vitest';
+import AppIcon from './AppIcon';
+
+describe('AppIcon', () => {
+ it('uses the app name as the custom image alt text', () => {
+ render(<AppIcon appId="example-app" appName="Example App" hasAppIcon />);
+
+ const image = screen.getByRole('img', { name: 'Example App' });
+ expect(image.getAttribute('alt')).toBe('Example App');
+ });
+
+ it('prefers an explicit aria label over the app name', () => {
+ render(<AppIcon appId="example-app" appName="Example App" ariaLabel="Example app icon" hasAppIcon />);
+
+ const image = screen.getByRole('img', { name: 'Example app icon' });
+ expect(image.getAttribute('alt')).toBe('Example app icon');
+ });
+
+ it('provides a non-empty default alt when no app name is available', () => {
+ render(<AppIcon appId="example-app" hasAppIcon />);
+
+ expect(screen.getByRole('img', { name: 'Application icon' }).getAttribute('alt')).toBe('Application icon');
+ });
+});
diff --git a/client/src/components/AppTile.jsx b/client/src/components/AppTile.jsx
index 6ad3ab3f9b..c565cf80f4 100644
--- a/client/src/components/AppTile.jsx
+++ b/client/src/components/AppTile.jsx
@@ -49,8 +49,8 @@ const AppTile = memo(function AppTile({ app, onUpdate }) {
<div className="flex items-center gap-2 min-w-0">
<div className={`w-8 h-8 rounded-[22%] shrink-0 overflow-hidden ${
app.appIconPath ? '' : `flex items-center justify-center ${app.archived ? 'bg-port-border/50 text-gray-500' : 'bg-port-border text-port-accent'}`
- }`} aria-hidden="true">
- <AppIcon icon={app.icon || 'package'} appId={app.id} hasAppIcon={!!app.appIconPath} size={18} fillContainer />
+ }`}>
+ <AppIcon icon={app.icon || 'package'} appId={app.id} hasAppIcon={!!app.appIconPath} size={18} ariaLabel={app.name} fillContainer />
</div>
<div className="min-w-0">
<div className="flex items-center gap-1.5">
diff --git a/client/src/components/cos/tabs/schedule/AppOverrideRow.jsx b/client/src/components/cos/tabs/schedule/AppOverrideRow.jsx
index f466a80f4d..89759d0606 100644
--- a/client/src/components/cos/tabs/schedule/AppOverrideRow.jsx
+++ b/client/src/components/cos/tabs/schedule/AppOverrideRow.jsx
@@ -131,7 +131,7 @@ const AppOverrideRow = memo(function AppOverrideRow({ app, taskType, globalInter
return (
<div className="flex flex-col sm:flex-row sm:flex-wrap sm:items-center gap-2 sm:gap-3 py-2 px-3 rounded hover:bg-port-card/30">
<div className="flex items-center gap-2 min-w-0 w-full sm:w-auto sm:flex-1">
- <AppIcon icon={app.icon || 'package'} appId={app.id} hasAppIcon={!!app.appIconPath} size={16} className="text-gray-400 shrink-0" />
+ <AppIcon icon={app.icon || 'package'} appId={app.id} hasAppIcon={!!app.appIconPath} size={16} ariaLabel={app.name} className="text-gray-400 shrink-0" />
<span className="text-sm text-white truncate flex-1">{app.name}</span>
<div className="sm:hidden flex items-center gap-1.5 shrink-0" title={enabledToggleTitle}>{enabledToggle}</div>
</div>
diff --git a/client/src/components/instances/PeerAppsList.jsx b/client/src/components/instances/PeerAppsList.jsx
index 8c54a90ac9..d413d5e085 100644
--- a/client/src/components/instances/PeerAppsList.jsx
+++ b/client/src/components/instances/PeerAppsList.jsx
@@ -16,7 +16,7 @@ export default function PeerAppsList({ apps, peerAddress, peerHost }) {
<div className="space-y-1">
{apps.map(app => (
<div key={app.id} className="flex items-center gap-2 text-xs">
- <AppIcon icon={app.icon || 'package'} size={14} className="text-gray-400 shrink-0" />
+ <AppIcon icon={app.icon || 'package'} size={14} ariaLabel={app.name} className="text-gray-400 shrink-0" />
{app.uiPort && app.overallStatus === 'online' ? (
<a
href={`${linkBase.scheme}://${linkBase.host}:${app.uiPort}`}
diff --git a/client/src/pages/Apps.jsx b/client/src/pages/Apps.jsx
index e908de6b23..7ebd41c05b 100644
--- a/client/src/pages/Apps.jsx
+++ b/client/src/pages/Apps.jsx
@@ -295,7 +295,7 @@ export default function Apps() {
<div className={`w-8 h-8 rounded-[22%] shrink-0 overflow-hidden ${
app.appIconPath ? '' : `flex items-center justify-center ${app.archived ? 'bg-port-border/50 text-gray-500' : 'bg-port-border text-port-accent'}`
}`}>
- <AppIcon icon={app.icon || 'package'} appId={app.id} hasAppIcon={!!app.appIconPath} size={18} fillContainer />
+ <AppIcon icon={app.icon || 'package'} appId={app.id} hasAppIcon={!!app.appIconPath} size={18} ariaLabel={app.name} fillContainer />
</div>
<div className="min-w-0 flex-1">
<div className="flex flex-wrap items-center gap-2">