Changesets · Branches · Tags · Compare
| Changeset | d3432ada2b047a94a37465bb703a0f2448be87c392c595071bc9b30f8a6ed2e2 |
|---|---|
| Author | Dallin Romney <dallinromney@gmail.com> · 2025-07-08 13:27 -07:00 |
| Committer | GitHub <noreply@github.com> · 2025-07-08 13:27 -07:00 |
| Parents | 51e47455f9be, cd600673bdf6 |
3 files changed
modified gui/src/components/StyledMarkdownPreview/StepContainerPreToolbar/ToolbarButtonWithTooltip.tsx +9 −10
| @@ -1,6 +1,5 @@ | ||
| 1 | 1 | import { ReactNode, useMemo } from "react"; |
| 2 | -import { Tooltip } from "react-tooltip"; | |
| 3 | -import { getFontSize } from "../../../util"; | |
| 2 | +import { ToolTip } from "../../gui/Tooltip"; | |
| 4 | 3 | |
| 5 | 4 | interface ToolbarButtonWithTooltipProps { |
| 6 | 5 | onClick: () => void; |
| @@ -22,20 +21,20 @@ | ||
| 22 | 21 | |
| 23 | 22 | return ( |
| 24 | 23 | <> |
| 25 | - <button | |
| 26 | - onClick={onClick} | |
| 27 | - style={{ | |
| 28 | - fontSize: `${getFontSize() - 2}px`, | |
| 24 | + <div | |
| 25 | + onClick={(e) => { | |
| 26 | + e.stopPropagation(); | |
| 27 | + onClick(); | |
| 29 | 28 | }} |
| 30 | 29 | data-tooltip-id={tooltipId} |
| 31 | 30 | 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" | |
| 33 | 32 | > |
| 34 | 33 | {children} |
| 35 | - </button> | |
| 36 | - <Tooltip id={tooltipId} place="top"> | |
| 34 | + </div> | |
| 35 | + <ToolTip id={tooltipId} place="top"> | |
| 37 | 36 | {tooltipContent} |
| 38 | - </Tooltip> | |
| 37 | + </ToolTip> | |
| 39 | 38 | </> |
| 40 | 39 | ); |
| 41 | 40 | } |
modified gui/src/pages/gui/ToolCallDiv/ToolCallArgs.tsx +9 −21
| @@ -1,6 +1,5 @@ | ||
| 1 | 1 | 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"; | |
| 4 | 3 | |
| 5 | 4 | interface ArgsToggleIconProps { |
| 6 | 5 | isShowing: boolean; |
| @@ -13,26 +12,15 @@ | ||
| 13 | 12 | setIsShowing, |
| 14 | 13 | toolCallId, |
| 15 | 14 | }: ArgsToggleIconProps) => { |
| 16 | - const argsTooltipId = useMemo(() => { | |
| 17 | - return "args-hover-" + toolCallId; | |
| 18 | - }, [toolCallId]); | |
| 19 | - | |
| 20 | 15 | 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> | |
| 36 | 24 | ); |
| 37 | 25 | }; |
| 38 | 26 |
modified gui/src/pages/gui/ToolCallDiv/ToolTruncateHistoryIcon.tsx +3 −1
| @@ -19,9 +19,11 @@ | ||
| 19 | 19 | }, [history]); |
| 20 | 20 | const dispatch = useAppDispatch(); |
| 21 | 21 | const { mainEditor } = useMainEditor(); |
| 22 | + | |
| 22 | 23 | if (historyIndex === lastMessageIndex) { |
| 23 | 24 | return null; |
| 24 | 25 | } |
| 26 | + | |
| 25 | 27 | return ( |
| 26 | 28 | <ToolbarButtonWithTooltip |
| 27 | 29 | tooltipContent={isStreaming ? "" : "Trim chat to this message"} |
| @@ -38,7 +40,7 @@ | ||
| 38 | 40 | }} |
| 39 | 41 | > |
| 40 | 42 | <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" : ""}`} | |
| 42 | 44 | /> |
| 43 | 45 | </ToolbarButtonWithTooltip> |
| 44 | 46 | ); |