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
19 changes: 13 additions & 6 deletions apps/web/src/components/Sidebar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -360,6 +360,10 @@ interface SidebarThreadPartitionInput {
readonly clockKey: string;
}

function isPlatformModKey(event: { readonly metaKey: boolean; readonly ctrlKey: boolean }) {
return isMacPlatform(navigator.platform) ? event.metaKey : event.ctrlKey;
}

function scrollSidebarToTop(content: HTMLElement | null) {
content?.closest("[data-slot=scroll-area-viewport]")?.scrollTo({ top: 0 });
}
Expand Down Expand Up @@ -1556,10 +1560,8 @@ export default function Sidebar({ routeReveal }: { routeReveal: SidebarRouteReve

const handleThreadClick = (event: ReactMouseEvent, threadRef: ScopedThreadRef) => {
if (isSidebarNestedLinkClick(event.target)) return;
const isMac = isMacPlatform(navigator.platform);
const isModClick = isMac ? event.metaKey : event.ctrlKey;
const threadKey = scopedThreadKey(threadRef);
if (isModClick) {
if (isPlatformModKey(event)) {
event.preventDefault();
toggleThreadSelection(threadKey);
return;
Expand Down Expand Up @@ -3019,7 +3021,7 @@ export default function Sidebar({ routeReveal }: { routeReveal: SidebarRouteReve
setProjectScopeKeys([]);
} else if (
eventDetails.event instanceof MouseEvent &&
eventDetails.event.shiftKey
isPlatformModKey(eventDetails.event)
) {
// Canceling skips Base UI's commit, which would freeze the search query, and its close.
eventDetails.cancel();
Expand Down Expand Up @@ -3095,13 +3097,18 @@ export default function Sidebar({ routeReveal }: { routeReveal: SidebarRouteReve
toggleProjectGroupPin(project);
return;
}
if (event.ctrlKey || event.altKey || event.metaKey) return;
if (event.shiftKey && event.key === "Enter") {
if (
event.key === "Enter" &&
!event.shiftKey &&
!event.altKey &&
isPlatformModKey(event)
) {
if (!project) return;
event.preventDefault();
toggleProjectScopeKey(project.projectKey);
return;
}
if (event.ctrlKey || event.altKey || event.metaKey) return;
if (
event.key !== "ContextMenu" &&
!(event.shiftKey && event.key === "F10")
Expand Down
5 changes: 5 additions & 0 deletions docs/user/thread-sidebar.md
Original file line number Diff line number Diff line change
Expand Up @@ -232,6 +232,11 @@ On mobile, the thread list search also lists message matches and opens them at
the matching message; on an iPad with a keyboard, `Cmd+K` opens the same
palette.

On web and desktop, the project filter at the top of the sidebar narrows the thread
list. Pick a project to show only its threads, or `Cmd/Ctrl+click` it (`Cmd/Ctrl+Enter`
from the keyboard) to add or remove it and keep the menu open. On mobile, the filter
holds one project.

Use **Settings → Keybindings** to find or customize shortcuts for searching files
and copying a thread reference. A copied reference uses the thread's pull request
link when available, otherwise a link to the thread, which opens it from anywhere
Expand Down
Loading