Repository navigation
fix(lanes): the primary lane stops showing old pull requests once back on main - #1639
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 23 minutes. View limit details
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Bugbot couldn't run - usage limit reachedBugbot is counted against Cursor usage for this user or team, and this run hit a usage or spend limit. A user or team admin can review and increase usage limits in the Cursor dashboard. (requestId: 2d75e7ee-f12e-44a1-88cc-7a2bb34189f0) |
- Lane PR 'primary on base' rule: one shared definition in shared/laneBaseResolution.ts, used by the renderer selectors, the host display selector/bridge and the CLI lane-link envelope (also fixes the CLI's weaker ref normalization). - prService.rowMatchesLaneBranchForDisplay uses the same helper. - PR link purge moves to pullRequestRowCleanup (deletePullRequestChatLinksForSessions, chunked, per-statement tolerant) and is now called by both doors that delete sessions: sessionService .deleteSession and the lane-delete cascade, which previously left cross-lane edges behind to flip into claims. - The session-delete purge reports failure through an optional logger instead of a bare catch; main.ts and bootstrap.ts pass one. - Hosted web client's prs.getForLane prefers the host action, so its lane links stop naming the newest row the host would not.
- shared laneIsOnBaseBranch table (primary/base, work branch, worktree lane, ref-spelled and remote-spelled refs, missing branch). - selectLanePrs hides every PR for a primary lane back on base, chat link included, and shows them again on the PR's branch. - selectChatPrs still shows the linking chat the PR the lane surface hides. - getForLane answers null for primary-on-base instead of the newest previous-branch row, and still answers on the PR's branch. - sessionService.deleteSession drops the deleted session's PR edges and tombstones while the surviving chat keeps its claim and the PR row stays. - laneService lane delete drops cross-lane edges held by the lane's sessions (the pr_id-keyed detach cannot see them). - iOS WorkChipDetectorTests mirror the lane gate and the chat union.
Bugbot couldn't run - usage limit reachedBugbot is counted against Cursor usage for this user or team, and this run hit a usage or spend limit. A user or team admin can review and increase usage limits in the Cursor dashboard. (requestId: 9492cd55-4caf-402c-8c52-0ce30c18ecf6) |
Why
The Primary lane is the project's own checkout. It can never be deleted, so when it was used on a branch and then switched back to
main, an old merged pull request stayed pinned to it — our Primary lane showed #1501 weeks after it merged. A pull request that any chat once linked bypassed the branch rule, and for a lane that cannot be deleted nothing ever cleaned that up.What changed
Lane surfaces (the lane list, Work lane headers and chat rows, lane state) now show no pull request while the Primary lane sits on its base branch; the PR workspace keeps the full history. A chat that opened a pull request still shows it, so the thread that did the work keeps its link. Copying a lane link, Linear cards, and proof-to-PR owners no longer name the old PR for Primary. Deleting a chat now removes the pull requests it linked, so a deleted chat cannot keep pinning one. iOS mirrors the same rules.
Left alone on purpose: worktree lanes keep today's behavior — a pull request this lane owns that a chat linked stays visible after a branch move — and an open pull request is still tracked in the PRs tab while the checkout sits on
main.Evidence
main; Make updates, Repair and Reset actually bring ADE back #1501 and feat(history): revamp the Commits view with lane-aware graph and history links #1430 chat-linked; providers: stop overriding the user's own config #1136 unlinked): lane surfaces returned Make updates, Repair and Reset actually bring ADE back #1501 + feat(history): revamp the Commits view with lane-aware graph and history links #1430 before the change and none after; the chat linked to Make updates, Repair and Reset actually bring ADE back #1501 still resolves it.typecheck(desktop and CLI), desktopbuild, and eslint on the changed files./qualityand/teststill to run on this PR.Not checked
Opened by DeepSeek V4.1 Flash (OpenCode) in an ADE lane.
Note
Medium Risk
Changes PR selection and link cleanup across desktop, CLI, iOS, and delete cascades; incorrect behavior could mis-route lane links or leave orphan PR claims, but behavior is heavily test-covered.
Overview
Primary lane on
mainno longer advertises stale PRs across lane badges, Work surfaces,getForLane, CLI lane-link envelopes, and iOS—using sharedlaneIsOnBaseBranchso chat-linked merged PRs cannot pin history forever on an undeletable lane.selectChatPrsstill shows PRs the thread explicitly linked, even when lane surfaces hide them.Session and lane delete now purge
pull_request_chat_sessions/ dismissals viadeletePullRequestChatLinksForSessions, including cross-lane edges during lane teardown, with optional logging on failed purges insessionService.Web client prefers host
prs.getForLanewhen available so primary-on-base returnsnullinstead of a recency fallback.Reviewed by Cursor Bugbot for commit c6a3f29. Configure here.