Elffuss BraidHub

kikocis/continue public

Revert "fix: diff colors should reach till end"
Changesetd1338205333d7fb86dfe5a2d876df926d0b7e48e06ae49de7d6ce5cad1c84342
AuthorDallin Romney <dallinromney@gmail.com> · 2025-09-09 17:51 -07:00
CommitterGitHub <noreply@github.com> · 2025-09-09 17:51 -07:00
Parentsb84bb7c0ebe7

Browse the files at this changeset

1 file changed

modified gui/src/pages/gui/ToolCallDiv/FindAndReplace.tsx +2 −14
@@ -4,7 +4,7 @@
44 import { renderContextItems } from "core/util/messageContent";
55 import { getLastNPathParts, getUriPathBasename } from "core/util/uri";
66 import { diffLines } from "diff";
7-import { useContext, useEffect, useMemo, useRef, useState } from "react";
7+import { useContext, useMemo, useState } from "react";
88 import { ApplyActions } from "../../../components/StyledMarkdownPreview/StepContainerPreToolbar/ApplyActions";
99 import { FileInfo } from "../../../components/StyledMarkdownPreview/StepContainerPreToolbar/FileInfo";
1010 import { IdeMessengerContext } from "../../../context/IdeMessenger";
@@ -77,8 +77,6 @@
7777 historyIndex,
7878 }: FindAndReplaceDisplayProps) {
7979 const [isExpanded, setIsExpanded] = useState<boolean | undefined>(undefined);
80- const [diffWidth, setDiffWidth] = useState<number | undefined>(undefined);
81- const diffDivRef = useRef<HTMLDivElement>(null);
8280 const ideMessenger = useContext(IdeMessengerContext);
8381 const applyState: ApplyState | undefined = useAppSelector((state) =>
8482 selectApplyStateByToolCallId(state, toolCallId),
@@ -238,22 +236,12 @@
238236 );
239237 }
240238
241- useEffect(() => {
242- if (!diffDivRef.current) return;
243- const newWidth =
244- diffDivRef.current?.scrollWidth ??
245- diffDivRef.current?.getBoundingClientRect().width;
246- setDiffWidth(newWidth ? Math.ceil(newWidth) : undefined);
247- }, [isExpanded]);
248-
249239 return renderContainer(
250240 <div
251241 className={`${config?.ui?.showChatScrollbar ? "thin-scrollbar" : "no-scrollbar"} max-h-72 overflow-auto`}
252- ref={diffDivRef}
253242 >
254243 <pre
255- className={`bg-editor m-0 text-xs leading-tight ${config?.ui?.codeWrap ? "whitespace-pre-wrap" : "whitespace-pre"}`}
256- style={{ width: diffWidth ? `${diffWidth}px` : "100%" }}
244+ className={`bg-editor m-0 w-full text-xs leading-tight ${config?.ui?.codeWrap ? "whitespace-pre-wrap" : "whitespace-pre"}`}
257245 >
258246 {diffResult.diff?.map((part, index) => {
259247 if (part.removed) {