Skip to content

Commit fc70012

Browse files
elianivadaniel-lxs
andauthored
fix(ui): make auto approve toggle trigger stay (#7318)
Co-authored-by: daniel-lxs <[email protected]>
1 parent b433d1f commit fc70012

File tree

1 file changed

+23
-25
lines changed

1 file changed

+23
-25
lines changed

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

Lines changed: 23 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -157,12 +157,31 @@ const AutoApproveMenu = ({ style }: AutoApproveMenuProps) => {
157157
overflowY: "auto",
158158
...style,
159159
}}>
160+
{isExpanded && (
161+
<div className="flex flex-col gap-2 py-4">
162+
<div
163+
style={{
164+
color: "var(--vscode-descriptionForeground)",
165+
fontSize: "12px",
166+
}}>
167+
<Trans
168+
i18nKey="chat:autoApprove.description"
169+
components={{
170+
settingsLink: <VSCodeLink href="#" onClick={handleOpenSettings} />,
171+
}}
172+
/>
173+
</div>
174+
175+
<AutoApproveToggle {...toggles} onToggle={onAutoApproveToggle} />
176+
</div>
177+
)}
178+
160179
<div
161180
style={{
162181
display: "flex",
163182
alignItems: "center",
164183
gap: "8px",
165-
padding: isExpanded ? "8px 0" : "2px 0 0 0",
184+
padding: "2px 0 0 0",
166185
cursor: "pointer",
167186
}}
168187
onClick={toggleExpanded}>
@@ -215,33 +234,12 @@ const AutoApproveMenu = ({ style }: AutoApproveMenuProps) => {
215234
{displayText}
216235
</span>
217236
<span
218-
className={`codicon codicon-chevron-${isExpanded ? "down" : "right"}`}
219-
style={{
220-
flexShrink: 0,
221-
marginLeft: isExpanded ? "2px" : "-2px",
222-
}}
237+
className={`codicon codicon-chevron-right flex-shrink-0 transition-transform duration-200 ease-in-out ${
238+
isExpanded ? "-rotate-90 ml-[2px]" : "rotate-0 -ml-[2px]"
239+
}`}
223240
/>
224241
</div>
225242
</div>
226-
227-
{isExpanded && (
228-
<div className="flex flex-col gap-2">
229-
<div
230-
style={{
231-
color: "var(--vscode-descriptionForeground)",
232-
fontSize: "12px",
233-
}}>
234-
<Trans
235-
i18nKey="chat:autoApprove.description"
236-
components={{
237-
settingsLink: <VSCodeLink href="#" onClick={handleOpenSettings} />,
238-
}}
239-
/>
240-
</div>
241-
242-
<AutoApproveToggle {...toggles} onToggle={onAutoApproveToggle} />
243-
</div>
244-
)}
245243
</div>
246244
)
247245
}

0 commit comments

Comments
 (0)