Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 26 additions & 0 deletions packages/app/src/pages/new-session/new-session-view.test.ts
Original file line number Diff line number Diff line change
@@ -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 <Show when={...project.selected()}>
// that must also check !inAmicode(). We verify both conditions appear
// together in the guard.
expect(source).toMatch(/!inAmicode\(\).*project\.selected\(\)/)
})
})
7 changes: 6 additions & 1 deletion packages/app/src/pages/new-session/new-session-view.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -66,7 +67,11 @@ export function NewSessionView(props: {
<Show when={props.project.empty()}>
<PromptProjectAddButton controller={props.project} />
</Show>
<Show when={props.project.selected()}>
{/* 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). */}
<Show when={!inAmicode() && props.project.selected()}>
<div class="flex min-h-7 min-w-0 flex-col items-center justify-center gap-0 text-v2-text-text-faint sm:flex-row">
<PromptProjectSelector controller={props.project} placement="bottom" />
<Show
Expand Down
Loading