Skip to content

fix(lanes): the primary lane stops showing old pull requests once back on main - #1639

Merged
arul28 merged 3 commits into
mainfrom
ade/primary-lane-stale-pr-badge
Oct 15, 2026
Merged

arul28 merged 3 commits into
mainfrom
ade/primary-lane-stale-pr-badge

Conversation

@arul28

@arul28 arul28 commented Oct 15, 2026 •

Copy link
Copy Markdown
Owner

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

Not checked

  • Full iOS build; the Swift change is syntax-parsed here, and CI runs the iOS suite.
  • No visual capture of the fixed state yet.

Opened by DeepSeek V4.1 Flash (OpenCode) in an ADE lane.

ADE   Open in ADE  ·  ade/primary-lane-stale-pr-badge branch  ·  PR #1639


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 main no longer advertises stale PRs across lane badges, Work surfaces, getForLane, CLI lane-link envelopes, and iOS—using shared laneIsOnBaseBranch so chat-linked merged PRs cannot pin history forever on an undeletable lane. selectChatPrs still shows PRs the thread explicitly linked, even when lane surfaces hide them.

Session and lane delete now purge pull_request_chat_sessions / dismissals via deletePullRequestChatLinksForSessions, including cross-lane edges during lane teardown, with optional logging on failed purges in sessionService.

Web client prefers host prs.getForLane when available so primary-on-base returns null instead of a recency fallback.

Reviewed by Cursor Bugbot for commit c6a3f29. Configure here.

@vercel

vercel Bot commented Oct 15, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Actions Updated
ade Ignored Ignored Preview Oct 15, 2026 5:12pm UTC

@coderabbitai

coderabbitai Bot commented Oct 15, 2026 •

Copy link
Copy Markdown

Warning

Review limit reached

You'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.

Check out review usage here.

View limit details

Limit details: You’ve used all 2 included reviews currently available.

Learn how review limits work.

Review configuration:

⚙️ Run configuration
  • Configuration used: Repository: arul28/ADE/.coderabbit.yaml
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 945c5e3c-c851-4b6f-add2-be03e8f44916
📥 Commits

Reviewing files that changed from the base of the PR and between 40f8420 and c6a3f29.

⛔ Files ignored due to path filters: 3
  • docs/features/lanes/README.md is excluded by !docs/**
  • docs/features/pull-requests/README.md is excluded by !docs/**
  • docs/features/sync-and-multi-device/ios-companion.md is excluded by !docs/**
📒 Files selected for processing: 18
  • apps/ade-cli/src/bootstrap.ts
  • apps/ade-cli/src/cli.ts
  • apps/desktop/src/main/main.ts
  • apps/desktop/src/main/services/lanes/laneService.test.ts
  • apps/desktop/src/main/services/lanes/laneService.ts
  • apps/desktop/src/main/services/prs/prService.test.ts
  • apps/desktop/src/main/services/prs/prService.ts
  • apps/desktop/src/main/services/prs/pullRequestRowCleanup.ts
  • apps/desktop/src/main/services/sessions/sessionService.test.ts
  • apps/desktop/src/main/services/sessions/sessionService.ts
  • apps/desktop/src/renderer/components/lanes/LanesPage.test.ts
  • apps/desktop/src/renderer/components/lanes/lanePageModel.prMatch.test.ts
  • apps/desktop/src/renderer/components/lanes/lanePageModel.ts
  • apps/desktop/src/renderer/webclient/adapter/prs.ts
  • apps/desktop/src/shared/laneBaseResolution.test.ts
  • apps/desktop/src/shared/laneBaseResolution.ts
  • apps/ios/ADE/Views/Lanes/LaneHelpers.swift
  • apps/ios/ADETests/WorkChipDetectorTests.swift
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@cursor

cursor Bot commented Oct 15, 2026

Copy link
Copy Markdown
Contributor

Bugbot couldn't run - usage limit reached

Bugbot 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.
@cursor

cursor Bot commented Oct 15, 2026

Copy link
Copy Markdown
Contributor

Bugbot couldn't run - usage limit reached

Bugbot 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)

@arul28
arul28 merged commit 5f833fc into main Oct 15, 2026
76 of 78 checks passed
@arul28
arul28 deleted the ade/primary-lane-stale-pr-badge branch October 15, 2026 17:49
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