diff --git a/packages/app/src/pages/new-session/new-session-view.test.ts b/packages/app/src/pages/new-session/new-session-view.test.ts new file mode 100644 index 000000000..0b39f0953 --- /dev/null +++ b/packages/app/src/pages/new-session/new-session-view.test.ts @@ -0,0 +1,26 @@ +import { describe, expect, test } from "bun:test" +import { readFileSync } from "node:fs" +import { join } from "node:path" + +// amicode#326 — the breadcrumb bar (project selector + workspace selector + +// git status) below the new-session composer must be hidden when running inside +// the Amicode webview. Sessions already scope to all workspace folders via the +// multi-directory engine (opencode#215), so the bar is redundant chrome. +// +// Source assertion: the view must gate the breadcrumb section on !inAmicode(). +// No component-render harness exists (no @solidjs/testing-library), so we +// verify structurally — the same pattern as prompt-input-clipboard-structure.test.ts. +const source = readFileSync(join(import.meta.dir, "new-session-view.tsx"), "utf8") + +describe("breadcrumb bar hidden in Amicode (amicode#326)", () => { + test("imports inAmicode", () => { + expect(source).toContain("inAmicode") + }) + + test("the project-selected breadcrumb block is gated on !inAmicode()", () => { + // The breadcrumb row renders inside a + // that must also check !inAmicode(). We verify both conditions appear + // together in the guard. + expect(source).toMatch(/!inAmicode\(\).*project\.selected\(\)/) + }) +}) diff --git a/packages/app/src/pages/new-session/new-session-view.tsx b/packages/app/src/pages/new-session/new-session-view.tsx index be765b679..3648f65be 100644 --- a/packages/app/src/pages/new-session/new-session-view.tsx +++ b/packages/app/src/pages/new-session/new-session-view.tsx @@ -15,6 +15,7 @@ import { PromptProjectSelector, type PromptProjectController, } from "@/components/prompt-project-selector" +import { inAmicode } from "@/pages/session/use-amicode-commands" import { StatusPopoverV2 } from "@/components/status-popover" import { useLanguage } from "@/context/language" import { useSDK } from "@/context/sdk" @@ -66,7 +67,11 @@ export function NewSessionView(props: { - + {/* amicode#326: hide the breadcrumb bar (project selector + + workspace selector + git status) inside the Amicode webview — + sessions already scope to all workspace folders via the + multi-directory engine (opencode#215). */} +