fix: adress pr comments

This commit is contained in:
Shirone
2026-01-12 22:03:14 +01:00
parent 1f270edbe1
commit 029c5ca855
10 changed files with 153 additions and 74 deletions

View File

@@ -1,7 +1,7 @@
// TODO: Remove @ts-nocheck after fixing BaseFeature's index signature issue
// The `[key: string]: unknown` in BaseFeature causes property access type errors
// @ts-nocheck
import { memo, useCallback, useMemo } from 'react';
import { memo, useCallback, useState, useEffect } from 'react';
import { cn } from '@/lib/utils';
import { Tooltip, TooltipContent, TooltipProvider, TooltipTrigger } from '@/components/ui/tooltip';
import { AlertCircle, Lock, Hand, Sparkles, FileText } from 'lucide-react';
@@ -49,14 +49,34 @@ const IndicatorBadges = memo(function IndicatorBadges({
feature.skipTests && !feature.error && feature.status === 'backlog';
const hasPlan = feature.planSpec?.content;
// Check if just finished (within 2 minutes)
const isJustFinished = useMemo(() => {
// Check if just finished (within 2 minutes) - uses timer to auto-expire
const [isJustFinished, setIsJustFinished] = useState(false);
useEffect(() => {
if (!feature.justFinishedAt || feature.status !== 'waiting_approval' || feature.error) {
return false;
setIsJustFinished(false);
return;
}
const finishedTime = new Date(feature.justFinishedAt).getTime();
const twoMinutes = 2 * 60 * 1000;
return Date.now() - finishedTime < twoMinutes;
const elapsed = Date.now() - finishedTime;
if (elapsed >= twoMinutes) {
setIsJustFinished(false);
return;
}
// Set as just finished
setIsJustFinished(true);
// Set a timeout to clear the "just finished" state when 2 minutes have passed
const remainingTime = twoMinutes - elapsed;
const timeoutId = setTimeout(() => {
setIsJustFinished(false);
}, remainingTime);
return () => clearTimeout(timeoutId);
}, [feature.justFinishedAt, feature.status, feature.error]);
const badges: Array<{

View File

@@ -12,6 +12,9 @@ import { getStatusLabel, getStatusOrder } from './status-badge';
import { getColumnsWithPipeline } from '../../constants';
import type { SortConfig, SortColumn } from '../../hooks/use-list-view-state';
/** Empty set constant to avoid creating new instances on each render */
const EMPTY_SET = new Set<string>();
/**
* Status group configuration for the list view
*/
@@ -184,7 +187,7 @@ export const ListView = memo(function ListView({
pipelineConfig = null,
onAddFeature,
isSelectionMode = false,
selectedFeatureIds = new Set(),
selectedFeatureIds = EMPTY_SET,
onToggleFeatureSelection,
onRowClick,
className,

View File

@@ -80,7 +80,8 @@ export function CommitWorktreeDialog({
};
const handleKeyDown = (e: React.KeyboardEvent) => {
if (e.key === 'Enter' && e.metaKey && !isLoading && message.trim()) {
// Prevent commit while loading or while AI is generating a message
if (e.key === 'Enter' && e.metaKey && !isLoading && !isGenerating && message.trim()) {
handleCommit();
}
};

View File

@@ -114,7 +114,7 @@ export function KanbanBoard({
<div
className={cn(
'flex-1 overflow-x-auto px-5 pt-4 pb-4 relative',
'transition-opacity duration-250',
'transition-opacity duration-200',
className
)}
style={backgroundImageStyle}

View File

@@ -1,9 +1,8 @@
import { useEffect, useCallback, useState } from 'react';
import { RefreshCw, AlertTriangle } from 'lucide-react';
import { useEffect, useCallback, useState, type ComponentType, type ReactNode } from 'react';
import { RefreshCw } from 'lucide-react';
import { cn } from '@/lib/utils';
import { getElectronAPI } from '@/lib/electron';
import { useAppStore, type ClaudeUsage, type CodexUsage } from '@/store/app-store';
import { useSetupStore } from '@/store/setup-store';
import { useAppStore } from '@/store/app-store';
import { AnthropicIcon, OpenAIIcon } from '@/components/ui/provider-icon';
interface MobileUsageBarProps {
@@ -70,11 +69,11 @@ function UsageItem({
onRefresh,
children,
}: {
icon: React.ComponentType<{ className?: string }>;
icon: ComponentType<{ className?: string }>;
label: string;
isLoading: boolean;
onRefresh: () => void;
children: React.ReactNode;
children: ReactNode;
}) {
return (
<div className="px-2 py-2">