fix(ui): address PR #644 review comments

Keyboard accessibility:
- Add role="button", tabIndex, onKeyDown, and aria-label to clickable divs
  in project-status-card, recent-activity-feed, and running-agents-panel

Bug fixes:
- Fix handleActivityClick to use projectPath instead of projectId for
  initializeProject and check result before navigating
- Fix error handling in use-multi-project-status to use data.error string
  directly instead of data.error?.message

Improvements:
- Use GitBranch icon instead of Folder for branch display in running-agents-panel
- Add error logging for failed project loads in overview.ts
- Use type import for FeatureLoader in projects/index.ts
- Add data-testid to mobile Overview button in dashboard-view
- Add locale options for consistent time formatting in overview-view

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
Stefan de Vogelaere
2026-01-23 02:26:57 +01:00
parent c8ed3fafce
commit fb6d6bbf2f
8 changed files with 62 additions and 13 deletions

View File

@@ -120,16 +120,19 @@ export function RecentActivityFeed({ activities, maxItems = 10 }: RecentActivity
const handleActivityClick = useCallback(
async (activity: RecentActivity) => {
try {
const initResult = await initializeProject(
// We need to find the project path - use projectId as workaround
// In real implementation, this would look up the path from projects list
activity.projectId
);
// Navigate to the project
const projectPath = activity.projectId;
// Get project path from the activity (projectId is actually the path in our data model)
const projectPath = activity.projectPath || activity.projectId;
const projectName = activity.projectName;
const initResult = await initializeProject(projectPath);
if (!initResult.success) {
toast.error('Failed to initialize project', {
description: initResult.error || 'Unknown error',
});
return;
}
upsertAndSetCurrentProject(projectPath, projectName);
if (activity.featureId) {
@@ -147,6 +150,16 @@ export function RecentActivityFeed({ activities, maxItems = 10 }: RecentActivity
[navigate, upsertAndSetCurrentProject]
);
const handleActivityKeyDown = useCallback(
(e: React.KeyboardEvent, activity: RecentActivity) => {
if (e.key === 'Enter' || e.key === ' ') {
e.preventDefault();
handleActivityClick(activity);
}
},
[handleActivityClick]
);
if (displayActivities.length === 0) {
return (
<div className="flex flex-col items-center justify-center py-8 text-muted-foreground">
@@ -166,8 +179,12 @@ export function RecentActivityFeed({ activities, maxItems = 10 }: RecentActivity
return (
<div
key={activity.id}
role="button"
tabIndex={0}
className="group flex items-start gap-3 p-2 rounded-lg hover:bg-muted/50 cursor-pointer transition-colors"
onClick={() => handleActivityClick(activity)}
onKeyDown={(e) => handleActivityKeyDown(e, activity)}
aria-label={`${config.label}: ${activity.featureName || activity.message} in ${activity.projectName}`}
data-testid={`activity-item-${activity.id}`}
>
{/* Icon */}