Skip to content
Source
Sign inSign up
pingdotgg/t3code

fix(web): opening a project from the command palette no longer lands in a subagent or side chat #29891

Mergedsaphid(GitHub profile, opens in a new tab)merged 1 commit intomain fromrefs/pull/29891/headmerged by Yash-Singh1(GitHub profile, opens in a new tab) View on GitHub

Showing 2 changed files with 66 additions and 3 deletions.

x
0 of 2 viewed, 2 left
63 additions and 2 deletionsapps/web/src/components/CommandPalette.browser.test.tsxModified
View file
@@ -1,13 +1,28 @@
-import { describe, expect, it } from "vite-plus/test";
+import { EnvironmentId, ProjectId, ThreadId } from "@t3tools/contracts";
+import { describe, expect, it, vi } from "vite-plus/test";
import { page } from "vite-plus/test/browser";
​
import { render } from "../../test/render";
import { openCommandPalette } from "../commandPaletteBus";
import { useCommandPaletteStore } from "../commandPaletteStore";
+import { makeThreadFixture } from "../test-fixtures";
+import type { Project, Thread } from "../types";
import { CommandPalette } from "./CommandPalette";
​
-function setup() {
+const entities = vi.hoisted(() => ({
+ projects: [] as ReadonlyArray<Project>,
+ threads: [] as ReadonlyArray<Thread>,
+}));
+vi.mock("../state/entities", async (original) => ({
+ ...(await original<typeof import("../state/entities")>()),
+ useProjects: () => entities.projects,
+ useVisibleThreadShells: () => entities.threads,
+}));
+​
+function setup(state: { projects?: ReadonlyArray<Project>; threads?: ReadonlyArray<Thread> } = {}) {
useCommandPaletteStore.setState(useCommandPaletteStore.getInitialState(), true);
+ entities.projects = state.projects ?? [];
+ entities.threads = state.threads ?? [];
​
describe("CommandPalette open intents", () => {