Elffuss BraidHub

kikocis/continue public

Merge pull request #6515 from continuedev/pe/truncate-btn-styling

fix: use correct styling on truncate btn
Changesetd3432ada2b047a94a37465bb703a0f2448be87c392c595071bc9b30f8a6ed2e2
AuthorDallin Romney <dallinromney@gmail.com> · 2025-07-08 13:27 -07:00
CommitterGitHub <noreply@github.com> · 2025-07-08 13:27 -07:00
Parents51e47455f9be, cd600673bdf6

Browse the files at this changeset

3 files changed

modified gui/src/components/StyledMarkdownPreview/StepContainerPreToolbar/ToolbarButtonWithTooltip.tsx +9 −10
@@ -1,6 +1,5 @@
11 import { ReactNode, useMemo } from "react";
2-import { Tooltip } from "react-tooltip";
3-import { getFontSize } from "../../../util";
2+import { ToolTip } from "../../gui/Tooltip";
43
54 interface ToolbarButtonWithTooltipProps {
65 onClick: () => void;
@@ -22,20 +21,20 @@
2221
2322 return (
2423 <>
25- <button
26- onClick={onClick}
27- style={{
28- fontSize: `${getFontSize() - 2}px`,
24+ <div
25+ onClick={(e) => {
26+ e.stopPropagation();
27+ onClick();
2928 }}
3029 data-tooltip-id={tooltipId}
3130 data-testid={testId}
32- className="text-foreground flex items-center border-none bg-transparent px-0.5 outline-none hover:cursor-pointer hover:brightness-125"
31+ className="hover:description-muted/30 cursor-pointer select-none rounded bg-transparent px-1 py-0.5 hover:opacity-80"
3332 >
3433 {children}
35- </button>
36- <Tooltip id={tooltipId} place="top">
34+ </div>
35+ <ToolTip id={tooltipId} place="top">
3736 {tooltipContent}
38- </Tooltip>
37+ </ToolTip>
3938 </>
4039 );
4140 }
modified gui/src/pages/gui/ToolCallDiv/ToolCallArgs.tsx +9 −21
@@ -1,6 +1,5 @@
11 import { CodeBracketIcon } from "@heroicons/react/24/outline";
2-import { useMemo } from "react";
3-import { ToolTip } from "../../../components/gui/Tooltip";
2+import { ToolbarButtonWithTooltip } from "../../../components/StyledMarkdownPreview/StepContainerPreToolbar/ToolbarButtonWithTooltip";
43
54 interface ArgsToggleIconProps {
65 isShowing: boolean;
@@ -13,26 +12,15 @@
1312 setIsShowing,
1413 toolCallId,
1514 }: ArgsToggleIconProps) => {
16- const argsTooltipId = useMemo(() => {
17- return "args-hover-" + toolCallId;
18- }, [toolCallId]);
19-
2015 return (
21- <>
22- <div
23- data-tooltip-id={argsTooltipId}
24- onClick={(e) => {
25- e.stopPropagation();
26- setIsShowing(!isShowing);
27- }}
28- className={`hover:description-muted/30 cursor-pointer select-none rounded px-1 py-0.5 hover:opacity-80 ${isShowing ? "bg-description-muted/30" : "bg-transparent"}`}
29- >
30- <CodeBracketIcon className="h-3 w-3 flex-shrink-0 opacity-60" />
31- </div>
32- <ToolTip id={argsTooltipId}>
33- {isShowing ? "Hide args" : "Show args"}
34- </ToolTip>
35- </>
16+ <ToolbarButtonWithTooltip
17+ tooltipContent={isShowing ? "Hide args" : "Show args"}
18+ onClick={() => {
19+ setIsShowing(!isShowing);
20+ }}
21+ >
22+ <CodeBracketIcon className="h-3 w-3 flex-shrink-0 opacity-60" />
23+ </ToolbarButtonWithTooltip>
3624 );
3725 };
3826
modified gui/src/pages/gui/ToolCallDiv/ToolTruncateHistoryIcon.tsx +3 −1
@@ -19,9 +19,11 @@
1919 }, [history]);
2020 const dispatch = useAppDispatch();
2121 const { mainEditor } = useMainEditor();
22+
2223 if (historyIndex === lastMessageIndex) {
2324 return null;
2425 }
26+
2527 return (
2628 <ToolbarButtonWithTooltip
2729 tooltipContent={isStreaming ? "" : "Trim chat to this message"}
@@ -38,7 +40,7 @@
3840 }}
3941 >
4042 <BarsArrowUpIcon
41- className={`h-3 w-3 flex-shrink-0 ${isStreaming ? "cursor-not-allowed" : "cursor-pointer"}`}
43+ className={`h-3 w-3 flex-shrink-0 opacity-60 ${isStreaming ? "cursor-not-allowed" : ""}`}
4244 />
4345 </ToolbarButtonWithTooltip>
4446 );