Fix missing tooltips in several components.

This commit is contained in:
dleffel 2025-02-26 21:34:56 -08:00
parent 44308630eb
commit 4806ab5420
4 changed files with 49 additions and 3 deletions

View file

@ -25,6 +25,7 @@ const Announcement = ({ version, hideAnnouncement }: AnnouncementProps) => {
<VSCodeButton
appearance="icon"
onClick={hideAnnouncement}
title="Hide announcement"
style={{ position: "absolute", top: "8px", right: "8px" }}>
<span className="codicon codicon-close"></span>
</VSCodeButton>

View file

@ -798,6 +798,7 @@ const ChatTextArea = forwardRef<HTMLTextAreaElement, ChatTextAreaProps>(
<select
value={mode}
disabled={textAreaDisabled}
title="Select mode for interaction"
onChange={(e) => {
const value = e.target.value
if (value === "prompts-action") {
@ -849,6 +850,7 @@ const ChatTextArea = forwardRef<HTMLTextAreaElement, ChatTextAreaProps>(
<select
value={currentApiConfigName || ""}
disabled={textAreaDisabled}
title="Select API configuration"
onChange={(e) => {
const value = e.target.value
if (value === "settings-action") {
@ -915,6 +917,7 @@ const ChatTextArea = forwardRef<HTMLTextAreaElement, ChatTextAreaProps>(
role="button"
aria-label="enhance prompt"
data-testid="enhance-prompt-button"
title="Enhance prompt with additional context"
className={`input-icon-button ${
textAreaDisabled ? "disabled" : ""
} codicon codicon-sparkle`}
@ -927,11 +930,13 @@ const ChatTextArea = forwardRef<HTMLTextAreaElement, ChatTextAreaProps>(
className={`input-icon-button ${
shouldDisableImages ? "disabled" : ""
} codicon codicon-device-camera`}
title="Add images to message"
onClick={() => !shouldDisableImages && onSelectImages()}
style={{ fontSize: 16.5 }}
/>
<span
className={`input-icon-button ${textAreaDisabled ? "disabled" : ""} codicon codicon-send`}
title="Send message"
onClick={() => !textAreaDisabled && onSend()}
style={{ fontSize: 15 }}
/>

View file

@ -1077,7 +1077,8 @@ const ChatView = ({ isHidden, showAnnouncement, hideAnnouncement, showHistoryVie
onClick={() => {
scrollToBottomSmooth()
disableAutoScrollRef.current = false
}}>
}}
title="Scroll to bottom of chat">
<span className="codicon codicon-chevron-down" style={{ fontSize: "18px" }}></span>
</ScrollToBottomButton>
</div>
@ -1101,6 +1102,25 @@ const ChatView = ({ isHidden, showAnnouncement, hideAnnouncement, showHistoryVie
flex: secondaryButtonText ? 1 : 2,
marginRight: secondaryButtonText ? "6px" : "0",
}}
title={
primaryButtonText === "Retry"
? "Try the operation again"
: primaryButtonText === "Save"
? "Save the file changes"
: primaryButtonText === "Approve"
? "Approve this action"
: primaryButtonText === "Run Command"
? "Execute this command"
: primaryButtonText === "Start New Task"
? "Begin a new task"
: primaryButtonText === "Resume Task"
? "Continue the current task"
: primaryButtonText === "Proceed Anyways"
? "Continue despite warnings"
: primaryButtonText === "Proceed While Running"
? "Continue while command executes"
: undefined
}
onClick={(e) => handlePrimaryButtonClick(inputValue, selectedImages)}>
{primaryButtonText}
</VSCodeButton>
@ -1113,6 +1133,17 @@ const ChatView = ({ isHidden, showAnnouncement, hideAnnouncement, showHistoryVie
flex: isStreaming ? 2 : 1,
marginLeft: isStreaming ? 0 : "6px",
}}
title={
isStreaming
? "Cancel the current operation"
: secondaryButtonText === "Start New Task"
? "Begin a new task"
: secondaryButtonText === "Reject"
? "Reject this action"
: secondaryButtonText === "Terminate"
? "End the current task"
: undefined
}
onClick={(e) => handleSecondaryButtonClick(inputValue, selectedImages)}>
{isStreaming ? "Cancel" : secondaryButtonText}
</VSCodeButton>

View file

@ -180,7 +180,11 @@ const TaskHeader: React.FC<TaskHeaderProps> = ({
${totalCost?.toFixed(4)}
</div>
)}
<VSCodeButton appearance="icon" onClick={onClose} style={{ marginLeft: 6, flexShrink: 0 }}>
<VSCodeButton
appearance="icon"
onClick={onClose}
style={{ marginLeft: 6, flexShrink: 0 }}
title="Close task and start a new one">
<span className="codicon codicon-close"></span>
</VSCodeButton>
</div>
@ -348,13 +352,18 @@ export const highlightMentions = (text?: string, withShadow = true) => {
const TaskActions = ({ item }: { item: HistoryItem | undefined }) => (
<div className="flex flex-row gap-1">
<Button variant="ghost" size="sm" onClick={() => vscode.postMessage({ type: "exportCurrentTask" })}>
<Button
variant="ghost"
size="sm"
title="Export task history"
onClick={() => vscode.postMessage({ type: "exportCurrentTask" })}>
<span className="codicon codicon-cloud-download" />
</Button>
{!!item?.size && item.size > 0 && (
<Button
variant="ghost"
size="sm"
title="Delete task from history"
onClick={() => vscode.postMessage({ type: "deleteTaskWithId", text: item.id })}>
<span className="codicon codicon-trash" />
{prettyBytes(item.size)}