Merge pull request #5656 from continuedev/dallin/apply-1-line
Fix: codeblocks hanging on one line for tool calls
This commit is contained in:
commit
c720e9a1e1
3 changed files with 11 additions and 6 deletions
|
|
@ -243,7 +243,7 @@ export function StepContainerPreToolbar({
|
|||
const plural = numLines === 1 ? "" : "s";
|
||||
if (isGeneratingCodeBlock) {
|
||||
return (
|
||||
<span className="text-lightgray inline-flex w-min items-center gap-2">
|
||||
<span className="text-lightgray inline-flex items-center gap-2 text-right">
|
||||
{!isExpanded ? `${numLines} line${plural}` : "Generating"}{" "}
|
||||
<div>
|
||||
<Spinner />
|
||||
|
|
@ -252,7 +252,7 @@ export function StepContainerPreToolbar({
|
|||
);
|
||||
} else {
|
||||
return (
|
||||
<span className="text-lightgray inline-flex w-min items-center gap-2">
|
||||
<span className="text-lightgray inline-flex items-center gap-2 text-right">
|
||||
{`${numLines} line${plural} pending`}
|
||||
</span>
|
||||
);
|
||||
|
|
|
|||
|
|
@ -8,6 +8,10 @@ interface CreateFileToolCallProps {
|
|||
}
|
||||
|
||||
export function CreateFile(props: CreateFileToolCallProps) {
|
||||
if (!props.fileContents) {
|
||||
return null;
|
||||
}
|
||||
|
||||
const src = `\`\`\`${getMarkdownLanguageTagForFile(props.relativeFilepath ?? "output.txt")} ${props.relativeFilepath}\n${props.fileContents ?? ""}\n\`\`\``;
|
||||
|
||||
return props.relativeFilepath ? (
|
||||
|
|
|
|||
|
|
@ -16,13 +16,12 @@ type EditToolCallProps = {
|
|||
};
|
||||
|
||||
export function EditFile(props: EditToolCallProps) {
|
||||
const src = `\`\`\`${getMarkdownLanguageTagForFile(props.relativeFilePath ?? "test.txt")} ${props.relativeFilePath}\n${props.changes ?? ""}\n\`\`\``;
|
||||
|
||||
const dispatch = useAppDispatch();
|
||||
const isStreaming = useAppSelector((state) => state.session.isStreaming);
|
||||
|
||||
const applyState = useAppSelector((state) =>
|
||||
selectApplyStateByToolCallId(state, props.toolCallId),
|
||||
);
|
||||
|
||||
useEffect(() => {
|
||||
if (!applyState) {
|
||||
dispatch(
|
||||
|
|
@ -35,10 +34,12 @@ export function EditFile(props: EditToolCallProps) {
|
|||
}
|
||||
}, [applyState, props.toolCallId]);
|
||||
|
||||
if (!props.relativeFilePath) {
|
||||
if (!props.relativeFilePath || !props.changes) {
|
||||
return null;
|
||||
}
|
||||
|
||||
const src = `\`\`\`${getMarkdownLanguageTagForFile(props.relativeFilePath ?? "test.txt")} ${props.relativeFilePath}\n${props.changes}\n\`\`\``;
|
||||
|
||||
return (
|
||||
<StyledMarkdownPreview
|
||||
isRenderingInStepContainer
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue