11import type {
22 AccountSnapshot ,
3+ RequestUserInputRequest ,
34 RateLimitSnapshot ,
45 ThreadListSortKey ,
56 ThreadSummary ,
@@ -66,6 +67,7 @@ type SidebarProps = {
6667 onRefreshAllThreads : ( ) => void ;
6768 activeWorkspaceId : string | null ;
6869 activeThreadId : string | null ;
70+ userInputRequests ?: RequestUserInputRequest [ ] ;
6971 accountRateLimits : RateLimitSnapshot | null ;
7072 usageShowRemaining : boolean ;
7173 accountInfo : AccountSnapshot | null ;
@@ -122,6 +124,7 @@ export const Sidebar = memo(function Sidebar({
122124 onRefreshAllThreads,
123125 activeWorkspaceId,
124126 activeThreadId,
127+ userInputRequests = [ ] ,
125128 accountRateLimits,
126129 usageShowRemaining,
127130 accountInfo,
@@ -197,6 +200,19 @@ export const Sidebar = memo(function Sidebar({
197200 } = getUsageLabels ( accountRateLimits , usageShowRemaining ) ;
198201 const debouncedQuery = useDebouncedValue ( searchQuery , 150 ) ;
199202 const normalizedQuery = debouncedQuery . trim ( ) . toLowerCase ( ) ;
203+ const pendingUserInputKeys = useMemo (
204+ ( ) =>
205+ new Set (
206+ userInputRequests
207+ . map ( ( request ) => {
208+ const workspaceId = request . workspace_id . trim ( ) ;
209+ const threadId = request . params . thread_id . trim ( ) ;
210+ return workspaceId && threadId ? `${ workspaceId } :${ threadId } ` : "" ;
211+ } )
212+ . filter ( Boolean ) ,
213+ ) ,
214+ [ userInputRequests ] ,
215+ ) ;
200216
201217 const isWorkspaceMatch = useCallback (
202218 ( workspace : WorkspaceInfo ) => {
@@ -484,6 +500,7 @@ export const Sidebar = memo(function Sidebar({
484500 activeWorkspaceId = { activeWorkspaceId }
485501 activeThreadId = { activeThreadId }
486502 threadStatusById = { threadStatusById }
503+ pendingUserInputKeys = { pendingUserInputKeys }
487504 getThreadTime = { getThreadTime }
488505 isThreadPinned = { isThreadPinned }
489506 onSelectThread = { onSelectThread }
@@ -635,6 +652,7 @@ export const Sidebar = memo(function Sidebar({
635652 expandedWorkspaces = { expandedWorkspaces }
636653 activeWorkspaceId = { activeWorkspaceId }
637654 activeThreadId = { activeThreadId }
655+ pendingUserInputKeys = { pendingUserInputKeys }
638656 getThreadRows = { getThreadRows }
639657 getThreadTime = { getThreadTime }
640658 isThreadPinned = { isThreadPinned }
@@ -661,6 +679,7 @@ export const Sidebar = memo(function Sidebar({
661679 activeWorkspaceId = { activeWorkspaceId }
662680 activeThreadId = { activeThreadId }
663681 threadStatusById = { threadStatusById }
682+ pendingUserInputKeys = { pendingUserInputKeys }
664683 getThreadTime = { getThreadTime }
665684 isThreadPinned = { isThreadPinned }
666685 onToggleExpanded = { handleToggleExpanded }
0 commit comments