feat(mobile): show PR badge on task list rows (port #2422)#2496
Open
Gilbert09 wants to merge 2 commits into
Open
feat(mobile): show PR badge on task list rows (port #2422)#2496Gilbert09 wants to merge 2 commits into
Gilbert09 wants to merge 2 commits into
Conversation
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
Contributor
Prompt To Fix All With AIFix the following 1 code review issue. Work through them one at a time, proposing concise fixes.
---
### Issue 1 of 1
apps/mobile/src/features/tasks/components/TaskItem.test.tsx:64-90
**Prefer parameterised tests for the "no badge" cases**
The team rule is to prefer parameterised tests. The single "does not show the PR badge when there is no PR url" case only exercises `latest_run: undefined`. Other no-badge paths — `output: null`, a GitHub *issue* URL (`/issues/42`), or a non-GitHub URL — are untested and aren't obviously covered by the parser's own suite. A `it.each` table would cover all of these without duplicating the assertion logic.
Reviews (1): Last reviewed commit: "feat(mobile): show PR badge on task list..." | Re-trigger Greptile |
Covers the additional no-badge paths via it.each: null output, a GitHub issue url (kind !== "pr"), and a non-GitHub url — alongside the no-run case. Generated-By: PostHog Code Task-Id: eb5935b3-fcab-4471-b623-693834c6017e
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Ports desktop PR #2422 (PR badge in the sidebar task list) to the mobile app.
Mobile already showed a PR status badge on the task detail screen, but not on the task list rows. This adds a compact, tappable PR badge to each task row: when a task has a PR url (
latest_run.output.pr_url), the row shows aGitPullRequesticon +#<number>in place of the timestamp, and tapping it opens the PR viaLinking.openURL.Details
TaskItem.tsx: new inlinePrBadge(small pill consistent with mobile styling). The PR number is parsed with the existingparseGithubIssueUrlhelper (@/lib/githubIssueUrl) — no new parser added, and the desktop@posthog/gitparser isn't bundle-compatible (depends on the Node-onlygit-url-parse).Tests
TaskItem.test.tsx: badge shown whenpr_urlpresent (with correct parsed number), hidden when absent.pnpm --filter @posthog/mobile testandbiome checkboth green;tscclean on the changed files.