fix(web): open thread picker for unsent drafts #15436
main fromrefs/pull/15436/head·merged by maria-rcks View on GitHubNote
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: linking the nonexistent draft fails and preserves its text
after: the same draft opens the picker and links the persisted control
model: unknown-model; harness: codex in t3 code.
- 1
github-actions[bot](GitHub profile, opens in a new tab) added labelsvouch:trusted
github-actions[bot](GitHub profile, opens in a new tab) added labelssize:XS
Approvability#
Verdict: Approved at
ebfe576Macroscope'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).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
useThreadShellonly when the environment matches. It setscurrentThreadReftonullwhen the hook returns no thread.Changes#
Thread resolution
Layer / File(s) Summary Resolve current thread
apps/web/src/components/pullRequest/PullRequestThreadLinks.tsxThe hook receives the thread reference only when its environment matches. currentThreadRefisnullwhen the hook returns no thread.Priority: ⬇️ Low
Estimated code review effort: 2 (Simple) | ~10 minutes
Change: Bug fix
Suggested reviewers:
juliusmarmingeMerge Risk: ⚪ Minimal · up to
ebfe5The change supports unsent drafts without introducing a concrete merge-blocking risk.
Security Architecture Review#
Security architecture risk: 🔵 Low · up to
ebfe5The 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 name Status Explanation Resolution Docstring Coverage ⚠️ Warning Docstring 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 name Status Explanation Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request. Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request. Title check ✅ Passed The title clearly and concisely describes the main change: opening the thread picker for unsent drafts. Description check ✅ Passed The 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.maria-rcks merged thisc8d7d50
maria-rcks closed this
Sign in to join this conversation.
macroscopeapp[bot](GitHub profile, opens in a new tab) approved these changes