Skip to content

fix(native): sync sidebar search lifetime and cross-env ranking - #349

Merged
rynfar merged 1 commit into
nativefrom
nw/242-search-lifetime
Nov 13, 2026
Merged

rynfar merged 1 commit into
nativefrom
nw/242-search-lifetime

Conversation

@rynfar

@rynfar rynfar commented Nov 13, 2026 •

Copy link
Copy Markdown
Owner

Native sidebar search only dispatched orchestration.searchThreads on query edits, passed project titles into sidebar search subjects, concatenated server content hits without quality/hits/messageCreatedAt ranking or nextShownOrder stabilization, included server hits absent from admitted sidebar rows, cleared SEARCH_KEY mounts before selecting/navigating older-settled results, and dropped settled results on every keystroke instead of retaining related queries via visibleThreadSearch.

This ports the SB-SEARCH request-lifetime, activation, and result-ranking contract from packages/client-runtime/src/state/threadSearch.ts, apps/web/src/state/queries.ts, and apps/web/src/components/Sidebar.logic.ts (including pingdotgg/t3code#24343 no-project-title sidebar search):

  • Re-syncs per-owner searchThreads flights and search omitted-row mounts on AppEvent::Shell when project scope, olderSettledBefore, owner readiness, or orchestration:read grants change for the same query, mirroring the active environment's search mount into self.omitted.mounts and selecting/navigating before clear_search so older-settled hits activate reliably while another thread or hidden-tag filter is active.
  • Filters server content matches to admitted sidebar rows (subject_by_key), retains full ServerThreadSearchMatch records (message_id, snippet, source) across related queries (visibleThreadSearch) while clearing immediately on unrelated or empty queries, enforces the 200 UTF-16 code unit query cap and message_search_tokens gate, and ranks server matches across environments via rank_message_matches (picks: false) stabilized with next_shown_order.
  • Aligns local sidebar search subjects (Some(None) latest_user_authored_message_at fallback to created_at, OpenHistory::opened_at local open boost, active/mounted shell search_pull_requests, and project_title: None) and updates apps/native/parity/LEDGER.md (SB-SEARCH remains partial for non-active remote summary PR links, find-in-thread handoff, and UI proof).

Ref #242, #329

Headless verification (serialized under lockf)

  • RED -> GREEN cargo test -p t3-core -- sidebar::older_settled::tests::search_requests_follow_message_token_rules_and_utf16_query_cap (1 passed; 0 failed)
  • RED -> GREEN cargo test -p t3-native --features snapshot -- sidebar::search::tests:: --test-threads=1 (4 passed; 0 failed)
  • cargo test -p t3-core -p t3-client (1365 passed; 0 failed)
  • cargo test -p t3-native --features snapshot -- omitted_rows::tests:: --test-threads=1 (6 passed; 0 failed)
  • cargo clippy --workspace --all-targets -- -D warnings (0 warnings)
  • cargo build -p t3-native --message-format=json (compile-only, fresh: false, success: true)
  • node scripts/gen-theme.ts --check, node --test parity/sync.test.ts (42/42), node conformance/generate.ts --check
  • vp fmt --check apps/native/parity/LEDGER.md & vp run check:changed fork/native (exit 0)

Built with Antigravity (sidebar-author).

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant