Skip to content
Source
Sign inSign up
pingdotgg/t3code

fix(mobile): keep new-thread targets stable during search #3693

Closedt3dotgg(GitHub profile, opens in a new tab)wants to merge 1 commit intomain fromfix/new-thread-target-searchopened View on GitHub

Search can change which machine receives a quick new thread in a grouped mobile project.

Choose the target from the group's full history. Skip groups with no search matches, then sort each remaining group once and select matching threads for display. Keep the current canonical-project lookup and pending-project behavior.

Checks

  • 25 focused tests passed. The new search case fails on main without this fix.
  • Targeted lint and formatting passed.
  • Mobile package typecheck passed.

Original author and co-author credit is unchanged.

Updated with GPT-5.6 Sol in Codex.


Note

Low Risk Localized change to home thread grouping and display filtering; no auth, data, or API surface changes.

Overview Fixes quick new-thread routing on the mobile home list when a search query hides the most recently active thread in a grouped repository (e.g. laptop vs desktop).

buildHomeThreadGroups now sorts the group’s full thread history once, uses that ordering to pick newThreadTarget (still resolving stale project IDs to the canonical member), and only filters that sorted list for display when search is active. Search no longer shrinks the recency basis for which machine gets a new thread.

A regression test covers the case where search matches only the older laptop thread but the target must remain the desktop project with the newest activity.

Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit 1191747622209a5773735257cd4a95db153454b4. Bugbot is set up for automated code reviews on this repo. Configure [here](https://www.cursor.com/dashboard/bugbot).

Note

  • buildHomeThreadGroups now sorts all group threads and picks the quick new-thread target from the full history, then filters for search display. Previously, search-matching threads drove both sorting and target selection, so hiding the newest thread changed the target.
  • Adds a regression test in homeThreadList.test.ts covering two projects where search hides the newer thread.
  • Behavioral Change: search results still show only matching threads, but the quick new-thread target now always reflects the newest thread in the group regardless of the active search query.
Macroscope summarized 1191747.
    1. Important

      Review skipped

      Auto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

      ⚙️ Run configuration

      Configuration used: Repository UI

      Review profile: CHILL

      Plan: Pro

      Run ID: a44ccdeb-c2e3-4694-aa17-3127ed4f0b79

      You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

      Use the checkbox below for a quick retry:

      • 🔍 Trigger review
      ✨ Finishing Touches
      🧪 Generate unit tests (beta)
      • Create PR with unit tests
      • Commit unit tests in branch `fix/new-thread-target-search`

      Comment `@coderabbitai help` to get the list of available commands.
    2. github-actions[bot](GitHub profile, opens in a new tab) added labelsvouch:trusted

    3. t3dotgg(GitHub profile, opens in a new tab) changed the title

    4. Thread transfer impact

      ✅ Thread transfer remains within every enforced ceiling.

      ProviderMetricMain baselineThis PRImpactPR ceiling
      CodexTotal thread wire13.1 KiB13.3 KiB+177 B (+1.3%)15.1 KiB✅
      CodexThread snapshot wire6.9 KiB6.9 KiB+4 B (+0.1%)7.3 KiB✅
      CodexLive turn WebSocket wire6.2 KiB6.4 KiB+173 B (+2.7%)7.8 KiB✅
      CodexLive turn WebSocket decoded54.7 KiB55.6 KiB+910 B (+1.6%)66.4 KiB✅
      CodexLive turn messages810+2 (+25.0%)21✅
      ClaudeTotal thread wire13.2 KiB13.3 KiB+141 B (+1.0%)15.1 KiB✅
      ClaudeThread snapshot wire6.9 KiB6.9 KiB−4 B (−0.1%)7.3 KiB✅
      ClaudeLive turn WebSocket wire6.3 KiB6.4 KiB+145 B (+2.3%)7.8 KiB✅
      ClaudeLive turn WebSocket decoded55.5 KiB56.4 KiB+928 B (+1.6%)66.4 KiB✅
      ClaudeLive turn messages810+2 (+25.0%)21✅

      Baseline: b21d872 · PR result: 1191747 · Source CI: success

      Scenario and decoded snapshot size

      10 historical turns, 5 command tools per turn, 878.9 KiB retained MCP result per historical turn, and a 1.05 MiB retained result in the measured turn.

      • Codex decoded thread snapshot: 109.4 KiB
      • Claude decoded thread snapshot: 110.1 KiB

      Updated in place by a trusted workflow. PR artifacts are strictly validated and never executed.

    5. Approvability

      Verdict: Approved at 1191747

      Macroscope's review found this PR approvable — This is a small, localized mobile bug fix that keeps search-filtered results intact while making quick new-thread creation use the newest project activity from the full history. A regression test covers the cross-device search case, with no schema, deployment, security, billing, default, or static-analysis changes.

      You can add or adjust custom eligibility rules. [Learn more](https://docs.macroscope.com/approvability#example-custom-eligibility-rules).

Sign in to join this conversation.