Skip to content

Commit 3dc561b

Browse files
committed
Better alignment and icons for FollowUpSuggest
1 parent b710aff commit 3dc561b

File tree

2 files changed

+27
-20
lines changed

2 files changed

+27
-20
lines changed

webview-ui/src/components/chat/ChatRow.tsx

Lines changed: 20 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,17 @@ import { McpExecution } from "./McpExecution"
4545
import { ChatTextArea } from "./ChatTextArea"
4646
import { MAX_IMAGES_PER_MESSAGE } from "./ChatView"
4747
import { useSelectedModel } from "../ui/hooks/useSelectedModel"
48-
import { ChevronRight, ChevronDown, Eye, FileDiff, ListTree, User, Edit, Trash2 } from "lucide-react"
48+
import {
49+
ChevronRight,
50+
ChevronDown,
51+
Eye,
52+
FileDiff,
53+
ListTree,
54+
User,
55+
Edit,
56+
Trash2,
57+
MessageCircleQuestionMark,
58+
} from "lucide-react"
4959
import { cn } from "@/lib/utils"
5060

5161
interface ChatRowProps {
@@ -303,10 +313,7 @@ export const ChatRowContent = ({
303313
]
304314
case "followup":
305315
return [
306-
<span
307-
className="codicon codicon-question"
308-
style={{ color: normalColor, marginBottom: "-1.5px" }}
309-
/>,
316+
<MessageCircleQuestionMark className="w-4" />,
310317
<span style={{ color: normalColor, fontWeight: "bold" }}>{t("chat:questions.hasQuestion")}</span>,
311318
]
312319
default:
@@ -1472,18 +1479,18 @@ export const ChatRowContent = ({
14721479
{title}
14731480
</div>
14741481
)}
1475-
<div style={{ paddingTop: 10, paddingBottom: 15 }}>
1482+
<div className="flex flex-col gap-2 ml-6">
14761483
<Markdown
14771484
markdown={message.partial === true ? message?.text : followUpData?.question}
14781485
/>
1486+
<FollowUpSuggest
1487+
suggestions={followUpData?.suggest}
1488+
onSuggestionClick={onSuggestionClick}
1489+
ts={message?.ts}
1490+
onCancelAutoApproval={onFollowUpUnmount}
1491+
isAnswered={isFollowUpAnswered}
1492+
/>
14791493
</div>
1480-
<FollowUpSuggest
1481-
suggestions={followUpData?.suggest}
1482-
onSuggestionClick={onSuggestionClick}
1483-
ts={message?.ts}
1484-
onCancelAutoApproval={onFollowUpUnmount}
1485-
isAnswered={isFollowUpAnswered}
1486-
/>
14871494
</>
14881495
)
14891496
case "auto_approval_max_req_reached": {

webview-ui/src/components/chat/FollowUpSuggest.tsx

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { useCallback, useEffect, useState } from "react"
2-
import { Edit } from "lucide-react"
2+
import { ClipboardCopy } from "lucide-react"
33

44
import { Button, StandardTooltip } from "@/components/ui"
55

@@ -108,10 +108,12 @@ export const FollowUpSuggest = ({
108108
const isFirstSuggestion = index === 0
109109

110110
return (
111-
<div key={`${suggestion.answer}-${ts}`} className="w-full relative group">
111+
<div
112+
key={`${suggestion.answer}-${ts}`}
113+
className="bg-vscode-editor-background rounded-sm w-full relative group">
112114
<Button
113115
variant="outline"
114-
className="text-left whitespace-normal break-words w-full h-auto py-3 justify-start pr-8"
116+
className="text-left whitespace-normal break-words w-full h-auto px-3 py-2 justify-start pr-8"
115117
onClick={(event) => handleSuggestionClick(suggestion, event)}
116118
aria-label={suggestion.answer}>
117119
{suggestion.answer}
@@ -131,7 +133,7 @@ export const FollowUpSuggest = ({
131133
)}
132134
<StandardTooltip content={t("chat:followUpSuggest.copyToInput")}>
133135
<div
134-
className="absolute top-0 right-0 opacity-0 group-hover:opacity-100 transition-opacity"
136+
className="absolute cursor-pointer top-2 right-3 opacity-0 group-hover:opacity-100 transition-opacity"
135137
onClick={(e) => {
136138
e.stopPropagation()
137139
// Cancel the auto-approve timer when edit button is clicked
@@ -140,9 +142,7 @@ export const FollowUpSuggest = ({
140142
// Simulate shift-click by directly calling the handler with shiftKey=true.
141143
onSuggestionClick?.(suggestion, { ...e, shiftKey: true })
142144
}}>
143-
<Button variant="ghost" size="icon">
144-
<Edit />
145-
</Button>
145+
<ClipboardCopy className="w-4" />
146146
</div>
147147
</StandardTooltip>
148148
</div>

0 commit comments

Comments
 (0)