Skip to content
Open
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
13 changes: 13 additions & 0 deletions apps/web/src/components/Sidebar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@ import {
SidebarMenuSubItem,
SidebarSeparator,
SidebarTrigger,
useSidebar,
} from "./ui/sidebar";
import { useThreadSelectionStore } from "../threadSelectionStore";
import { formatWorktreePathForDisplay, getOrphanedWorktreePathForThread } from "../worktreeCleanup";
Expand Down Expand Up @@ -274,6 +275,7 @@ export default function Sidebar() {
const isOnSettings = useLocation({ select: (loc) => loc.pathname === "/settings" });
const { settings: appSettings } = useAppSettings();
const { handleNewThread } = useHandleNewThread();
const { isMobile, setOpenMobile } = useSidebar();
const routeThreadId = useParams({
strict: false,
select: (params) => (params.threadId ? ThreadId.makeUnsafe(params.threadId) : null),
Expand Down Expand Up @@ -844,16 +846,21 @@ export default function Sidebar() {
clearSelection();
}
setSelectionAnchor(threadId);
if (isMobile) {
setOpenMobile(false);
}
Comment on lines +849 to +851
Copy link

Copilot AI Mar 22, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The nearby comment describing the plain-click behavior doesn’t mention that we now also close the mobile sidebar. Please update the comment so it remains accurate.

Copilot uses AI. Check for mistakes.
void navigate({
to: "/$threadId",
params: { threadId },
});
},
[
clearSelection,
isMobile,
navigate,
rangeSelectTo,
selectedThreadIds.size,
setOpenMobile,
setSelectionAnchor,
toggleThreadSelection,
],
Expand Down Expand Up @@ -1424,6 +1431,9 @@ export default function Sidebar() {
onClick={(event) => {
event.preventDefault();
event.stopPropagation();
if (isMobile) {
setOpenMobile(false);
}
void handleNewThread(project.id, {
envMode: resolveSidebarNewThreadEnvMode({
defaultEnvMode: appSettings.defaultThreadEnvMode,
Expand Down Expand Up @@ -1492,6 +1502,9 @@ export default function Sidebar() {
clearSelection();
}
setSelectionAnchor(thread.id);
if (isMobile) {
setOpenMobile(false);
}
Comment on lines 1503 to +1507
Copy link

Copilot AI Mar 22, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This Enter/Space handler duplicates the same “activate thread” steps as the click path (clear selection, set anchor, close mobile sidebar, navigate). Consider extracting a shared helper and calling it from both handlers to prevent the two paths drifting over time.

Copilot uses AI. Check for mistakes.
void navigate({
to: "/$threadId",
params: { threadId: thread.id },
Expand Down
Loading