Skip to content
Open
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
25 changes: 18 additions & 7 deletions apps/server/src/provider/Layers/ClaudeAdapter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1629,21 +1629,32 @@ const makeClaudeAdapter = Effect.fn("makeClaudeAdapter")(function* (
});
return;
}

const rawBlock = block as {
readonly type?: string;
readonly name?: unknown;
readonly input?: unknown;
readonly id?: unknown;
};
if (
block.type !== "tool_use" &&
block.type !== "server_tool_use" &&
block.type !== "mcp_tool_use"
rawBlock.type !== "tool_use" &&
rawBlock.type !== "server_tool_use" &&
rawBlock.type !== "mcp_tool_use"
) {
return;
}

const toolName = block.name;
if (typeof rawBlock.name !== "string" || typeof rawBlock.id !== "string") {
return;
}

const toolName = rawBlock.name;
const itemType = classifyToolItemType(toolName);
const toolInput =
typeof block.input === "object" && block.input !== null
? (block.input as Record<string, unknown>)
typeof rawBlock.input === "object" && rawBlock.input !== null
? (rawBlock.input as Record<string, unknown>)
: {};
const itemId = block.id;
const itemId = rawBlock.id;
const detail = summarizeToolRequest(toolName, toolInput);
const inputFingerprint =
Object.keys(toolInput).length > 0 ? toolInputFingerprint(toolInput) : undefined;
Expand Down
39 changes: 39 additions & 0 deletions apps/web/src/components/ChatView.browser.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3474,6 +3474,45 @@ describe("ChatView timeline estimator parity (full app)", () => {
await mounted.cleanup();
}
});

it("shows the project new-thread action on mobile without hover", async () => {
const mounted = await mountChatView({
viewport: COMPACT_FOOTER_VIEWPORT,
snapshot: createSnapshotForTargetUser({
targetMessageId: "msg-user-mobile-new-thread-test" as MessageId,
targetText: "mobile new thread target",
}),
});

try {
await page.getByRole("button", { name: "Toggle Sidebar" }).click();
await waitForLayout();

const newThreadButton = await waitForElement(
() => document.querySelector<HTMLButtonElement>('[data-testid="new-thread-button"]'),
"Unable to find new thread button.",
);
const newThreadAction = newThreadButton.parentElement;

expect(
newThreadAction,
"New-thread button should render inside a visibility wrapper.",
).not.toBeNull();
expect(getComputedStyle(newThreadAction!).opacity).toBe("1");
expect(getComputedStyle(newThreadAction!).pointerEvents).toBe("auto");

await newThreadButton.click();

await waitForURL(
mounted.router,
(path) => UUID_ROUTE_RE.test(path),
"Mobile new-thread action should create a draft thread without hover.",
);
} finally {
await mounted.cleanup();
}
});

it("creates a fresh draft after the previous draft thread is promoted", async () => {
const mounted = await mountChatView({
viewport: DEFAULT_VIEWPORT,
Expand Down
6 changes: 3 additions & 3 deletions apps/web/src/components/Sidebar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -1682,7 +1682,7 @@ const SidebarProjectItem = memo(function SidebarProjectItem(props: SidebarProjec
<SidebarMenuButton
ref={isManualProjectSorting ? dragHandleProps?.setActivatorNodeRef : undefined}
size="sm"
className={`gap-2 px-2 py-1.5 text-left hover:bg-accent group-hover/project-header:bg-accent group-hover/project-header:text-sidebar-accent-foreground ${
className={`gap-2 pl-2 pr-8 py-1.5 text-left hover:bg-accent group-hover/project-header:bg-accent group-hover/project-header:text-sidebar-accent-foreground ${
isManualProjectSorting ? "cursor-grab active:cursor-grabbing" : "cursor-pointer"
}`}
{...(isManualProjectSorting && dragHandleProps ? dragHandleProps.attributes : {})}
Expand Down Expand Up @@ -1732,7 +1732,7 @@ const SidebarProjectItem = memo(function SidebarProjectItem(props: SidebarProjec
? "Remote project"
: "Available in multiple environments"
}
className="pointer-events-none absolute top-1 right-1.5 inline-flex size-5 items-center justify-center rounded-md text-muted-foreground/50 transition-opacity duration-150 group-hover/project-header:opacity-0 group-focus-within/project-header:opacity-0"
className="pointer-events-none absolute top-1 right-1.5 hidden size-5 items-center justify-center rounded-md text-muted-foreground/50 transition-opacity duration-150 md:inline-flex md:group-hover/project-header:opacity-0 md:group-focus-within/project-header:opacity-0"
/>
}
>
Expand All @@ -1746,7 +1746,7 @@ const SidebarProjectItem = memo(function SidebarProjectItem(props: SidebarProjec
<Tooltip>
<TooltipTrigger
render={
<div className="pointer-events-none absolute top-1 right-1.5 opacity-0 transition-opacity duration-150 group-hover/project-header:pointer-events-auto group-hover/project-header:opacity-100 group-focus-within/project-header:pointer-events-auto group-focus-within/project-header:opacity-100">
<div className="pointer-events-auto absolute top-1 right-1.5 opacity-100 transition-opacity duration-150 md:pointer-events-none md:opacity-0 md:group-hover/project-header:pointer-events-auto md:group-hover/project-header:opacity-100 md:group-focus-within/project-header:pointer-events-auto md:group-focus-within/project-header:opacity-100">
<button
type="button"
aria-label={`Create new thread in ${project.name}`}
Expand Down
Loading