diff --git a/src/core/task/focus-chain/file-utils.ts b/src/core/task/focus-chain/file-utils.ts index ba68b72c..c7488f51 100644 --- a/src/core/task/focus-chain/file-utils.ts +++ b/src/core/task/focus-chain/file-utils.ts @@ -17,12 +17,12 @@ export function getFocusChainFilePath(taskDir: string, taskId: string): string { export function createFocusChainMarkdownContent(taskId: string, focusChainList: string): string { return `# Focus Chain List for Task ${taskId} - + ${focusChainList} -` +` } /** diff --git a/webview-ui/src/components/chat/ChatTextArea.tsx b/webview-ui/src/components/chat/ChatTextArea.tsx index 8bfe2136..62655586 100644 --- a/webview-ui/src/components/chat/ChatTextArea.tsx +++ b/webview-ui/src/components/chat/ChatTextArea.tsx @@ -1428,7 +1428,7 @@ const ChatTextArea = forwardRef( return (
( )}
( fontSize: "var(--vscode-editor-font-size)", lineHeight: "var(--vscode-editor-line-height)", borderRadius: 2, - borderLeft: 0, - borderRight: 0, - borderTop: 0, - borderColor: "transparent", - borderBottom: `${thumbnailsHeight}px solid transparent`, - padding: "9px 28px 9px 9px", + borderLeft: isTextAreaFocused || isVoiceRecording ? 0 : undefined, + borderRight: isTextAreaFocused || isVoiceRecording ? 0 : undefined, + borderTop: isTextAreaFocused || isVoiceRecording ? 0 : undefined, + borderBottom: isTextAreaFocused || isVoiceRecording ? 0 : undefined, + padding: `9px 28px ${9 + thumbnailsHeight}px 9px`, }} /> ( /> )}
{dictationSettings?.dictationEnabled === true && dictationSettings?.featureEnabled && ( @@ -1686,16 +1684,16 @@ const ChatTextArea = forwardRef(
-
+
{/* Always render both components, but control visibility with CSS */} -
+
{/* ButtonGroup - always in DOM but visibility controlled */} - + @@ -1708,7 +1706,7 @@ const ChatTextArea = forwardRef( { diff --git a/webview-ui/src/components/chat/chat-view/components/layout/ActionButtons.tsx b/webview-ui/src/components/chat/chat-view/components/layout/ActionButtons.tsx index 2bebc5f6..e5c81fc3 100644 --- a/webview-ui/src/components/chat/chat-view/components/layout/ActionButtons.tsx +++ b/webview-ui/src/components/chat/chat-view/components/layout/ActionButtons.tsx @@ -145,7 +145,7 @@ export const ActionButtons: React.FC = ({ {secondaryText && secondaryAction && ( handleActionClick(secondaryAction, inputValue, selectedImages, selectedFiles)}> {secondaryText} diff --git a/webview-ui/src/components/chat/task-header/AutoCondenseMarker.tsx b/webview-ui/src/components/chat/task-header/AutoCondenseMarker.tsx index 0df979c4..81970dca 100644 --- a/webview-ui/src/components/chat/task-header/AutoCondenseMarker.tsx +++ b/webview-ui/src/components/chat/task-header/AutoCondenseMarker.tsx @@ -116,12 +116,9 @@ export const AutoCondenseMarker: React.FC<{ }}> {(isContextWindowHoverOpen || isAnimating || showPercentageAfterAnimation) && (
+ className={cn("absolute -top-4 -left-1 text-button-background font-mono text-xs", { + "opacity-0": isFadingOut, + })}> {marker.label}%
)} diff --git a/webview-ui/src/components/chat/task-header/CheckpointError.tsx b/webview-ui/src/components/chat/task-header/CheckpointError.tsx index b009d47e..b5600dc2 100644 --- a/webview-ui/src/components/chat/task-header/CheckpointError.tsx +++ b/webview-ui/src/components/chat/task-header/CheckpointError.tsx @@ -24,9 +24,9 @@ export const CheckpointError: React.FC = ({ return null } return ( -
+
diff --git a/webview-ui/src/components/chat/task-header/ContextWindow.tsx b/webview-ui/src/components/chat/task-header/ContextWindow.tsx index efeb4ce2..9eb41abf 100644 --- a/webview-ui/src/components/chat/task-header/ContextWindow.tsx +++ b/webview-ui/src/components/chat/task-header/ContextWindow.tsx @@ -124,8 +124,8 @@ const ContextWindow: React.FC = ({ } return { percentage: (lastApiReqTotalTokens / contextWindow) * 100, - max: formatTokenNumber(contextWindow), - used: formatTokenNumber(lastApiReqTotalTokens), + max: contextWindow, + used: lastApiReqTotalTokens, } }, [contextWindow, lastApiReqTotalTokens]) @@ -207,7 +207,7 @@ const ContextWindow: React.FC = ({
- {tokenData.used} + {formatTokenNumber(tokenData.used)}
setIsOpened(true)}> = ({ aria-valuemin={0} aria-valuenow={Math.round(threshold * 100)} aria-valuetext={`${Math.round(threshold * 100)}% threshold`} - className="relative w-full text-badge-foreground context-window-progress brightness-100" + className="relative w-full text-foreground context-window-progress brightness-100" onFocus={handleFocus} onKeyDown={handleKeyDown} ref={progressBarRef} @@ -271,7 +271,7 @@ const ContextWindow: React.FC = ({
- {tokenData.max} + {formatTokenNumber(tokenData.max)}
diff --git a/webview-ui/src/components/chat/task-header/ContextWindowSummary.tsx b/webview-ui/src/components/chat/task-header/ContextWindowSummary.tsx index 126a8519..99b16264 100644 --- a/webview-ui/src/components/chat/task-header/ContextWindowSummary.tsx +++ b/webview-ui/src/components/chat/task-header/ContextWindowSummary.tsx @@ -17,8 +17,8 @@ interface TokenDetail { interface TaskContextWindowButtonsProps extends TokenUsageInfoProps { percentage: number - tokenUsed: string - contextWindow: string + tokenUsed: number + contextWindow: number autoCompactThreshold?: number isThresholdChanged?: boolean isThresholdFadingOut?: boolean @@ -121,7 +121,7 @@ export const ContextWindowSummary: React.FC = ({ }) }, []) - const totalTokens = (tokensIn || 0) + (tokensOut || 0) + const totalTokens = (tokensIn || 0) + (tokensOut || 0) + (cacheWrites || 0) + (cacheReads || 0) return (
@@ -146,21 +146,19 @@ export const ContextWindowSummary: React.FC = ({ isExpanded={expandedSections.has("context")} onToggle={(event) => toggleSection("context", event)} title="Context Window" - value={percentage ? `${percentage.toFixed(1)}% used` : contextWindow}> + value={percentage ? `${percentage.toFixed(1)}% used` : formatTokenNumber(contextWindow)}>
Used: - {tokenUsed} + {formatTokenNumber(tokenUsed)}
Total: - {contextWindow} + {formatTokenNumber(contextWindow)}
Remaining: - - {formatTokenNumber(parseInt(contextWindow.replace(/,/g, "")) - parseInt(tokenUsed.replace(/,/g, "")))} - + {formatTokenNumber(contextWindow - tokenUsed)}
diff --git a/webview-ui/src/components/chat/task-header/FocusChain.tsx b/webview-ui/src/components/chat/task-header/FocusChain.tsx index fa2523fc..82af21b6 100644 --- a/webview-ui/src/components/chat/task-header/FocusChain.tsx +++ b/webview-ui/src/components/chat/task-header/FocusChain.tsx @@ -1,7 +1,7 @@ import { cn } from "@heroui/react" import { isCompletedFocusChainItem, isFocusChainItem } from "@shared/focus-chain-utils" import { StringRequest } from "@shared/proto/cline/common" -import { ChevronDownIcon, ChevronRightIcon } from "lucide-react" +import { ChevronDownIcon, ChevronRightIcon, PencilIcon } from "lucide-react" import React, { memo, useCallback, useMemo, useState } from "react" import ChecklistRenderer from "@/components/common/ChecklistRenderer" import { FileServiceClient } from "@/services/grpc-client" @@ -31,46 +31,30 @@ const ToDoListHeader = memo<{ todoInfo: TodoInfo isExpanded: boolean }>(({ todoInfo, isExpanded }) => { - const { currentTodo, currentIndex, totalCount, completedCount, progressPercentage } = todoInfo + const { currentTodo, currentIndex, totalCount, completedCount } = todoInfo const isCompleted = completedCount === totalCount // Pre-compute display text const displayText = isCompleted ? COMPLETED_MESSAGE : currentTodo?.text || TODO_LIST_LABEL return ( -
-
-
-
- - {currentIndex}/{totalCount} - - - {displayText} - -
-
- {isExpanded ? : } -
+
+
+ + {currentIndex}/{totalCount} + + + {displayText} + +
+
+ {isExpanded ? : }
) @@ -158,6 +142,7 @@ const parseCurrentTodoInfo = (text: string): TodoInfo | null => { export const FocusChain: React.FC = memo( ({ currentTaskItemId, lastProgressMessageText }) => { const [isExpanded, setIsExpanded] = useState(false) + const [isHoveringList, setIsHoveringList] = useState(false) // Parse todo info with caching const todoInfo = useMemo( @@ -188,18 +173,78 @@ export const FocusChain: React.FC = memo( return (
- - {isExpanded && ( -
- - {isCompleted && ( -
{NEW_STEPS_MESSAGE}
- )} -
- )} + {/* Progress bar background */} +
+ {/* Content with higher z-index */} +
+ + {isExpanded && ( +
setIsHoveringList(true)} + onMouseLeave={() => setIsHoveringList(false)}> + +
+ +
+ {/* {isCompleted && ( +
{NEW_STEPS_MESSAGE}
+ )} */} + {/* Pencil icon on hover */} +
+ +
+
+ )} +
) }, diff --git a/webview-ui/src/components/chat/task-header/TaskHeader.tsx b/webview-ui/src/components/chat/task-header/TaskHeader.tsx index ac8cc7b8..10aa8906 100644 --- a/webview-ui/src/components/chat/task-header/TaskHeader.tsx +++ b/webview-ui/src/components/chat/task-header/TaskHeader.tsx @@ -33,7 +33,7 @@ interface TaskHeaderProps { onSendMessage?: (command: string, files: string[], images: string[]) => void } -const BUTTON_CLASS = "max-h-3 border-0 font-bold bg-transparent hover:opacity-100 text-badge-foreground" +const BUTTON_CLASS = "max-h-3 border-0 font-bold bg-transparent hover:opacity-100 text-foreground" const TaskHeader: React.FC = ({ task, @@ -88,7 +88,7 @@ const TaskHeader: React.FC = ({ const highlightedText = useMemo(() => highlightText(task.text, false), [task.text]) return ( -
+
{/* Display Checkpoint Error */} = ({ {/* Task Header */}
@@ -146,7 +146,7 @@ const TaskHeader: React.FC = ({
{highlightedText}
diff --git a/webview-ui/src/components/chat/task-header/TaskTimeline.tsx b/webview-ui/src/components/chat/task-header/TaskTimeline.tsx index 945afa05..7ae3c3ec 100644 --- a/webview-ui/src/components/chat/task-header/TaskTimeline.tsx +++ b/webview-ui/src/components/chat/task-header/TaskTimeline.tsx @@ -9,7 +9,7 @@ import { getColor } from "./util" // Timeline dimensions and spacing const TIMELINE_HEIGHT = "12px" -const BLOCK_WIDTH = "13px" +const BLOCK_WIDTH = "11px" const BLOCK_GAP = "4px" const _TOOLTIP_MARGIN = 32 // 32px margin on each side @@ -85,11 +85,12 @@ const TaskTimeline: React.FC = ({ messages, onBlockClick }) =
) @@ -122,13 +123,14 @@ const TaskTimeline: React.FC = ({ messages, onBlockClick }) = onMouseLeave={handleMouseLeave} style={{ width: BLOCK_WIDTH, - height: "100%", + height: BLOCK_WIDTH, backgroundColor: getColor(message), flexShrink: 0, cursor: "pointer", marginRight: BLOCK_GAP, opacity: isHovered ? 0.7 : 1, transition: "opacity 0.2s ease", + borderRadius: "50%", }} /> diff --git a/webview-ui/src/components/chat/task-header/buttons/CompactTaskButton.tsx b/webview-ui/src/components/chat/task-header/buttons/CompactTaskButton.tsx index f95f5659..d0efff3c 100644 --- a/webview-ui/src/components/chat/task-header/buttons/CompactTaskButton.tsx +++ b/webview-ui/src/components/chat/task-header/buttons/CompactTaskButton.tsx @@ -17,11 +17,13 @@ const CompactTaskButton: React.FC<{
} + delay={0} + disableAnimation={true} placement="bottom"> handleCopy()} radius="sm" size="sm"> - {copied ? : } + {copied ? : } ) diff --git a/webview-ui/src/components/chat/task-header/buttons/DeleteTaskButton.tsx b/webview-ui/src/components/chat/task-header/buttons/DeleteTaskButton.tsx index c311c1ef..5542f55e 100644 --- a/webview-ui/src/components/chat/task-header/buttons/DeleteTaskButton.tsx +++ b/webview-ui/src/components/chat/task-header/buttons/DeleteTaskButton.tsx @@ -20,7 +20,7 @@ const DeleteTaskButton: React.FC<{ }} radius="sm" size="sm"> - + ) diff --git a/webview-ui/src/components/common/ChecklistRenderer.tsx b/webview-ui/src/components/common/ChecklistRenderer.tsx index ace78c57..7e16b719 100644 --- a/webview-ui/src/components/common/ChecklistRenderer.tsx +++ b/webview-ui/src/components/common/ChecklistRenderer.tsx @@ -105,15 +105,12 @@ const ChecklistRenderer: React.FC = ({ text }) => { }}> {items.map((item, index) => ( // biome-ignore lint/suspicious/noArrayIndexKey: Using index as key for checklist items -
- +
+ {item.checked ? : } - - - - { - setCompareDisabled(true) - try { - await CheckpointsServiceClient.checkpointDiff( - Int64Request.create({ - value: messageTs, - }), - ) - } catch (err) { - console.error("CheckpointDiff error:", err) - } finally { - setCompareDisabled(false) - } - }} - style={{ cursor: compareDisabled ? "wait" : "pointer" }}> - Compare - - -
+ +
+ + + setShowRestoreConfirm(true)}> - Restore + disabled={compareDisabled} + onClick={async () => { + setCompareDisabled(true) + try { + await CheckpointsServiceClient.checkpointDiff( + Int64Request.create({ + value: messageTs, + }), + ) + } catch (err) { + console.error("CheckpointDiff error:", err) + } finally { + setCompareDisabled(false) + } + }} + style={{ cursor: compareDisabled ? "wait" : "pointer" }}> + Compare - {showRestoreConfirm && - createPortal( - - - - Restore Files - -

- Restores your project's files back to a snapshot taken at this point (use "Compare" to see - what will be reverted) -

-
- - - Restore Task Only - -

Deletes messages after this point (does not affect workspace files)

-
- - - Restore Files & Task - -

Restores your project's files and deletes all messages after this point

-
-
, - document.body, - )} -
- - + +
+ setShowRestoreConfirm(true)}> + Restore + + {showRestoreConfirm && + createPortal( + + + + Restore Files + +

+ Restores your project's files back to a snapshot taken at this point (use "Compare" to + see what will be reverted) +

+
+ + + Restore Task Only + +

Deletes messages after this point (does not affect workspace files)

+
+ + + Restore Files & Task + +

Restores your project's files and deletes all messages after this point

+
+
, + document.body, + )} +
+ + +
) } @@ -277,6 +280,7 @@ const Container = styled.div<{ isMenuOpen?: boolean; $isCheckedOut?: boolean }>` gap: 4px; position: relative; min-width: 0; + min-height: 17px; margin-top: -10px; margin-bottom: -10px; opacity: ${(props) => (props.$isCheckedOut ? 1 : props.isMenuOpen ? 1 : 0.5)}; @@ -284,6 +288,26 @@ const Container = styled.div<{ isMenuOpen?: boolean; $isCheckedOut?: boolean }>` &:hover { opacity: 1; } + + .hover-content { + display: ${(props) => (props.isMenuOpen ? "flex" : "none")}; + align-items: center; + gap: 4px; + flex: 1; + } + + &:hover .hover-content { + display: flex; + } + + .hover-show-inverse { + display: ${(props) => (props.isMenuOpen ? "none" : "flex")}; + flex: 1; + } + + &:hover .hover-show-inverse { + display: none; + } ` const Label = styled.span<{ $isCheckedOut?: boolean }>` diff --git a/webview-ui/src/components/common/CopyButton.tsx b/webview-ui/src/components/common/CopyButton.tsx index 1774c87d..3088b872 100644 --- a/webview-ui/src/components/common/CopyButton.tsx +++ b/webview-ui/src/components/common/CopyButton.tsx @@ -26,6 +26,7 @@ interface WithCopyButtonProps { const StyledButton = styled(VSCodeButton)` z-index: 1; + transform: scale(0.9); ` // Unified container component @@ -49,7 +50,7 @@ const ButtonContainer = styled.div<{ $position?: "top-right" | "bottom-right" }> opacity: 0; ${ContentContainer}:hover & { - opacity: 1; + opacity: 0.5; } `