mirror of
https://github.com/AutoMaker-Org/automaker.git
synced 2026-02-04 09:13:08 +00:00
feat: enhance TaskProgressPanel and AgentOutputModal components
- Added defaultExpanded prop to TaskProgressPanel for customizable initial state. - Updated styling in TaskProgressPanel for improved layout and consistency. - Modified AgentOutputModal to utilize the new defaultExpanded prop and adjusted class names for better responsiveness and appearance. - Enhanced overflow handling in AgentOutputModal for improved user experience.
This commit is contained in:
@@ -19,11 +19,18 @@ interface TaskProgressPanelProps {
|
|||||||
featureId: string;
|
featureId: string;
|
||||||
projectPath?: string;
|
projectPath?: string;
|
||||||
className?: string;
|
className?: string;
|
||||||
|
/** Whether the panel starts expanded (default: true) */
|
||||||
|
defaultExpanded?: boolean;
|
||||||
}
|
}
|
||||||
|
|
||||||
export function TaskProgressPanel({ featureId, projectPath, className }: TaskProgressPanelProps) {
|
export function TaskProgressPanel({
|
||||||
|
featureId,
|
||||||
|
projectPath,
|
||||||
|
className,
|
||||||
|
defaultExpanded = true,
|
||||||
|
}: TaskProgressPanelProps) {
|
||||||
const [tasks, setTasks] = useState<TaskInfo[]>([]);
|
const [tasks, setTasks] = useState<TaskInfo[]>([]);
|
||||||
const [isExpanded, setIsExpanded] = useState(true);
|
const [isExpanded, setIsExpanded] = useState(defaultExpanded);
|
||||||
const [isLoading, setIsLoading] = useState(true);
|
const [isLoading, setIsLoading] = useState(true);
|
||||||
const [currentTaskId, setCurrentTaskId] = useState<string | null>(null);
|
const [currentTaskId, setCurrentTaskId] = useState<string | null>(null);
|
||||||
|
|
||||||
@@ -151,13 +158,13 @@ export function TaskProgressPanel({ featureId, projectPath, className }: TaskPro
|
|||||||
return (
|
return (
|
||||||
<div
|
<div
|
||||||
className={cn(
|
className={cn(
|
||||||
'group rounded-xl border bg-card/50 shadow-sm overflow-hidden transition-all duration-200',
|
'group rounded-lg border bg-card/50 shadow-sm overflow-hidden transition-all duration-200',
|
||||||
className
|
className
|
||||||
)}
|
)}
|
||||||
>
|
>
|
||||||
<button
|
<button
|
||||||
onClick={() => setIsExpanded(!isExpanded)}
|
onClick={() => setIsExpanded(!isExpanded)}
|
||||||
className="w-full flex items-center justify-between p-4 bg-muted/10 hover:bg-muted/20 transition-colors"
|
className="w-full flex items-center justify-between px-3 py-2.5 bg-muted/10 hover:bg-muted/20 transition-colors"
|
||||||
>
|
>
|
||||||
<div className="flex items-center gap-3">
|
<div className="flex items-center gap-3">
|
||||||
<div
|
<div
|
||||||
@@ -218,9 +225,9 @@ export function TaskProgressPanel({ featureId, projectPath, className }: TaskPro
|
|||||||
)}
|
)}
|
||||||
>
|
>
|
||||||
<div className="overflow-hidden">
|
<div className="overflow-hidden">
|
||||||
<div className="p-5 pt-2 relative max-h-[300px] overflow-y-auto scrollbar-visible">
|
<div className="p-4 pt-2 relative max-h-[300px] overflow-y-auto scrollbar-visible">
|
||||||
{/* Vertical Connector Line */}
|
{/* Vertical Connector Line */}
|
||||||
<div className="absolute left-[2.35rem] top-4 bottom-8 w-px bg-gradient-to-b from-border/80 via-border/40 to-transparent" />
|
<div className="absolute left-[2.35rem] top-4 bottom-8 w-px bg-linear-to-b from-border/80 via-border/40 to-transparent" />
|
||||||
|
|
||||||
<div className="space-y-5">
|
<div className="space-y-5">
|
||||||
{tasks.map((task, index) => {
|
{tasks.map((task, index) => {
|
||||||
|
|||||||
@@ -296,10 +296,10 @@ export function AgentOutputModal({
|
|||||||
return (
|
return (
|
||||||
<Dialog open={open} onOpenChange={onClose}>
|
<Dialog open={open} onOpenChange={onClose}>
|
||||||
<DialogContent
|
<DialogContent
|
||||||
className="w-[60vw] max-w-[60vw] max-h-[80vh] flex flex-col"
|
className="w-[60vw] max-w-[60vw] max-h-[80vh] flex flex-col overflow-hidden min-h-0 gap-3"
|
||||||
data-testid="agent-output-modal"
|
data-testid="agent-output-modal"
|
||||||
>
|
>
|
||||||
<DialogHeader className="flex-shrink-0">
|
<DialogHeader className="shrink-0">
|
||||||
<div className="flex items-center justify-between">
|
<div className="flex items-center justify-between">
|
||||||
<DialogTitle className="flex items-center gap-2">
|
<DialogTitle className="flex items-center gap-2">
|
||||||
{featureStatus !== 'verified' && featureStatus !== 'waiting_approval' && (
|
{featureStatus !== 'verified' && featureStatus !== 'waiting_approval' && (
|
||||||
@@ -347,7 +347,7 @@ export function AgentOutputModal({
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<DialogDescription
|
<DialogDescription
|
||||||
className="mt-1 max-h-24 overflow-y-auto break-words"
|
className="mt-1 max-h-24 overflow-y-auto wrap-break-word"
|
||||||
data-testid="agent-output-description"
|
data-testid="agent-output-description"
|
||||||
>
|
>
|
||||||
{featureDescription}
|
{featureDescription}
|
||||||
@@ -358,11 +358,12 @@ export function AgentOutputModal({
|
|||||||
<TaskProgressPanel
|
<TaskProgressPanel
|
||||||
featureId={featureId}
|
featureId={featureId}
|
||||||
projectPath={projectPath}
|
projectPath={projectPath}
|
||||||
className="flex-shrink-0 mx-1"
|
className="shrink-0 rounded-lg"
|
||||||
|
defaultExpanded={false}
|
||||||
/>
|
/>
|
||||||
|
|
||||||
{viewMode === 'changes' ? (
|
{viewMode === 'changes' ? (
|
||||||
<div className="flex-1 min-h-[400px] max-h-[60vh] overflow-y-auto scrollbar-visible">
|
<div className="flex-1 min-h-0 overflow-y-auto scrollbar-visible">
|
||||||
{projectPath ? (
|
{projectPath ? (
|
||||||
<GitDiffPanel
|
<GitDiffPanel
|
||||||
projectPath={projectPath}
|
projectPath={projectPath}
|
||||||
@@ -383,7 +384,7 @@ export function AgentOutputModal({
|
|||||||
<div
|
<div
|
||||||
ref={scrollRef}
|
ref={scrollRef}
|
||||||
onScroll={handleScroll}
|
onScroll={handleScroll}
|
||||||
className="flex-1 overflow-y-auto bg-zinc-950 rounded-lg p-4 font-mono text-xs min-h-[400px] max-h-[60vh] scrollbar-visible"
|
className="flex-1 min-h-0 overflow-y-auto bg-zinc-950 rounded-lg p-4 font-mono text-xs scrollbar-visible"
|
||||||
>
|
>
|
||||||
{isLoading && !output ? (
|
{isLoading && !output ? (
|
||||||
<div className="flex items-center justify-center h-full text-muted-foreground">
|
<div className="flex items-center justify-center h-full text-muted-foreground">
|
||||||
@@ -397,11 +398,11 @@ export function AgentOutputModal({
|
|||||||
) : viewMode === 'parsed' ? (
|
) : viewMode === 'parsed' ? (
|
||||||
<LogViewer output={output} />
|
<LogViewer output={output} />
|
||||||
) : (
|
) : (
|
||||||
<div className="whitespace-pre-wrap break-words text-zinc-300">{output}</div>
|
<div className="whitespace-pre-wrap wrap-break-word text-zinc-300">{output}</div>
|
||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div className="text-xs text-muted-foreground text-center flex-shrink-0">
|
<div className="text-xs text-muted-foreground text-center shrink-0">
|
||||||
{autoScrollRef.current
|
{autoScrollRef.current
|
||||||
? 'Auto-scrolling enabled'
|
? 'Auto-scrolling enabled'
|
||||||
: 'Scroll to bottom to enable auto-scroll'}
|
: 'Scroll to bottom to enable auto-scroll'}
|
||||||
|
|||||||
Reference in New Issue
Block a user