Skip to content
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions ui/src/pages/Inbox.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -960,13 +960,13 @@ export function Inbox() {
items={[
{
value: "mine",
label: "Mine",
label: `Mine (${mineIssues.length})`,
},
{
value: "recent",
label: "Recent",
label: `Recent (${touchedIssues.length})`,
},
{ value: "unread", label: "Unread" },
{ value: "unread", label: `Unread (${unreadTouchedIssues.length})` },
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Counts show (0) during loading

mineIssuesRaw and touchedIssuesRaw both default to [] (lines 586 and 599), so all three counts render as Mine (0), Recent (0), Unread (0) while the queries are in-flight. The tab bar is always rendered before allLoaded is true, so users will briefly see zeros before the real numbers appear. Consider suppressing the count suffix while loading, e.g.:

Suggested change
label: `Mine (${mineIssues.length})`,
},
{
value: "recent",
label: "Recent",
label: `Recent (${touchedIssues.length})`,
},
{ value: "unread", label: "Unread" },
{ value: "unread", label: `Unread (${unreadTouchedIssues.length})` },
label: `Mine${isMineIssuesLoading ? "" : ` (${mineIssues.length})`}`,
Suggested change
label: `Mine (${mineIssues.length})`,
},
{
value: "recent",
label: "Recent",
label: `Recent (${touchedIssues.length})`,
},
{ value: "unread", label: "Unread" },
{ value: "unread", label: `Unread (${unreadTouchedIssues.length})` },
label: `Recent${isTouchedIssuesLoading ? "" : ` (${touchedIssues.length})`}`,
Suggested change
label: `Mine (${mineIssues.length})`,
},
{
value: "recent",
label: "Recent",
label: `Recent (${touchedIssues.length})`,
},
{ value: "unread", label: "Unread" },
{ value: "unread", label: `Unread (${unreadTouchedIssues.length})` },
{ value: "unread", label: `Unread${isTouchedIssuesLoading ? "" : ` (${unreadTouchedIssues.length})`}` },
Prompt To Fix With AI
This is a comment left during a code review.
Path: ui/src/pages/Inbox.tsx
Line: 963-969

Comment:
**Counts show (0) during loading**

`mineIssuesRaw` and `touchedIssuesRaw` both default to `[]` (lines 586 and 599), so all three counts render as `Mine (0)`, `Recent (0)`, `Unread (0)` while the queries are in-flight. The tab bar is always rendered before `allLoaded` is true, so users will briefly see zeros before the real numbers appear. Consider suppressing the count suffix while loading, e.g.:

```suggestion
                  label: `Mine${isMineIssuesLoading ? "" : ` (${mineIssues.length})`}`,
```
```suggestion
                  label: `Recent${isTouchedIssuesLoading ? "" : ` (${touchedIssues.length})`}`,
```
```suggestion
                { value: "unread", label: `Unread${isTouchedIssuesLoading ? "" : ` (${unreadTouchedIssues.length})`}` },
```

How can I resolve this? If you propose a fix, please make it concise.

Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed. Now the count is hidden while query is loading, so no more (0) flash. Pushed in 139c62f.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Tab counts only reflect issues, not all rendered items

Each tab actually renders a mixed list via workItemsToRender, which includes approvals, failed runs, and join requests alongside issues (getInboxWorkItems in inbox.ts line 174-200). Specifically, from getApprovalsForTab (line 156):

  • mine and recent tabs receive all approvals
  • unread tab receives all approvals with actionable statuses

So "Mine (5)" could show 5 issues + several approvals + failed runs, meaning the label count does not match the number of items a user actually sees when they click the tab. If the intent is to count only issues, a comment explaining that design decision would help future readers. If the intent is to reflect total visible items, workItemsToRender.length would be the accurate value to use here.

Prompt To Fix With AI
This is a comment left during a code review.
Path: ui/src/pages/Inbox.tsx
Line: 963-969

Comment:
**Tab counts only reflect issues, not all rendered items**

Each tab actually renders a mixed list via `workItemsToRender`, which includes **approvals**, **failed runs**, and **join requests** alongside issues (`getInboxWorkItems` in `inbox.ts` line 174-200). Specifically, from `getApprovalsForTab` (line 156):

- `mine` and `recent` tabs receive **all** approvals
- `unread` tab receives all approvals with actionable statuses

So "Mine (5)" could show 5 issues + several approvals + failed runs, meaning the label count does not match the number of items a user actually sees when they click the tab. If the intent is to count only issues, a comment explaining that design decision would help future readers. If the intent is to reflect total visible items, `workItemsToRender.length` would be the accurate value to use here.

How can I resolve this? If you propose a fix, please make it concise.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch. The counts are intentionally showing issues only, not total rendered items. I added explanation in the PR description for why - basically issues are the main work unit, and approvals/failed runs show on multiple tabs so counting them would inflate numbers without useful signal. Added a code comment too for future readers.

{ value: "all", label: "All" },
]}
/>
Expand Down
Loading