Support exclude paths in manual context management (#774)
This commit is contained in:
@@ -74,3 +74,64 @@ test("manage context - smart context - auto-includes only", async ({ po }) => {
|
||||
|
||||
await po.snapshotServerDump("request");
|
||||
});
|
||||
|
||||
test("manage context - exclude paths", async ({ po }) => {
|
||||
await po.setUp();
|
||||
await po.importApp("context-manage");
|
||||
|
||||
const dialog = await po.openContextFilesPicker();
|
||||
await po.snapshotDialog();
|
||||
|
||||
// Add some include paths first
|
||||
await dialog.addManualContextFile("src/**/*.ts");
|
||||
await dialog.addManualContextFile("manual/**");
|
||||
|
||||
// Add exclude paths
|
||||
await dialog.addExcludeContextFile("src/components/**");
|
||||
await dialog.addExcludeContextFile("manual/exclude/**");
|
||||
await po.snapshotDialog();
|
||||
await dialog.close();
|
||||
|
||||
await po.sendPrompt("[dump]");
|
||||
await po.snapshotServerDump("all-messages", { name: "exclude-paths-basic" });
|
||||
|
||||
// Test that exclude paths take precedence over include paths
|
||||
const dialog2 = await po.openContextFilesPicker();
|
||||
await dialog2.removeExcludeContextFile(); // Remove src/components/**
|
||||
await dialog2.addExcludeContextFile("src/**"); // This should exclude everything from src
|
||||
await po.snapshotDialog();
|
||||
await dialog2.close();
|
||||
|
||||
await po.sendPrompt("[dump]");
|
||||
await po.snapshotServerDump("all-messages", {
|
||||
name: "exclude-paths-precedence",
|
||||
});
|
||||
});
|
||||
|
||||
test("manage context - exclude paths with smart context", async ({ po }) => {
|
||||
await po.setUpDyadPro();
|
||||
await po.selectModel({ provider: "Google", model: "Gemini 2.5 Pro" });
|
||||
await po.importApp("context-manage");
|
||||
|
||||
const dialog = await po.openContextFilesPicker();
|
||||
await po.snapshotDialog();
|
||||
|
||||
// Add manual context files
|
||||
await dialog.addManualContextFile("src/**/*.ts");
|
||||
await dialog.addManualContextFile("manual/**");
|
||||
|
||||
// Add smart context auto-includes
|
||||
await dialog.addAutoIncludeContextFile("a.ts");
|
||||
await dialog.addAutoIncludeContextFile("exclude/**");
|
||||
|
||||
// Add exclude paths that should filter out some of the above
|
||||
await dialog.addExcludeContextFile("src/components/**");
|
||||
await dialog.addExcludeContextFile("exclude/exclude.ts");
|
||||
await po.snapshotDialog();
|
||||
await dialog.close();
|
||||
|
||||
await po.sendPrompt("[dump]");
|
||||
await po.snapshotServerDump("all-messages", {
|
||||
name: "exclude-paths-with-smart-context",
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user