Skip to content

vscode: PR sidebar — sort mine first, then review-requested, then others; show draft badge #787

Closed

Description

@amrmelsayed

Problem

The Codev sidebar's Pull Requests view (packages/vscode/src/views/pull-requests.ts) renders data.pendingPRs in whatever order Tower returns them. The reviewer has no fast scan-path: their own PRs and the ones that need their attention sit interleaved with everyone else's. Draft PRs are indistinguishable from ready ones.

Current state

  • views/pull-requests.ts:18 maps data.pendingPRs to flat tree items, no sorting, no per-PR partitioning.
  • OverviewData.currentUser is already populated (packages/codev/src/agent-farm/servers/overview.ts:122, via fetchCurrentUserCached) and is consumed today by views/backlog.ts:43 for the assignee icon swap. The "me" identity is already a solved problem — reuse it.
  • PROverview (overview.ts:76) and the underlying PrListItem concept type (packages/codev/src/lib/forge-contracts.ts:57) don't currently carry reviewRequests or isDraft. The GraphQL needed already exists in packages/codev/src/lib/team-github.ts:119,122 (used by the Team view), so the fields are reachable — they just aren't flowed through the pr-list concept.

Proposed behavior

Single flat list, no group headers. Sort comparator:

  1. Mine first — pr.author === currentUser.
  2. Then review-requested — currentUser is in pr.reviewRequests.
  3. Then everything else — repo-wide PRs the reviewer is neither author nor reviewer on.
  4. Within each bucket, secondary sort by createdAt descending.

A PR that's both mine and has me as a reviewer counts as mine (sort key 0). Drafts appear in their natural bucket with a (draft) suffix on the title (or a distinct icon overlay — implementer's call as long as it's visible).

Acceptance criteria

  • PrListItem (forge-contracts.ts) gains reviewRequests: string[] and isDraft: boolean.
  • The pr-list forge concept fetches both fields from GitHub and emits them.
  • PROverview (overview.ts:76) carries both fields through to the client.
  • views/pull-requests.ts sorts data.pendingPRs using the comparator above, with data.currentUser as the identity source — no new "me" lookup needed.
  • Drafts are visually distinguishable in the row (badge or icon).
  • No group headers / collapsible sections in the UI — flat sorted list.
  • When currentUser is null (gh unavailable / not authenticated), fall back to a stable createdAt-desc sort and skip the "mine"/"review-requested" partitioning silently.

Out of scope

  • Splitting into multiple expandable sections (intentionally — see proposed behavior).
  • Hiding "other" PRs (intentionally — all PRs remain visible, just sorted last).
  • Notifications when a PR enters the "review-requested" bucket.

Activity

  1. self-assigned this
    on May 21, 2026
  2. added
    type:feature
    area/vscode
    project
    and removed
    type:feature
    on May 21, 2026
  3. amrmelsayed commented on Jun 7, 2026

    @amrmelsayed
    CollaboratorAuthor

    On it! Working on this with the PIR protocol (plan + dev-approval gates before PR).

  4. added 11 commits that reference this issue on Jun 7, 2026
  5. added a commit that references this issue on Jun 9, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

area/vscodeproject

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions