From af0bc630dda805564b72608ebe50f437783bdf52 Mon Sep 17 00:00:00 2001 From: Ishaan Gupta Date: Fri, 3 Jul 2026 20:30:49 +0530 Subject: [PATCH] Avoid picker scroll for short workspace lists --- apps/mcp/src/widget/views/Picker.tsx | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/apps/mcp/src/widget/views/Picker.tsx b/apps/mcp/src/widget/views/Picker.tsx index 30c9cf97..6f16c574 100644 --- a/apps/mcp/src/widget/views/Picker.tsx +++ b/apps/mcp/src/widget/views/Picker.tsx @@ -5,6 +5,7 @@ import type { ViewMessage, } from "../../shared/types" import { WorkspaceCard } from "../components/WorkspaceCard" +import { cn } from "../design/lib/cn" import { Input, PageHeader } from "../design/ui" import { useApp } from "../hooks/useApp" import { useLog } from "../hooks/useLog" @@ -59,6 +60,7 @@ export function Picker({ } const count = containerTags.length + const shouldConstrainList = count >= SEARCH_THRESHOLD const description = count === 0 ? "No workspaces available." @@ -80,9 +82,15 @@ export function Picker({ ) : null} - {/* Bounded, scrollable list — keeps a stable height so filtering or a - long workspace list doesn't resize (jump) the whole widget. */} -
+ {/* Bound longer workspace lists so filtering/search does not resize the widget. + Small lists stay natural-height to avoid unnecessary nested scrolling. */} +
{filtered.length === 0 ? (

No workspaces match “{query}”.