From e670324334589734787d1b4603cd2b823572119f Mon Sep 17 00:00:00 2001 From: Dotta Date: Fri, 6 Mar 2026 09:46:08 -0600 Subject: [PATCH] Adjust recent issue sorting to ignore self-comment bumps --- ui/src/pages/Inbox.tsx | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/ui/src/pages/Inbox.tsx b/ui/src/pages/Inbox.tsx index 71824adc..1ef489d7 100644 --- a/ui/src/pages/Inbox.tsx +++ b/ui/src/pages/Inbox.tsx @@ -144,10 +144,14 @@ function normalizeTimestamp(value: string | Date | null | undefined): number { } function issueLastActivityTimestamp(issue: Issue): number { - return Math.max( - normalizeTimestamp(issue.updatedAt), - normalizeTimestamp(issue.lastExternalCommentAt), - ); + const lastExternalCommentAt = normalizeTimestamp(issue.lastExternalCommentAt); + if (lastExternalCommentAt > 0) return lastExternalCommentAt; + + const updatedAt = normalizeTimestamp(issue.updatedAt); + const myLastTouchAt = normalizeTimestamp(issue.myLastTouchAt); + if (myLastTouchAt > 0 && updatedAt <= myLastTouchAt) return 0; + + return updatedAt; } function readIssueIdFromRun(run: HeartbeatRun): string | null { @@ -386,7 +390,11 @@ export function Inbox() { [issues, dismissed], ); const sortByMostRecentActivity = useCallback( - (a: Issue, b: Issue) => issueLastActivityTimestamp(b) - issueLastActivityTimestamp(a), + (a: Issue, b: Issue) => { + const activityDiff = issueLastActivityTimestamp(b) - issueLastActivityTimestamp(a); + if (activityDiff !== 0) return activityDiff; + return normalizeTimestamp(b.updatedAt) - normalizeTimestamp(a.updatedAt); + }, [], );