Skip to content
Source
Sign inSign up
pingdotgg/t3code

fix(web): file chips open the file an agent meant when the root-joined path is missing #20071

Closedmikeohuo(GitHub profile, opens in a new tab)wants to merge 9 commits intomain fromrefs/pull/20071/headopened View on GitHub

Showing 6 changed files with 22 additions and 11 deletions (loading 5).

x
0 of 6 viewed, 6 left
22 additions and 11 deletionsapps/web/src/components/ChatMarkdown.browser.test.tsxModified
View file
@@ -6,23 +6,37 @@
import { createRoot, type Root } from "react-dom/client";
import { afterEach, beforeEach, describe, expect, it, vi } from "vite-plus/test";
​
-import { filesystemEnvironment } from "../state/filesystem";
+import { projectEnvironment } from "../state/projects";
import { useRightPanelStore } from "../rightPanelStore";
import { getSyntaxHighlighterPromise } from "../lib/syntaxHighlighting";
import { MarkdownFindContext } from "./chat/markdownFindContext";
import { useThreadFindHighlights } from "./chat/threadFindHighlights";
import { setMarkdownTaskChecked } from "./files/filePreviewMode";
​
-const { workspaceSearch, filesystemMetadata } = vi.hoisted(() => ({
+const { workspaceSearch, filesystemMetadata, invalidateMetadata } = vi.hoisted(() => ({
workspaceSearch: vi.fn(),
filesystemMetadata: vi.fn(),
+ invalidateMetadata: vi.fn(),
}));
vi.mock(import("../state/use-atom-query-runner"), async (original) => ({
...(await original()),
useAtomQueryRunner: ((family: unknown) =>
- family === filesystemEnvironment.getMetadata ? filesystemMetadata : workspaceSearch) as never,
+ family === projectEnvironment.fileMetadata ? filesystemMetadata : workspaceSearch) as never,
}));
​
+vi.mock(import("../state/use-atom-command"), async (original) => {
+ const actual = await original();
+ return {
+ ...actual,
+ useAtomCommand: ((command, options) => {