Skip to content

Reconcile inbox sidebar badge with toolbar headline#2423

Open
rafaeelaudibert wants to merge 3 commits into
mainfrom
posthog-code/inbox-reconcile-counts
Open

Reconcile inbox sidebar badge with toolbar headline#2423
rafaeelaudibert wants to merge 3 commits into
mainfrom
posthog-code/inbox-reconcile-counts

Conversation

@rafaeelaudibert
Copy link
Copy Markdown
Member

@rafaeelaudibert rafaeelaudibert commented May 28, 2026

Summary

The badge next to Inbox in the sidebar and the Reports (N) headline inside the inbox view counted different things, so the numbers routinely disagreed:

  • Sidebar badge — reports assigned to you, status=ready, actionability=immediately_actionable (i.e. things you need to action right now).
  • Toolbar "Reports (N)" — the server's raw total for whatever filters the user has applied (a much wider number).

This PR makes them agree by construction and adds tooltips so the meaning is discoverable.

  • Extract a shared useUpForReviewCount hook (apps/code/src/renderer/features/inbox/hooks/useInboxReports.ts). The sidebar badge and the toolbar headline both call it; React Query dedupes the underlying fetch so the two numbers cannot diverge.
  • Rename the toolbar headline from Reports (N) to Up for review (N) so the semantics match the badge by construction. Tooltip: "Reports assigned to you that are ready and immediately actionable."
  • Move the raw inbox total to a clearer sub-line: "N reports in inbox · M still processing" (or "X of Y match search" when searching), with its own tooltip: "All reports currently in your inbox view, after any status, source, or reviewer filters you have applied."
  • Drop the now-redundant readyCount from the old pipeline-hint sub-line and from SignalsToolbar's prop surface. InboxSignalsTab still computes it locally for the INBOX_VIEWED analytics event.

Test plan

  • Open the inbox with reports across several statuses; confirm sidebar badge value equals the toolbar Up for review (N) headline.
  • Hover the headline and sub-line — verify both tooltips render the explanatory copy.
  • Apply a status / source / reviewer filter; Up for review stays the same; the sub-line reflects the filtered total.
  • Type a search query; sub-line switches to "X of Y match search"; headline unchanged.
  • Pipeline-paused state still appears in the sub-line.
  • Warming-up state (no reports yet) renders without errors.

The badge next to "Inbox" in the sidebar counts reports the current user
needs to action right now (assigned to them, ready, immediately
actionable). The "Reports (N)" headline inside the inbox view was the
server's raw total for the active filter set — a wider, unrelated
number — and the two could disagree by a lot.

- Extract a shared `useUpForReviewCount` hook so both surfaces resolve
  the count from the same React Query cache entry.
- Rename the toolbar headline to "Up for review (N)" so its semantics
  match the badge by construction. The previous "X up for review · Y
  in research pipeline" sub-line went away with it (the headline now
  carries that meaning).
- Move the raw inbox total into a clearer sub-line that says
  "N reports in inbox · M still processing", with the search-active
  variant calling it out as "X of Y match search".
- Add explanatory tooltips on both the headline and the sub-line so
  the distinction is discoverable.


Generated-By: PostHog Code
Task-Id: cd26fe55-9707-4905-9394-e55db22f511c
@greptile-apps
Copy link
Copy Markdown
Contributor

greptile-apps Bot commented May 28, 2026

Prompt To Fix All With AI
Fix the following 1 code review issue. Work through them one at a time, proposing concise fixes.

---

### Issue 1 of 1
apps/code/src/renderer/features/inbox/components/list/SignalsToolbar.tsx:109-110
When `isSearchActive` is `true` the sub-line reads `"X of Y match search"` (or `"X of Y match search · Pipeline paused…"`), but `INBOX_TOTAL_TOOLTIP` still says *"…after any status, source, or reviewer filters you have applied"* — search is neither of those. A user hovering the sub-line during an active search gets tooltip copy that doesn't match what the numbers represent.

```suggestion
const INBOX_TOTAL_TOOLTIP =
  "All reports currently in your inbox view, after any search, status, source, or reviewer filters you have applied.";
```

Reviews (1): Last reviewed commit: "Reconcile inbox sidebar badge with toolb..." | Re-trigger Greptile

Comment thread apps/code/src/renderer/features/inbox/components/list/SignalsToolbar.tsx Outdated
@rafaeelaudibert rafaeelaudibert requested review from a team, Twixes and oliverb123 and removed request for a team May 28, 2026 21:04
The tooltip described the value in terms of where else it appears
("same number shown on the badge next to Inbox in the sidebar"), which
exposes an implementation detail to the user. Describe what the count
*is* and leave the cross-surface coupling for code comments / the PR
description.


Generated-By: PostHog Code
Task-Id: cd26fe55-9707-4905-9394-e55db22f511c
The sub-line shifts to "X of Y match search" while a search query is
active, but the tooltip only listed status / source / reviewer filters.
Add search to the list so the copy stays accurate in that state.

Spotted by Greptile in PR review.


Generated-By: PostHog Code
Task-Id: cd26fe55-9707-4905-9394-e55db22f511c
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.

1 participant