Skip to content
Source
Sign inSign up
pingdotgg/t3code

fix(web): open thread picker for unsent drafts #15436

Mergedmaria-rcksmerged 1 commit intomain fromrefs/pull/15436/headmerged by maria-rcks View on GitHub

maria-rckscommented

Note

Written by unknown-model on behalf of Maria

an unsent draft has a local thread id before a server thread exists, so "Link to this thread" failed with a missing-thread error. the menu now requires the environment-scoped server shell for that action and otherwise opens the existing persisted-thread picker. the draft's text and route stay intact without promotion.

refs #14858's secondary draft-link failure. this uses the very small obvious-bug exception and changes two lines in the existing menu component.

verified the original unsent draft with real PR #15394 and a completed Codex control thread: picker link, persisted direct link/unlink, unchanged text/route, promotedTo=null, and HTTP 404 for the draft id. blacksmith passed scoped lint (0 warnings/errors), web typecheck, and all 50 existing PR detail/link compatibility tests. native desktop, remote connections, legacy server, and cross-environment runtime paths remain unverified; mobile has no matching menu component.

before: the same unsent draft incorrectly offers Link to this thread

after: the same unsent draft offers Link to thread

after: the persisted control is marked Linked in the picker

before: linking the nonexistent draft fails and preserves its text

https://uploads-production-47e4.up.railway.app/files/c6c31eef-5add-41b8-b617-591144edec6d/baseline-interaction.mp4

after: the same draft opens the picker and links the persisted control

https://uploads-production-47e4.up.railway.app/files/a9601898-f0af-4897-bcd0-b8ac35a939f5/candidate-interaction.mp4

model: unknown-model; harness: codex in t3 code.

    1. github-actions[bot](GitHub profile, opens in a new tab) added labelsvouch:trusted

    2. Approvability

      Verdict: Approved at ebfe576

      Macroscope's review found this PR approvable — This is a two-line, localized bug fix that routes unsent drafts to the existing thread picker while preserving persisted-thread behavior. It introduces no schema, infrastructure, 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).
    3. coderabbitai[bot](GitHub profile, opens in a new tab)commented
      Review in Change Stack →

      Navigate logical layers of code changes, visualize relationships, and explore their blast radius.

      No actionable comments were generated in the recent review. 🎉

      ℹ️ Recent review info
      ⚙️ Run configuration
      • Configuration used: Repository: pingdotgg/t3code/.coderabbit.yaml
      • Review profile: CHILL
      • Plan: Advanced
      • Run ID: 8bcb4fdf-0255-45b3-a3ca-e2475cc5df3b
      📥 Commits

      Reviewing files that changed from the base of the PR and between 0c8112013760617230d382e55447ddb75627a997 and ebfe5760feb88fa1730f8a0a0692d8c248bcf52c.

      📒 Files selected for processing (1)
      • apps/web/src/components/pullRequest/PullRequestThreadLinks.tsx

      Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 0 remain after this review.


      📝 Walkthrough

      Walkthrough

      The pull request thread link component now passes a thread reference to useThreadShell only when the environment matches. It sets currentThreadRef to null when the hook returns no thread.

      Changes

      Thread resolution

      Layer / File(s)Summary
      Resolve current thread
      apps/web/src/components/pullRequest/PullRequestThreadLinks.tsx
      The hook receives the thread reference only when its environment matches. currentThreadRef is null when the hook returns no thread.

      Priority: ⬇️ Low

      Estimated code review effort: 2 (Simple) | ~10 minutes

      Change: Bug fix

      Suggested reviewers: juliusmarminge

      Merge Risk: ⚪ Minimal · up to ebfe5

      The change supports unsent drafts without introducing a concrete merge-blocking risk.

      Security Architecture Review

      Security architecture risk: 🔵 Low · up to ebfe5

      The change preserves environment-scoped thread selection and existing linking checks. No new access bypass was identified, but concurrent deletion, response-loss recovery, and behavior across supported connection modes remain incompletely verified.

      Retained concerns No architecture-level concerns identified.

      Security review details

      Security Blast Radius

      • inferred — The newly reachable picker permits intentional selection of another active thread within the selected environment. Inspected candidate filtering and mutation validation do not show new cross-environment authority or a new credential-bearing sink.

      Trust Boundaries and Controls

      • observed — Supplied thread references are checked against the selected environment before shell lookup. Picker candidates exclude archived and foreign-environment threads. The common mutation hook independently checks environment identity, URL parsing, linking capability, and project-derived eligibility before dispatch. These are client-side controls, not proof of server authorization.

      Resilience and Maintainability Implications

      • observed — The existing mutation path clears pending state in finally, surfaces failures and interruptions, and closes the picker after successful mutation. Link, unlink, and legacy metadata commands share serial scheduling keyed by environment and thread. Serialization orders local commands but neither deduplicates them nor proves recovery after response loss or concurrent server-side removal.
      🚥 Pre-merge checks | ✅ 4 | ❌ 1

      ❌ Failed checks (1 warning)

      Check nameStatusExplanationResolution
      Docstring Coverage⚠️ WarningDocstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 1 functions across 1 files.Write docstrings for the functions missing them to satisfy the coverage threshold.
      ✅ Passed checks (4 passed)
      Check nameStatusExplanation
      Linked Issues check✅ PassedCheck skipped because no linked issues were found for this pull request.
      Out of Scope Changes check✅ PassedCheck skipped because no linked issues were found for this pull request.
      Title check✅ PassedThe title clearly and concisely describes the main change: opening the thread picker for unsent drafts.
      Description check✅ PassedThe description covers the problem, change, scope rationale, and verification. It includes test results, unverified paths, and before-and-after UI evidence.
      • Fix all pre-merge checks with AI
      ✨ Finishing Touches
      🧪 Generate unit tests (beta)
      • Create a new PR
      • Autopilot · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

      Comment `@coderabbitai help` to get the list of available commands.
    4. maria-rcks merged thisc8d7d50

    5. maria-rcks closed this

Sign in to join this conversation.