Skip to content

Commit ddedee6

Browse files
fix(mobile): render neutral linked PR counts in both lists
1 parent 89e916c commit ddedee6

3 files changed

Lines changed: 4 additions & 9 deletions

File tree

‎apps/mobile/src/features/threads/thread-list-items.tsx‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,11 +44,11 @@ export const THREAD_LIST_COMPACT_INSET = HOME_HORIZONTAL_INSET;
4444
const SIDEBAR_ROW_RADIUS = 12;
4545

4646
function pullRequestTintColor(
47-
pr: Pick<ThreadPrPresentation, "state" | "isDraft">,
47+
pr: Pick<ThreadPrPresentation, "state" | "isDraft" | "others">,
4848
colorScheme: "light" | "dark",
4949
) {
5050
const dark = colorScheme === "dark";
51-
if (pr.state === "open" && pr.isDraft === true) {
51+
if (pr.others > 0 || (pr.state === "open" && pr.isDraft === true)) {
5252
return dark ? "#a1a1aa" : "#71717a";
5353
}
5454
switch (pr.state) {

‎apps/mobile/src/features/threads/thread-list-v2-items.tsx‎

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -880,13 +880,7 @@ export const ThreadListV2Row = memo(function ThreadListV2Row(props: {
880880
? materialYouStyleLayoutActive
881881
? "accent-thread-selected-foreground"
882882
: "accent-user-bubble-foreground"
883-
: pr.kind === "stack" || pr.isDraft || pr.state === null
884-
? "accent-foreground-muted"
885-
: pr.state === "open"
886-
? "accent-adaptive-emerald-600-400"
887-
: pr.state === "merged"
888-
? "accent-adaptive-violet-600-400"
889-
: "accent-foreground-muted"
883+
: "accent-foreground-muted"
890884
}
891885
/>
892886
) : null}

‎apps/mobile/src/state/use-thread-pr.test.ts‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,7 @@ describe("presentThreadLinkedPullRequests", () => {
8888
expect(presentThreadLinkedPullRequests([linkedPr(1), linkedPr(2)])).toMatchObject({
8989
kind: "pull-request",
9090
label: "+2",
91+
others: 1,
9192
textClassName: "text-foreground-muted",
9293
});
9394
});

0 commit comments

Comments
 (0)