Skip to content

Commit 80adbde

Browse files
Merge remote-tracking branch 'origin/main' into pr-32899
2 parents 48782ca + feb9c6b commit 80adbde

5 files changed

Lines changed: 87 additions & 25 deletions

File tree

‎apps/server/src/provider/ClaudeProvider.ts‎

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,11 @@ import {
4040
type ServerProviderDraft,
4141
} from "@t3tools/provider-core/server/snapshotProbe";
4242
import { resolveClaudeSdkExecutablePath } from "./Drivers/ClaudeExecutable.ts";
43-
import { hasClaudeManagedMcpConfig, makeClaudeEnvironment } from "./Drivers/ClaudeHome.ts";
43+
import {
44+
claudeSignedOutMessage,
45+
hasClaudeManagedMcpConfig,
46+
makeClaudeEnvironment,
47+
} from "./Drivers/ClaudeHome.ts";
4448
import { discoverClaudeSkills, readClaudeSettingsEnv } from "./Drivers/ClaudeSkills.ts";
4549
import type { ProviderWorkspaceSnapshot } from "@t3tools/provider-core/server/driver";
4650
import { makeUnavailableUsageLimits } from "@t3tools/provider-core/server/usageLimits";
@@ -674,6 +678,9 @@ export const checkClaudeProviderStatus = Effect.fn("checkClaudeProviderStatus")(
674678
endpoint.hostname !== "" &&
675679
endpoint.hostname !== "api.anthropic.com";
676680
if (!customApiEndpoint && claudeAuthStatus(capabilities) === "unauthenticated") {
681+
const path = yield* Path.Path;
682+
const configDir = (yield* makeClaudeEnvironment(claudeSettings, resolvedEnvironment))
683+
.CLAUDE_CONFIG_DIR;
677684
return buildServerProvider({
678685
presentation: CLAUDE_PRESENTATION,
679686
enabled: claudeSettings.enabled,
@@ -687,7 +694,10 @@ export const checkClaudeProviderStatus = Effect.fn("checkClaudeProviderStatus")(
687694
version: parsedVersion,
688695
status: "error",
689696
auth: { status: "unauthenticated" },
690-
message: "Claude Code is not authenticated. Run `claude auth login` and try again.",
697+
message:
698+
configDir === undefined
699+
? "Claude Code is not authenticated. Run `claude auth login` and try again."
700+
: claudeSignedOutMessage({ configDir, cwd: path.resolve(cwd ?? ".") }),
691701
},
692702
});
693703
}

‎apps/server/src/provider/ProviderRegistry.test.ts‎

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3192,6 +3192,64 @@ it.layer(
31923192
),
31933193
);
31943194

3195+
it.effect.each([
3196+
{
3197+
name: "its own home path",
3198+
homePath: "/srv/claude-personal",
3199+
environment: { ANTHROPIC_BASE_URL: "" },
3200+
configDir: "/srv/claude-personal",
3201+
},
3202+
{
3203+
name: "an inherited CLAUDE_CONFIG_DIR",
3204+
homePath: "",
3205+
environment: { ANTHROPIC_BASE_URL: "", CLAUDE_CONFIG_DIR: "/srv/claude-work" },
3206+
configDir: "/srv/claude-work",
3207+
},
3208+
{
3209+
name: "the default config dir",
3210+
homePath: "",
3211+
environment: { ANTHROPIC_BASE_URL: "" },
3212+
configDir: undefined,
3213+
},
3214+
])(
3215+
"tells a logged-out instance on $name where to sign in",
3216+
({ homePath, environment, configDir }) =>
3217+
Effect.gen(function* () {
3218+
const status = yield* checkClaudeProviderStatus(
3219+
{ ...defaultClaudeSettings, homePath },
3220+
claudeCapabilities({
3221+
tokenSource: "none",
3222+
apiKeySource: "none",
3223+
apiProvider: "firstParty",
3224+
}),
3225+
environment,
3226+
);
3227+
assert.strictEqual(status.auth.status, "unauthenticated");
3228+
if (configDir === undefined) {
3229+
assert.strictEqual(
3230+
status.message,
3231+
"Claude Code is not authenticated. Run `claude auth login` and try again.",
3232+
);
3233+
} else {
3234+
// A home path is resolved to a native path; an inherited value is kept literal.
3235+
const expected = homePath ? (yield* Path.Path).resolve(configDir) : configDir;
3236+
assert.include(
3237+
status.message ?? "",
3238+
`CLAUDE_CONFIG_DIR set to ${JSON.stringify(expected)}`,
3239+
"a bare `claude auth login` signs in ~/.claude, not this instance's config dir",
3240+
);
3241+
}
3242+
}).pipe(
3243+
Effect.provide(
3244+
layerMockSpawner((args) => {
3245+
const joined = args.join(" ");
3246+
if (joined === "--version") return { stdout: "1.0.0\n", stderr: "", code: 0 };
3247+
throw new Error(`Unexpected args: ${joined}`);
3248+
}),
3249+
),
3250+
),
3251+
);
3252+
31953253
it.effect("tells a logged-out CLI which models need a Claude Code update", () =>
31963254
Effect.gen(function* () {
31973255
const status = yield* checkClaudeProviderStatus(

‎apps/web/src/components/ThreadTerminalDrawer.tsx‎

Lines changed: 15 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1790,6 +1790,17 @@ export default function ThreadTerminalDrawer({
17901790
};
17911791
}, [isPanel, visible]);
17921792

1793+
const resizeHandle = isPanel ? null : (
1794+
<div
1795+
className="absolute inset-x-0 top-0 z-20 h-1.5 cursor-row-resize touch-none any-pointer-coarse:h-4"
1796+
onPointerDown={handleResizePointerDown}
1797+
onPointerMove={handleResizePointerMove}
1798+
onPointerUp={handleResizePointerEnd}
1799+
onPointerCancel={handleResizePointerEnd}
1800+
onLostPointerCapture={handleResizePointerEnd}
1801+
/>
1802+
);
1803+
17931804
if (normalizedTerminalIds.length === 0) {
17941805
return (
17951806
<aside
@@ -1803,16 +1814,7 @@ export default function ThreadTerminalDrawer({
18031814
)}
18041815
style={isPanel ? undefined : { height: `var(${DRAG_HEIGHT_PROPERTY}, ${drawerHeight}px)` }}
18051816
>
1806-
{!isPanel ? (
1807-
<div
1808-
className="absolute inset-x-0 top-0 z-20 h-1.5 cursor-row-resize"
1809-
onPointerDown={handleResizePointerDown}
1810-
onPointerMove={handleResizePointerMove}
1811-
onPointerUp={handleResizePointerEnd}
1812-
onPointerCancel={handleResizePointerEnd}
1813-
onLostPointerCapture={handleResizePointerEnd}
1814-
/>
1815-
) : null}
1817+
{resizeHandle}
18161818
<div className="flex min-h-0 flex-1 flex-col items-center justify-center gap-3 px-4 py-6 text-center text-sm text-muted-foreground">
18171819
<p>No terminal sessions for this thread yet.</p>
18181820
<Button
@@ -1840,16 +1842,7 @@ export default function ThreadTerminalDrawer({
18401842
)}
18411843
style={isPanel ? undefined : { height: `var(${DRAG_HEIGHT_PROPERTY}, ${drawerHeight}px)` }}
18421844
>
1843-
{!isPanel ? (
1844-
<div
1845-
className="absolute inset-x-0 top-0 z-20 h-1.5 cursor-row-resize"
1846-
onPointerDown={handleResizePointerDown}
1847-
onPointerMove={handleResizePointerMove}
1848-
onPointerUp={handleResizePointerEnd}
1849-
onPointerCancel={handleResizePointerEnd}
1850-
onLostPointerCapture={handleResizePointerEnd}
1851-
/>
1852-
) : null}
1845+
{resizeHandle}
18531846

18541847
{!hasTerminalSidebar && (
18551848
<div className="pointer-events-none absolute right-2 top-2 z-20">
@@ -1929,7 +1922,8 @@ export default function ThreadTerminalDrawer({
19291922
{hasTerminalSidebar && (
19301923
<aside className="flex w-36 min-w-36 flex-col border border-border/70 bg-muted/10">
19311924
<div className="flex h-[22px] items-stretch justify-end border-b border-border/70">
1932-
<div className="inline-flex h-full items-stretch">
1925+
{/* Sits above the taller touch resize handle so its buttons keep their taps. */}
1926+
<div className="inline-flex h-full items-stretch any-pointer-coarse:relative any-pointer-coarse:z-30">
19331927
<TerminalActionButton
19341928
disabled={!canOperateTerminal}
19351929
className={`inline-flex h-full items-center px-1 text-foreground/90 transition-colors ${

‎apps/web/src/components/preview/RightPanelResizeHandle.tsx‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ export function RightPanelResizeHandle({ handlers, className, label, ...separato
1919
aria-orientation="vertical"
2020
{...separatorProps}
2121
className={cn(
22-
"group absolute inset-y-0 -left-1 z-20 w-2 cursor-col-resize select-none",
22+
"group absolute inset-y-0 -left-1 z-20 w-2 cursor-col-resize touch-none select-none any-pointer-coarse:-left-2 any-pointer-coarse:w-4",
2323
className,
2424
)}
2525
{...handlers}

‎apps/web/src/components/ui/sidebar.tsx‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -555,7 +555,7 @@ function SidebarRail({
555555
/* A collapsed offcanvas rail overlaps the native scrollbar on Windows and Linux. */
556556
"-translate-x-1/2 group-data-[side=left]:-right-4 absolute inset-y-0 z-20 hidden w-4 after:absolute after:inset-y-0 after:left-1/2 after:w-[2px] hover:after:bg-sidebar-border group-data-[side=right]:left-0 sm:flex [[data-collapsible=offcanvas][data-state=collapsed]_&]:pointer-events-none",
557557
"[[data-panel-animations=true]_&]:transition-all [[data-panel-animations=true]_&]:[transition-duration:var(--panel-animation-duration)] [[data-panel-animations=true]_&]:ease-out",
558-
"in-data-[side=left]:cursor-w-resize in-data-[side=right]:cursor-e-resize",
558+
"touch-none in-data-[side=left]:cursor-w-resize in-data-[side=right]:cursor-e-resize",
559559
"[[data-side=left][data-state=collapsed]_&]:cursor-e-resize [[data-side=right][data-state=collapsed]_&]:cursor-w-resize",
560560
"group-data-[collapsible=offcanvas]:translate-x-0 hover:group-data-[collapsible=offcanvas]:bg-sidebar group-data-[collapsible=offcanvas]:after:left-full",
561561
"[[data-side=left][data-collapsible=offcanvas]_&]:-right-2",

0 commit comments

Comments
 (0)