Import apps/android/src/lib/session-visibility.ts

This commit is contained in:
QQ 2026-11-17 08:25:59 +08:00
parent a8b43fc5f0
commit 6222189fbd
1 changed files with 13 additions and 0 deletions

View File

@ -0,0 +1,13 @@
import type { RemoteSession } from '../types'
/** Match Desktop sessionVisible / visibleSessionIds: only the current blank
* placeholder is listed, and blank placeholders never match a search query. */
export function isVisibleSession(
session: RemoteSession,
currentSessionId: string | undefined,
searchQuery = '',
): boolean {
if (session.origin === 'subagent') return false
if (session.blank && (session.sessionId !== currentSessionId || searchQuery.trim().length > 0)) return false
return true
}