Skip to content

feat: Add PR badge to sidebar task list#2422

Merged
charlesvien merged 2 commits into
mainfrom
posthog-code/sidebar-pr-badge
Jun 5, 2026
Merged

feat: Add PR badge to sidebar task list#2422
charlesvien merged 2 commits into
mainfrom
posthog-code/sidebar-pr-badge

Conversation

@rafaeelaudibert
Copy link
Copy Markdown
Member

Summary

  • Adds a small clickable PR badge to the right of each task in the sidebar that has a linked pull request.
  • The badge shows #NNN when a PR number can be extracted from the URL (GitHub / GitLab / Bitbucket URL shapes) and falls back to PR otherwise. Clicking opens the PR externally via openUrlInBrowser.
  • Sourced from the existing TaskData.cloudPrUrl field — no new fetches or schema changes.

Test plan

  • Open the app with at least one task that has a latest_run.output.pr_url set; confirm the badge appears on the right of the row.
  • Click the badge — the PR opens in the system browser and the row itself does not get selected.
  • Hover the row — the pin/archive toolbar still appears; the badge remains visible.
  • Confirm tasks without a PR URL show no badge.
  • Verify keyboard activation (Enter / Space) on the badge opens the PR.

@rafaeelaudibert rafaeelaudibert requested a review from a team May 28, 2026 20:48
@charlesvien
Copy link
Copy Markdown
Member

useful

@greptile-apps
Copy link
Copy Markdown
Contributor

greptile-apps Bot commented May 28, 2026

Reviews (1): Last reviewed commit: "Add PR badge to sidebar task list" | Re-trigger Greptile

Tasks in the sidebar with a linked pull request now show a small clickable badge on the right side of the row. The badge displays the PR number (e.g. `#123`) when it can be extracted from the URL and falls back to `PR` otherwise; clicking it opens the PR in the user's browser via `openUrlInBrowser`. The URL is sourced from the existing `TaskData.cloudPrUrl` field (populated from `task.latest_run.output.pr_url`), so no new data plumbing is needed.

Generated-By: PostHog Code
Task-Id: ba55cf1b-c69e-4b32-b689-9a00d3831b64
@charlesvien charlesvien force-pushed the posthog-code/sidebar-pr-badge branch from c81ac40 to 73d7389 Compare June 4, 2026 23:42
@charlesvien charlesvien force-pushed the posthog-code/sidebar-pr-badge branch from b35bbe8 to 74e293d Compare June 5, 2026 00:06
@charlesvien charlesvien changed the title Add PR badge to sidebar task list feat: Add PR badge to sidebar task list Jun 5, 2026
@charlesvien charlesvien merged commit 3f1cc9f into main Jun 5, 2026
18 checks passed
@charlesvien charlesvien deleted the posthog-code/sidebar-pr-badge branch June 5, 2026 00:15
Gilbert09 added a commit that referenced this pull request Jun 5, 2026
Adds a compact pull-request badge to each task row in the mobile task list,
mirroring the desktop sidebar behavior (#2422). When a task has a PR url
(`latest_run.output.pr_url`), the badge shows the PR number and opens the PR
on tap, taking the timestamp's slot.

Reuses the existing `parseGithubIssueUrl` helper to extract the PR number.

Generated-By: PostHog Code
Task-Id: eb5935b3-fcab-4471-b623-693834c6017e
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.

2 participants