Skip to content

Commit 7c78ead

Browse files
Merge remote-tracking branch 'origin/main' into fix/issue-26368
2 parents b3dd8c8 + be2ea30 commit 7c78ead

5 files changed

Lines changed: 37 additions & 25 deletions

File tree

‎apps/web/src/components/chat/PanelLayoutControls.tsx‎

Lines changed: 11 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { PanelBottomIcon, PanelRightIcon, SquareMenuIcon } from "lucide-react";
22
import { Maximize2, Minimize2 } from "lucide";
33
import { MorphIcon } from "~/components/MorphIcon";
4-
import { memo, type ReactElement, type ReactNode } from "react";
4+
import { memo, type ReactNode } from "react";
55

66
import { cn } from "~/lib/utils";
77

@@ -53,19 +53,23 @@ export const PanelLayoutControls = memo(function PanelLayoutControls({
5353
<Toggle
5454
className="relative shrink-0 [-webkit-app-region:no-drag]"
5555
pressed={threadPanelOpen}
56+
onPressedChange={threadPanelPresentation === "popover" ? undefined : onToggleThreadPanel}
5657
aria-label="Toggle thread details panel"
5758
variant="ghost"
5859
size="sm"
5960
>
6061
<SquareMenuIcon className="size-4" />
6162
</Toggle>
6263
);
63-
const threadPanelTooltip = (trigger: ReactElement) => (
64+
const threadPanelControl = (
6465
<Tooltip>
65-
<TooltipTrigger
66-
render={trigger}
67-
{...(threadPanelPresentation === "popover" ? {} : { onClick: onToggleThreadPanel })}
68-
/>
66+
<TooltipTrigger render={<span className="flex shrink-0" />}>
67+
{threadPanelPresentation === "popover" ? (
68+
<PopoverTrigger handle={threadPanelPopoverHandle} render={threadPanelToggle} />
69+
) : (
70+
threadPanelToggle
71+
)}
72+
</TooltipTrigger>
6973
<TooltipPopup side="bottom">
7074
Toggle thread details
7175
{threadPanelShortcutLabel ? ` (${threadPanelShortcutLabel})` : ""}
@@ -78,13 +82,7 @@ export const PanelLayoutControls = memo(function PanelLayoutControls({
7882
className="flex h-full shrink-0 items-center gap-1 [-webkit-app-region:no-drag]"
7983
data-panel-layout-controls
8084
>
81-
{showThreadPanelControl
82-
? threadPanelPresentation === "popover"
83-
? threadPanelTooltip(
84-
<PopoverTrigger handle={threadPanelPopoverHandle} render={threadPanelToggle} />,
85-
)
86-
: threadPanelTooltip(threadPanelToggle)
87-
: null}
85+
{showThreadPanelControl ? threadPanelControl : null}
8886
{showTerminalControl ? (
8987
<Tooltip>
9088
<TooltipTrigger render={<span className="flex shrink-0" />}>

‎apps/web/src/components/settings/SourceControlSettings.tsx‎

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -74,13 +74,13 @@ function isVcsNotReady(item: VcsDiscoveryItem | SourceControlProviderDiscoveryIt
7474

7575
function authPresentation(auth: SourceControlProviderAuth): {
7676
readonly label: string;
77-
readonly badge: "warning" | null;
77+
readonly badge: "secondary" | null;
7878
} {
7979
if (auth.status === "authenticated") {
8080
return { label: "Authenticated", badge: null };
8181
}
8282
if (auth.status === "unauthenticated") {
83-
return { label: "Not authenticated", badge: "warning" };
83+
return { label: "Not authenticated", badge: "secondary" };
8484
}
8585
return { label: "Status unknown", badge: null };
8686
}
@@ -98,8 +98,12 @@ function RedactedAccount(props: { readonly account: string | null }) {
9898

9999
function itemStatusDot(item: VcsDiscoveryItem | SourceControlProviderDiscoveryItem): string {
100100
if (isVcsNotReady(item)) return "bg-muted-foreground/35";
101+
if (isProviderDiscoveryItem(item)) {
102+
return item.status === "available" && item.auth.status === "authenticated"
103+
? "bg-success"
104+
: "bg-muted-foreground/35";
105+
}
101106
if (item.status !== "available") return "bg-warning";
102-
if (isProviderDiscoveryItem(item) && item.auth.status !== "authenticated") return "bg-warning";
103107
return "bg-success";
104108
}
105109

‎packages/client-runtime/src/state/threadShell.test.ts‎

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ describe("v2 thread shell lists", () => {
108108
registry.dispose();
109109
});
110110

111-
it("counts a subagent question on its parent only while the subagent runs", () => {
111+
it("keeps a live subagent question inside the parent without flagging its thread", () => {
112112
const { registry, threads, snapshotAtom } = makeHarness();
113113
const root = v2ThreadShell;
114114
const child = {
@@ -132,6 +132,10 @@ describe("v2 thread shell lists", () => {
132132
const dispose = registry.mount(inputs);
133133
registry.set(snapshotAtom(environmentId), { ...v2ShellSnapshot, threads: [root, child] });
134134
expect(registry.get(inputs).map((thread) => thread.id)).toEqual([child.id]);
135+
expect(
136+
registry.get(threads.threadShellAtom({ environmentId, threadId: root.id }))
137+
?.pendingSubagentRequest,
138+
).toBeNull();
135139
registry.set(snapshotAtom(environmentId), {
136140
...v2ShellSnapshot,
137141
threads: [root, { ...child, status: "queued" as const }],
@@ -272,6 +276,16 @@ describe("v2 thread shell lists", () => {
272276
`${remoteEnvironmentId}/${helper.id}`,
273277
]);
274278

279+
registry.set(snapshotAtom(remoteEnvironmentId), {
280+
...v2ShellSnapshot,
281+
threads: [
282+
task,
283+
{ ...helper, pendingRuntimeRequest: { ...approval, kind: "user_input" as const } },
284+
],
285+
});
286+
expect(registry.get(threads.threadShellAtom(parentRef))?.pendingSubagentRequest).toBeNull();
287+
expect(registry.get(inputs).map((thread) => thread.id)).toEqual([helper.id]);
288+
275289
// A task whose parent is gone there is listed on its own, as is one whose
276290
// parent's environment is switched off.
277291
registry.set(snapshotAtom(environmentId), { ...v2ShellSnapshot, threads: [] });

‎packages/client-runtime/src/state/threadShell.ts‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ function subagentRequest(thread: OrchestrationV2ThreadShell): PendingSubagentReq
7676
}
7777

7878
/**
79-
* The threads to flag for a subagent's live question or approval, up its
79+
* The threads to flag for a subagent's live approval, up its
8080
* subagent chain. `delegated` are tasks this environment's threads delegated
8181
* to linked environments, with what each one, or its own subagents, asks.
8282
*/
@@ -94,6 +94,8 @@ function pendingSubagentRequestsByThread(
9494
request: PendingSubagentRequest,
9595
seen: Set<ThreadId>,
9696
) => {
97+
// The coordinator answers child questions; only approvals need user attention.
98+
if (request === "user_input") return;
9799
byId ??= new Map(threads.map((thread) => [thread.id, thread] as const));
98100
let parentId = firstParentId;
99101
while (parentId !== null && !seen.has(parentId)) {

‎scripts/lib/public-config.ts‎

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
// @effect-diagnostics nodeBuiltinImport:off - Build bootstrap reads optional root env files before an Effect runtime exists.
2-
import { pipe } from "effect/Function";
32
import * as NodeFS from "node:fs";
43
import * as NodePath from "node:path";
54
import * as NodeURL from "node:url";
@@ -20,12 +19,7 @@ export interface T3CodePublicConfig {
2019

2120
type Environment = Readonly<Record<string, string | undefined>>;
2221

23-
const REPO_ROOT = pipe(
24-
NodeURL.fileURLToPath(import.meta.url),
25-
NodePath.dirname,
26-
NodePath.dirname,
27-
NodePath.dirname,
28-
);
22+
const REPO_ROOT = NodePath.resolve(NodeURL.fileURLToPath(import.meta.url), "../../..");
2923

3024
export function loadRepoEnv({
3125
baseEnv = process.env,

0 commit comments

Comments
 (0)