fix(coding-agent): show compact read line ranges
This commit is contained in:
@@ -384,4 +384,25 @@ describe("ToolExecutionComponent parity", () => {
|
||||
expect(expanded).toContain(scenario.hidden);
|
||||
});
|
||||
}
|
||||
|
||||
for (const scenario of [
|
||||
{ title: "SKILL.md", path: join(process.cwd(), "attio", "SKILL.md"), compact: "[skill] attio:120-329" },
|
||||
{ title: "Pi documentation", path: getReadmePath(), compact: "read docs README.md:120-329" },
|
||||
] as const) {
|
||||
test(`shows the read line range in compact ${scenario.title} reads before the expand hint`, () => {
|
||||
const component = new ToolExecutionComponent(
|
||||
"read",
|
||||
`tool-compact-range-${scenario.title}`,
|
||||
{ path: scenario.path, offset: 120, limit: 210 },
|
||||
{},
|
||||
createReadToolDefinition(process.cwd()),
|
||||
createFakeTui(),
|
||||
process.cwd(),
|
||||
);
|
||||
|
||||
const collapsed = stripAnsi(component.render(120).join("\n"));
|
||||
expect(collapsed).toContain(scenario.compact);
|
||||
expect(collapsed.indexOf(":120-329")).toBeLessThan(collapsed.indexOf("to expand"));
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user