From 6842e4c7f7319a3aade9b12faf7956bdebc85198 Mon Sep 17 00:00:00 2001 From: Shirone Date: Sun, 11 Jan 2026 22:35:25 +0100 Subject: [PATCH] refactor: simplify EmptyStateCard and update empty state configurations - Removed unused properties and state management from the EmptyStateCard component for cleaner code. - Updated the EMPTY_STATE_CONFIGS to remove exampleCard entries, streamlining the empty state configuration. - Enhanced the primary action handling in the EmptyStateCard for improved functionality. --- .../components/empty-state-card.tsx | 61 +------------------ .../components/views/board-view/constants.ts | 26 +------- 2 files changed, 3 insertions(+), 84 deletions(-) diff --git a/apps/ui/src/components/views/board-view/components/empty-state-card.tsx b/apps/ui/src/components/views/board-view/components/empty-state-card.tsx index 26b4fc7a..30ccdefc 100644 --- a/apps/ui/src/components/views/board-view/components/empty-state-card.tsx +++ b/apps/ui/src/components/views/board-view/components/empty-state-card.tsx @@ -1,20 +1,10 @@ -import { memo, useState } from 'react'; +import { memo } from 'react'; import { cn } from '@/lib/utils'; import { Button } from '@/components/ui/button'; import { Kbd } from '@/components/ui/kbd'; import { formatShortcut } from '@/store/app-store'; import { getEmptyStateConfig, type EmptyStateConfig } from '../constants'; -import { - Lightbulb, - Play, - Clock, - CheckCircle2, - Sparkles, - Wand2, - X, - Eye, - EyeOff, -} from 'lucide-react'; +import { Lightbulb, Play, Clock, CheckCircle2, Sparkles, Wand2 } from 'lucide-react'; const ICON_MAP = { lightbulb: Lightbulb, @@ -51,43 +41,14 @@ export const EmptyStateCard = memo(function EmptyStateCard({ onAiSuggest, customConfig, }: EmptyStateCardProps) { - const [isDismissed, setIsDismissed] = useState(false); - const [isMinimized, setIsMinimized] = useState(false); - // Get base config and merge with custom overrides const baseConfig = getEmptyStateConfig(columnId); const config: EmptyStateConfig = { ...baseConfig, ...customConfig }; - // Handle dismissal - if (isDismissed) { - return null; - } - const IconComponent = ICON_MAP[config.icon]; const showActions = !isReadOnly && !isFilteredEmpty; const showShortcut = columnId === 'backlog' && addFeatureShortcut && showActions; - // Minimized state - compact centered indicator - if (isMinimized) { - return ( - - ); - } - // Action button handler const handlePrimaryAction = () => { if (!config.primaryAction) return; @@ -108,24 +69,6 @@ export const EmptyStateCard = memo(function EmptyStateCard({ )} data-testid={`empty-state-card-${columnId}`} > - {/* Dismiss/Minimize controls - appears on hover */} -
- - -
- {/* Icon */}
diff --git a/apps/ui/src/components/views/board-view/constants.ts b/apps/ui/src/components/views/board-view/constants.ts index 0ea7ce0a..fda19ebf 100644 --- a/apps/ui/src/components/views/board-view/constants.ts +++ b/apps/ui/src/components/views/board-view/constants.ts @@ -16,10 +16,6 @@ export interface EmptyStateConfig { label: string; actionType: 'ai-suggest' | 'none'; }; - exampleCard?: { - title: string; - category: string; - }; } /** @@ -34,49 +30,29 @@ export const EMPTY_STATE_CONFIGS: Record = { shortcutHint: 'Press', primaryAction: { label: 'Use AI Suggestions', - actionType: 'ai-suggest', - }, - exampleCard: { - title: 'User Authentication', - category: 'Core Feature', + actionType: 'none', }, }, in_progress: { title: 'Nothing in Progress', description: 'Drag a feature from the backlog here or click implement to start working on it.', icon: 'play', - exampleCard: { - title: 'Implementing feature...', - category: 'In Development', - }, }, waiting_approval: { title: 'No Items Awaiting Approval', description: 'Features will appear here after implementation is complete and need your review.', icon: 'clock', - exampleCard: { - title: 'Ready for Review', - category: 'Completed', - }, }, verified: { title: 'No Verified Features', description: 'Approved features will appear here. They can then be completed and archived.', icon: 'check', - exampleCard: { - title: 'Approved & Ready', - category: 'Verified', - }, }, // Pipeline step default configuration pipeline_default: { title: 'Pipeline Step Empty', description: 'Features will flow through this step during the automated pipeline process.', icon: 'sparkles', - exampleCard: { - title: 'Processing...', - category: 'Pipeline', - }, }, };