I implemented file referencing feature mentioned in issue #1591 <!-- This is an auto-generated description by cubic. --> --- ## Summary by cubic Adds support for referencing app files in chat using @file:<path>. The input now autocompletes files, and the backend validates and surfaces referenced files in the chat context as read-only. - **New Features** - Chat input autocompletes @ mentions for apps, prompts, and files. - Recognizes @file:<path> and converts it to a structured mention on submit. - Backend parses @file mentions, checks file existence, and adds a “Referenced Files” section to the system message. - New get-app-files IPC handler and useAppFiles hook to load file paths for the selected app (appFilesAtom added). - e2e test for mentioning a file and capturing server dump. <!-- End of auto-generated description by cubic. -->
16 lines
520 B
TypeScript
16 lines
520 B
TypeScript
import { test } from "./helpers/test_helper";
|
|
|
|
test("mention file", async ({ po }) => {
|
|
await po.setUp({ autoApprove: true });
|
|
|
|
await po.importApp("minimal-with-ai-rules");
|
|
await po.goToAppsTab();
|
|
await po.getChatInput().click();
|
|
await po.getChatInput().fill("[dump] @");
|
|
await po.page.getByRole("menuitem", { name: "Choose AI_RULES.md" }).click();
|
|
await po.page.getByRole("button", { name: "Send message" }).click();
|
|
await po.waitForChatCompletion();
|
|
|
|
await po.snapshotServerDump("all-messages");
|
|
});
|