Repository navigation
fix(web): No project threads offer no Initialize Git, and their linked PRs show and act in the thread #34788
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
juliusmarminge
merged 9 commits into
pingdotgg:main
from
shivamhwp:fix/no-project-pr-rows
Nov 12, 2026
+606
−64
Merged
Changes from all commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
eb334de
test(web): reproduce #27626 thread details git controls in No project…
juliusmarminge 910b2fd
fix(web): No project threads offer no git, and linked PRs show withou…
juliusmarminge 35f2cdd
test(web): cover a linked pull request in a No project thread
juliusmarminge 935d459
test(web): No project pull request rows fix in the thread, merge with…
shivamhwp e78c885
fix(web): No project pull request rows fix in the thread and merge wi…
shivamhwp 7d7a7d6
fix(web): attached pull request tasks no longer claim a prepared chec…
shivamhwp 8df9eaa
fix(web): attached pull request tasks tell the agent to switch to the…
shivamhwp eaeca94
Merge remote-tracking branch 'origin/main' into fix/no-project-pr-rows
juliusmarminge 68527ef
Merge remote-tracking branch 'origin/main' into fix/no-project-pr-rows
juliusmarminge File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
217 changes: 217 additions & 0 deletions
217
apps/web/src/components/chat/ThreadDetailsPanel.browser.test.tsx
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,217 @@ | ||
| import { | ||
| EnvironmentId, | ||
| ProjectId, | ||
| ThreadId, | ||
| type ScopedThreadRef, | ||
| type ThreadPullRequestLink, | ||
| } from "@t3tools/contracts"; | ||
| import { AsyncResult, Atom } from "effect/reactivity"; | ||
| import { expect, it, vi } from "vite-plus/test"; | ||
| import { page } from "vite-plus/test/browser"; | ||
|
|
||
| const SCRATCH_ROOT = "/home/user/.t3/scratch"; | ||
|
|
||
| const state = vi.hoisted(() => ({ | ||
| workspaceRoot: "", | ||
| folder: "", | ||
| pullRequests: [] as unknown[], | ||
| configLoaded: true, | ||
| })); | ||
|
|
||
| vi.mock(import("~/state/entities"), async (importOriginal) => ({ | ||
| ...(await importOriginal()), | ||
| useProject: ((ref: unknown) => | ||
| ref === null | ||
| ? null | ||
| : { | ||
| id: "project", | ||
| environmentId: "environment", | ||
| title: state.workspaceRoot === SCRATCH_ROOT ? "No project" : "plain", | ||
| workspaceRoot: state.workspaceRoot, | ||
| scripts: [], | ||
| }) as never, | ||
| useProjects: (() => []) as never, | ||
| useQuietThreadShell: ((ref: unknown) => | ||
| ref === null | ||
| ? null | ||
| : { | ||
| id: "thread", | ||
| environmentId: "environment", | ||
| projectId: "project", | ||
| worktreePath: state.folder, | ||
| branch: null, | ||
| pullRequests: state.pullRequests, | ||
| }) as never, | ||
| useServerConfigs: (() => | ||
| new Map( | ||
| state.configLoaded | ||
| ? [ | ||
| [ | ||
| EnvironmentId.make("environment"), | ||
| { | ||
| scratchWorkspaceRoot: SCRATCH_ROOT, | ||
| environment: { capabilities: { pullRequests: true } }, | ||
| }, | ||
| ], | ||
| ] | ||
| : [], | ||
| )) as never, | ||
| })); | ||
| // Neither folder is a repository, which is what the server reports for both. | ||
| vi.mock(import("~/state/vcs"), async (importOriginal) => { | ||
| const actual = await importOriginal(); | ||
| const notARepo = Atom.make( | ||
| AsyncResult.success({ | ||
| isRepo: false, | ||
| hasPrimaryRemote: false, | ||
| isDefaultRef: false, | ||
| refName: null, | ||
| hasWorkingTreeChanges: false, | ||
| workingTree: { files: [], insertions: 0, deletions: 0 }, | ||
| hasUpstream: false, | ||
| aheadCount: 0, | ||
| behindCount: 0, | ||
| aheadOfDefaultCount: 0, | ||
| pr: null, | ||
| }), | ||
| ); | ||
| return { | ||
| ...actual, | ||
| vcsEnvironment: { ...actual.vcsEnvironment, status: (() => notARepo) as never }, | ||
| }; | ||
| }); | ||
|
|
||
| import { render } from "../../../test/render"; | ||
| import { useRightPanelStore } from "../../rightPanelStore"; | ||
| import { PopoverCreateHandle } from "../ui/popover"; | ||
| import { ChatCanvasContext } from "./ChatCanvasContext"; | ||
| import { resolveChatCanvasLayout } from "./chatCanvasLayout"; | ||
| import { ThreadDetailsPanel } from "./ThreadDetailsPanel"; | ||
|
|
||
| const threadRef: ScopedThreadRef = { | ||
| environmentId: EnvironmentId.make("environment"), | ||
| threadId: ThreadId.make("thread"), | ||
| }; | ||
| const container = { width: 1200, height: 800 }; | ||
| const placement = { x: 908, y: 0, right: 12, width: 280, height: 400 } as const; | ||
| const linkedPullRequest: ThreadPullRequestLink = { | ||
| host: "github.com", | ||
| repository: "pingdotgg/t3code", | ||
| number: 27513, | ||
| url: "https://github.com/pingdotgg/t3code/pull/27513", | ||
| source: "manual", | ||
| linkedAt: "2026-10-30T00:00:00.000Z", | ||
| snapshot: null, | ||
| stack: null, | ||
| }; | ||
|
|
||
| function setup(input: { | ||
| workspaceRoot: string; | ||
| folder: string; | ||
| pullRequests?: ThreadPullRequestLink[]; | ||
| configLoaded?: boolean; | ||
| }) { | ||
| state.configLoaded = input.configLoaded ?? true; | ||
| state.workspaceRoot = input.workspaceRoot; | ||
| state.folder = input.folder; | ||
| state.pullRequests = input.pullRequests ?? []; | ||
| useRightPanelStore.setState({ threadPanelVisibilityByThreadKey: {} }); | ||
| const anchor = document.createElement("div"); | ||
| document.body.append(anchor); | ||
| return { | ||
| anchor: { current: anchor }, | ||
| handle: PopoverCreateHandle(), | ||
| [Symbol.dispose]: () => anchor.remove(), | ||
| }; | ||
| } | ||
|
|
||
| function Panel({ fixture }: { fixture: ReturnType<typeof setup> }) { | ||
| const noop = () => {}; | ||
| const scriptResult = async () => ({ ok: true }) as never; | ||
| return ( | ||
| <ChatCanvasContext | ||
| value={{ | ||
| container, | ||
| lane: { padding: 48, minChatWidth: 640 }, | ||
| layout: resolveChatCanvasLayout({ container, preview: null }), | ||
| previewKey: null, | ||
| registerTimeline: noop, | ||
| measureDetailsCard: noop, | ||
| detailsCardTopInset: 0, | ||
| preferredDetailsCard: placement, | ||
| detailsCardPlacement: placement, | ||
| }} | ||
| > | ||
| <ThreadDetailsPanel | ||
| anchor={fixture.anchor} | ||
| handle={fixture.handle} | ||
| environmentId={threadRef.environmentId} | ||
| threadId={threadRef.threadId} | ||
| projectId={ProjectId.make("project")} | ||
| composerDraftTarget={threadRef} | ||
| worktreePath={state.folder} | ||
| isServerThread | ||
| activeProjectName={state.workspaceRoot === SCRATCH_ROOT ? "No project" : "plain"} | ||
| activeProjectScripts={undefined} | ||
| preferredScriptId={null} | ||
| keybindings={[]} | ||
| availableEditors={[]} | ||
| showOpenInPicker={false} | ||
| openInShortcutEnabled={false} | ||
| gitCwd={state.folder} | ||
| workspaceMutationId={null} | ||
| isGitRepo={false} | ||
| envLocked | ||
| availableEnvironments={[]} | ||
| onEnvModeChange={noop} | ||
| envMode="local" | ||
| startFromOrigin={false} | ||
| onStartFromOriginChange={noop} | ||
| onComposerFocusRequest={noop} | ||
| onRunProjectScript={noop} | ||
| onAddProjectScript={scriptResult} | ||
| onUpdateProjectScript={scriptResult} | ||
| onDeleteProjectScript={scriptResult} | ||
| usage={{} as never} | ||
| /> | ||
| </ChatCanvasContext> | ||
| ); | ||
| } | ||
|
|
||
| it("offers no git controls in a No project thread, but shows its linked pull request", async () => { | ||
| using fixture = setup({ | ||
| workspaceRoot: SCRATCH_ROOT, | ||
| folder: `${SCRATCH_ROOT}/thread`, | ||
| pullRequests: [linkedPullRequest], | ||
| }); | ||
| await using _screen = await render(<Panel fixture={fixture} />); | ||
| await expect.element(page.getByText("#27513")).toBeVisible(); | ||
| await expect | ||
| .element(page.getByRole("button", { name: "Initialize Git" })) | ||
| .not.toBeInTheDocument(); | ||
| }); | ||
|
|
||
| it("shows a linked pull request in a folder that is not a git repository", async () => { | ||
| using fixture = setup({ | ||
| workspaceRoot: "/work/plain", | ||
| folder: "/work/plain", | ||
| pullRequests: [linkedPullRequest], | ||
| }); | ||
| await using _screen = await render(<Panel fixture={fixture} />); | ||
| await expect.element(page.getByRole("region", { name: "Workspace" })).toBeVisible(); | ||
| await expect.element(page.getByText("#27513")).toBeVisible(); | ||
| await expect.element(page.getByRole("button", { name: "Initialize Git" })).toBeVisible(); | ||
| }); | ||
|
|
||
| it("offers no Initialize Git before the server config says where No project lives", async () => { | ||
| using fixture = setup({ | ||
| workspaceRoot: SCRATCH_ROOT, | ||
| folder: `${SCRATCH_ROOT}/thread`, | ||
| configLoaded: false, | ||
| }); | ||
| await using _screen = await render(<Panel fixture={fixture} />); | ||
| await expect.element(page.getByRole("region", { name: "Workspace" })).toBeVisible(); | ||
| await expect | ||
| .element(page.getByRole("button", { name: "Initialize Git" })) | ||
| .not.toBeInTheDocument(); | ||
| }); |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do not target an unmounted subagent composer.
When
isProviderSubagentis true,composerMountedis false andChatComposerdoes not render. This prop still gives linked PR rows a composer target. Fix or Resolve then writes a task to that target, reports success, and skips the new-thread handoff. The user cannot send the task from this thread. Omit the composer target for provider-native subagents and retain the new-thread path.