Skip to content

feat(web): searchable session picker on Android share target #980

Description

@heavygee

Summary

Android Web Share Target (merged #933 / #932) lands on /share with a session picker titled "Recent active sessions". The operator can only pick from active sessions in list order — there is no search, and inactive sessions are excluded entirely.

On a busy hub with dozens of sessions, the target session is often not in the visible recent set. Operator must spawn a new session or hunt elsewhere instead of attaching the shared file to an existing thread.

Current behavior

web/src/routes/share/index.tsx:

  • Loads sessions via useSessions() (full list from GET /api/sessions)
  • Snapshots active only, sorted by updatedAt desc
  • Renders flat list — no query/filter UI
  • No way to reach an older or inactive session from the share sheet flow

Main session sidebar already has search (SessionListSearch, sessionMatchesQuery, normalizeSearch in SessionList.tsx) — share picker does not reuse it.

Expected behavior

  1. Search field on the share session picker (mobile-first; autofocus optional on desktop only).
  2. Empty query: keep current UX — recent active sessions (sorted by updatedAt).
  3. Non-empty query: filter all sessions (active + inactive) using the same matching rules as sidebar search (title, path, id, flavor, summary, machine label).
  4. Clear empty-state copy when search has no hits (sessions.search.noResults or share-specific i18n).
  5. Optional polish: show inactive badge on search hits; cap default recent list with hint "Search for more sessions" if list > N (reuse DEFAULT_SESSION_PREVIEW_LIMIT or explicit share constant — pick one, document in PR).

Acceptance criteria

  • Share picker has search input
  • Search finds sessions not shown in default recent-active list (including inactive)
  • Reuses shared search helpers from SessionList.tsx (no duplicate matching logic)
  • i18n: en.ts + zh-CN.ts
  • Unit tests for share picker filter behavior (extract pure filter fn if needed)
  • Playwright or peer-stack smoke: share route with mocked sessions + search narrows list

References

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions