Skip to content

Commit 61fa2b0

Browse files
Resolve merge conflict in ToolCallDisplay.tsx
Merged changes from main while preserving clickable functionality: - Added ToolTruncateHistoryIcon import from main - Updated flex alignment to items-start from main - Kept clickable div with hover effects and click handler 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <[email protected]>
2 parents c362e12 + 4dfe1ff commit 61fa2b0

File tree

20 files changed

+181
-39
lines changed

20 files changed

+181
-39
lines changed

core/config/markdown/utils.ts

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,18 +4,24 @@ import {
44
} from "@continuedev/config-yaml";
55
import { joinPathsToUri } from "../../util/uri";
66

7+
function createRelativeRuleFilePathParts(ruleName: string): string[] {
8+
const safeRuleName = sanitizeRuleName(ruleName);
9+
return [".continue", "rules", `${safeRuleName}.${RULE_FILE_EXTENSION}`];
10+
}
11+
12+
export function createRelativeRuleFilePath(ruleName: string): string {
13+
return createRelativeRuleFilePathParts(ruleName).join("/");
14+
}
15+
716
/**
817
* Creates the file path for a rule in the workspace .continue/rules directory
918
*/
1019
export function createRuleFilePath(
1120
workspaceDir: string,
1221
ruleName: string,
1322
): string {
14-
const safeRuleName = sanitizeRuleName(ruleName);
1523
return joinPathsToUri(
1624
workspaceDir,
17-
".continue",
18-
"rules",
19-
`${safeRuleName}.${RULE_FILE_EXTENSION}`,
25+
...createRelativeRuleFilePathParts(ruleName),
2026
);
2127
}

core/llm/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -213,7 +213,7 @@ export abstract class BaseLLM implements ILLM {
213213
this.providerName === "continue-proxy"
214214
? this.model?.split("/").pop() || this.model
215215
: this.model;
216-
const llmInfo = findLlmInfo(modelSearchString);
216+
const llmInfo = findLlmInfo(modelSearchString, this.underlyingProviderName);
217217

218218
const templateType =
219219
options.template ?? autodetectTemplateType(options.model);

core/package-lock.json

Lines changed: 7 additions & 7 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

extensions/cli/src/commands/init.ts

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
11
import { type AssistantConfig } from "@continuedev/sdk";
2+
import { createRelativeRuleFilePath } from "core/config/markdown/utils.js";
23

34
import { SlashCommandResult } from "../ui/hooks/useChat.types.js";
45

56
function createInitPrompt(): string {
6-
return `Please analyze this repository and create a comprehensive AGENTS.md file. Use your available tools to understand the project structure, read important files like README.md, package.json, requirements.txt, and other configuration files to understand the technology stack and setup.
7+
const relativeRuleFilepath = createRelativeRuleFilePath("review");
8+
return `Please analyze this repository and create a comprehensive AGENTS.md file, along with a custom slash command. Use your available tools to understand the project structure, read important files like README.md, package.json, requirements.txt, and other configuration files to understand the technology stack and setup.
79
810
Create an AGENTS.md file with the following structure:
911
@@ -30,7 +32,23 @@ Create an AGENTS.md file with the following structure:
3032
- Development environment setup
3133
- Lint and format commands
3234
33-
Please create the AGENTS.md file using the Write tool after analyzing the repository. Focus on providing actionable information that would help both AI agents and human developers understand and work effectively with this codebase. Keep the file concise but informational.`;
35+
Additionally, create a slash command file at ${relativeRuleFilepath} with the following structure:
36+
37+
\`\`\`md
38+
---
39+
invokable: true
40+
---
41+
42+
Review this code for potential issues, including:
43+
44+
<insert custom things to look for based on the repository details you find>
45+
46+
Provide specific, actionable feedback for improvements.
47+
\`\`\`
48+
49+
This slash command will be invokable using /review and will provide instructions for code review tasks common to this repository.
50+
51+
Please create both the AGENTS.md file and the .continue/rules/review.md file using the Write tool after analyzing the repository. Focus on providing actionable information that would help both AI agents and human developers understand and work effectively with this codebase. Keep the files concise but informational.`;
3452
}
3553

3654
export async function handleInit(
Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
import { render } from "ink-testing-library";
2+
import React from "react";
3+
4+
import { ChecklistDisplay } from "./ChecklistDisplay.js";
5+
6+
describe("ChecklistDisplay", () => {
7+
it("should highlight the first incomplete item", () => {
8+
const content = `Task list status:
9+
- [x] Completed task
10+
- [ ] First incomplete task
11+
- [ ] Second incomplete task`;
12+
13+
const { lastFrame } = render(<ChecklistDisplay content={content} />);
14+
const output = lastFrame();
15+
16+
// The output should contain the checkbox symbols and text
17+
expect(output).toContain("✓");
18+
expect(output).toContain("○");
19+
expect(output).toContain("Completed task");
20+
expect(output).toContain("First incomplete task");
21+
expect(output).toContain("Second incomplete task");
22+
});
23+
24+
it("should handle empty checklist", () => {
25+
const content = "Task list status:";
26+
27+
const { lastFrame } = render(<ChecklistDisplay content={content} />);
28+
const output = lastFrame();
29+
30+
expect(output).toBeDefined();
31+
});
32+
33+
it("should handle all completed tasks", () => {
34+
const content = `Task list status:
35+
- [x] Completed task 1
36+
- [x] Completed task 2`;
37+
38+
const { lastFrame } = render(<ChecklistDisplay content={content} />);
39+
const output = lastFrame();
40+
41+
expect(output).toContain("✓");
42+
expect(output).toContain("Completed task 1");
43+
expect(output).toContain("Completed task 2");
44+
});
45+
46+
it("should handle mixed content with headers", () => {
47+
const content = `Task list status:
48+
## Important Tasks
49+
- [x] Done task
50+
- [ ] Todo task
51+
52+
## Other Tasks
53+
- [ ] Another todo`;
54+
55+
const { lastFrame } = render(<ChecklistDisplay content={content} />);
56+
const output = lastFrame();
57+
58+
expect(output).toContain("Important Tasks");
59+
expect(output).toContain("Other Tasks");
60+
expect(output).toContain("✓");
61+
expect(output).toContain("○");
62+
});
63+
});

extensions/cli/src/ui/components/ChecklistDisplay.tsx

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,17 @@ export const ChecklistDisplay: React.FC<ChecklistDisplayProps> = ({
1313
}) => {
1414
const lines = content.split("\n");
1515

16+
// Find the index of the first incomplete checkbox item
17+
let firstIncompleteIndex = -1;
18+
for (let i = 0; i < lines.length; i++) {
19+
const line = lines[i];
20+
const checkboxMatch = line.match(/^(\s*)-\s*\[([ x])\]\s*(.*)$/);
21+
if (checkboxMatch && checkboxMatch[2] === " ") {
22+
firstIncompleteIndex = i;
23+
break;
24+
}
25+
}
26+
1627
return (
1728
<Box flexDirection="column" paddingLeft={2}>
1829
{lines.map((line, index) => {
@@ -25,6 +36,7 @@ export const ChecklistDisplay: React.FC<ChecklistDisplayProps> = ({
2536
if (checkboxMatch) {
2637
const [, indent, status, taskText] = checkboxMatch;
2738
const isCompleted = status === "x";
39+
const isFirstIncomplete = index === firstIncompleteIndex;
2840

2941
return (
3042
<Box key={index}>
@@ -34,8 +46,11 @@ export const ChecklistDisplay: React.FC<ChecklistDisplayProps> = ({
3446
</Text>
3547
<Text> </Text>
3648
<Text
37-
color={isCompleted ? "gray" : "white"}
49+
color={
50+
isCompleted ? "gray" : isFirstIncomplete ? "cyan" : "white"
51+
}
3852
strikethrough={isCompleted}
53+
bold={isFirstIncomplete}
3954
>
4055
{taskText}
4156
</Text>

gui/src/components/AssistantAndOrgListbox/SelectedAssistantButton.tsx

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -48,9 +48,7 @@ export function SelectedAssistantButton({
4848
) : (
4949
<>
5050
<AssistantIcon assistant={selectedProfile} size={iconSize} />
51-
<span
52-
className={`select-none truncate text-xs ${isSidebar && "hidden md:block"}`}
53-
>
51+
<span className={`xs:line-clamp-1 hidden select-none text-xs`}>
5452
{selectedProfile.title}
5553
</span>
5654
</>

gui/src/components/AssistantAndOrgListbox/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,7 @@ export function AssistantAndOrgListbox({
150150
/>
151151
<Transition>
152152
<ListboxOptions
153-
className="max-h-32 -translate-x-1.5 overflow-y-auto pb-0"
153+
className="max-h-32 scale-x-[97%] overflow-y-auto pb-0"
154154
style={{ zIndex: 200 }}
155155
>
156156
<div className="flex items-center justify-between px-1.5 py-1">

gui/src/components/StyledMarkdownPreview/MermaidBlock.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ export default function MermaidDiagram({ code }: { code: string }) {
141141
{!!error ? (
142142
<div className="text-error whitespace-pre text-sm">{error}</div>
143143
) : (
144-
<div className="relative">
144+
<div className="mermaid relative">
145145
<div className="absolute right-0 z-10 m-2 flex items-center gap-x-1">
146146
<ToolTip content={"Zoom In"}>
147147
<MagnifyingGlassPlusIcon

gui/src/components/StyledMarkdownPreview/index.tsx

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,26 @@ const StyledMarkdown = styled.div<{
8484
font-family: var(--vscode-editor-font-family);
8585
}
8686
87+
ul ul,
88+
ul ol,
89+
ol ul,
90+
ol ol {
91+
padding-left: 1.5em;
92+
margin-top: 1em;
93+
}
94+
95+
li {
96+
margin-bottom: 0.8em;
97+
}
98+
li:last-child {
99+
margin-bottom: 0;
100+
}
101+
102+
ul,
103+
ol {
104+
padding-left: 2em;
105+
}
106+
87107
code:not(pre > code) {
88108
font-family: var(--vscode-editor-font-family);
89109
}

0 commit comments

Comments
 (0)