Skip to content
Merged
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
6 changes: 2 additions & 4 deletions apps/web/src/components/Sidebar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -1032,7 +1032,6 @@ export default function Sidebar({ routeReveal }: { routeReveal: SidebarRouteReve
const projectScopeFilter = useComboboxFilter();
const allProjectSnapshotsReady = useAllEnvironmentProjectSnapshotsReady();
const allProjectConfigsReady = useAtomValue(environmentProjects.projectConfigsReadyAtom);
const headerSearchRef = useRef<HTMLDivElement | null>(null);
// Safari may click after Ctrl+click opens settings; suppress that selection until the picker reopens.
const suppressNextScopeChangeRef = useRef(false);
const highlightedProjectScopeKeyRef = useRef<string | null>(null);
Expand Down Expand Up @@ -2990,7 +2989,6 @@ export default function Sidebar({ routeReveal }: { routeReveal: SidebarRouteReve
fixedHeader={
<SidebarGroup className="z-[1]">
<SidebarThreadHeader
searchFieldRef={headerSearchRef}
hasProjects={projectGroups.length > 0}
projectScope={
<Combobox
Expand Down Expand Up @@ -3061,8 +3059,8 @@ export default function Sidebar({ routeReveal }: { routeReveal: SidebarRouteReve
{/* Refocusing the trigger after a pointer close shows its focus ring and opens its tooltip. */}
<ComboboxPopup
align="start"
anchor={headerSearchRef}
className="max-w-[min(18rem,var(--available-width))] overflow-hidden"
collisionAvoidance={{ side: "flip", align: "shift" }}
className="w-[min(18rem,var(--available-width))] overflow-hidden"
Comment thread
coderabbitai[bot] marked this conversation as resolved.
Resolved
finalFocus={(closeType) => closeType === "keyboard"}
>
<ComboboxSearchInput
Expand Down
7 changes: 1 addition & 6 deletions apps/web/src/components/sidebar/SidebarThreadHeader.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ import { SidebarInput, SidebarMenuButton } from "../ui/sidebar";
import { Tooltip, TooltipPopup, TooltipTrigger } from "../ui/tooltip";

export interface SidebarThreadHeaderProps {
searchFieldRef?: RefObject<HTMLDivElement | null>;
hasProjects: boolean;
projectScope: ReactNode;
onNewProject: () => void;
Expand All @@ -33,7 +32,6 @@ export interface SidebarThreadHeaderProps {
}

export function SidebarThreadHeader({
searchFieldRef,
hasProjects,
projectScope,
onNewProject,
Expand All @@ -60,10 +58,7 @@ export function SidebarThreadHeader({

return (
<div className="flex items-center gap-1">
<div
ref={searchFieldRef}
className="flex h-8 min-w-0 flex-1 items-center gap-2 rounded-md px-2 py-1.5 text-sm font-medium text-sidebar-muted-foreground hover:bg-sidebar-row-hover hover:text-sidebar-foreground focus-within:bg-sidebar-row-hover focus-within:text-sidebar-foreground focus-within:ring-1 focus-within:ring-inset focus-within:ring-ring/70"
>
<div className="flex h-8 min-w-0 flex-1 items-center gap-2 rounded-md px-2 py-1.5 text-sm font-medium text-sidebar-muted-foreground hover:bg-sidebar-row-hover hover:text-sidebar-foreground focus-within:bg-sidebar-row-hover focus-within:text-sidebar-foreground focus-within:ring-1 focus-within:ring-inset focus-within:ring-ring/70">
<SearchIcon className="size-4 shrink-0 text-(--sidebar-icon-color)" />
<SidebarInput
ref={searchInputRef}
Expand Down
3 changes: 3 additions & 0 deletions apps/web/src/components/ui/combobox.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,7 @@ function ComboboxPopup({
sideOffset = 4,
alignOffset,
align = "start",
collisionAvoidance,
anchor: anchorProp,
...props
}: ComboboxPrimitive.Popup.Props & {
Expand All @@ -147,6 +148,7 @@ function ComboboxPopup({
alignOffset?: ComboboxPrimitive.Positioner.Props["alignOffset"];
side?: ComboboxPrimitive.Positioner.Props["side"];
anchor?: ComboboxPrimitive.Positioner.Props["anchor"];
collisionAvoidance?: ComboboxPrimitive.Positioner.Props["collisionAvoidance"];
}) {
const { chipsRef, multiple } = React.use(ComboboxContext);
const anchor = anchorProp ?? (multiple ? chipsRef : undefined);
Expand All @@ -157,6 +159,7 @@ function ComboboxPopup({
align={align}
alignOffset={alignOffset}
anchor={anchor}
collisionAvoidance={collisionAvoidance}
className="z-[130] select-none"
data-slot="combobox-positioner"
side={side}
Expand Down
Loading