Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
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
13 changes: 6 additions & 7 deletions packages/core/src/inbox/engagement.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ describe("buildInboxViewedProperties", () => {
const props = buildInboxViewedProperties({
visibleReports: [fakeReport({ id: "a" }), fakeReport({ id: "b" })],
totalCount: 65,
tabCounts: { pulls: 38, reports: 62, runs: 4 },
tabCounts: { pulls: 38, reports: 62 },
filters: NO_FILTERS,
});

Expand All @@ -47,7 +47,6 @@ describe("buildInboxViewedProperties", () => {
expect(props.ready_count).toBe(2);
expect(props.pulls_count).toBe(38);
expect(props.reports_count).toBe(62);
expect(props.runs_count).toBe(4);
expect(props.is_empty).toBe(false);
expect(props.status_filter_count).toBe(0);
});
Expand All @@ -61,7 +60,7 @@ describe("buildInboxViewedProperties", () => {
fakeReport({ priority: null, actionability: null }),
],
totalCount: 4,
tabCounts: { pulls: 0, reports: 4, runs: 0 },
tabCounts: { pulls: 0, reports: 4 },
filters: NO_FILTERS,
});

Expand All @@ -81,7 +80,7 @@ describe("buildInboxViewedProperties", () => {
fakeReport({ status: "in_progress" }),
],
totalCount: 2,
tabCounts: { pulls: 0, reports: 1, runs: 1 },
tabCounts: { pulls: 0, reports: 1 },
filters: NO_FILTERS,
});

Expand All @@ -92,7 +91,7 @@ describe("buildInboxViewedProperties", () => {
const props = buildInboxViewedProperties({
visibleReports: [],
totalCount: 0,
tabCounts: { pulls: 0, reports: 0, runs: 0 },
tabCounts: { pulls: 0, reports: 0 },
filters: NO_FILTERS,
});

Expand All @@ -109,7 +108,7 @@ describe("buildInboxViewedProperties", () => {
const props = buildInboxViewedProperties({
visibleReports: [fakeReport()],
totalCount: 1,
tabCounts: { pulls: 0, reports: 1, runs: 0 },
tabCounts: { pulls: 0, reports: 1 },
filters: { ...NO_FILTERS, ...partial },
});

Expand All @@ -120,7 +119,7 @@ describe("buildInboxViewedProperties", () => {
const props = buildInboxViewedProperties({
visibleReports: [fakeReport()],
totalCount: 1,
tabCounts: { pulls: 0, reports: 1, runs: 0 },
tabCounts: { pulls: 0, reports: 1 },
filters: { ...NO_FILTERS, searchQuery: " " },
});

Expand Down
3 changes: 1 addition & 2 deletions packages/core/src/inbox/engagement.ts
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ export interface BuildInboxViewedInput {
/** Server-reported total of reports matching the active query — the headline inbox number. */
totalCount: number;
/** Tab badge counts shown in the v2 header (the numbers the user actually sees). */
tabCounts: { pulls: number; reports: number; runs: number };
tabCounts: { pulls: number; reports: number };
Comment thread
Twixes marked this conversation as resolved.
filters: InboxViewedFilterState;
}

Expand Down Expand Up @@ -213,6 +213,5 @@ export function buildInboxViewedProperties(
actionability_unknown_count: actionabilityCounts.unknown,
pulls_count: tabCounts.pulls,
reports_count: tabCounts.reports,
runs_count: tabCounts.runs,
};
}
4 changes: 1 addition & 3 deletions packages/core/src/inbox/reportMembership.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -252,19 +252,17 @@ describe("tabFilters", () => {
expect(computeInboxTabCounts([], "for-you")).toEqual(EMPTY_TAB_COUNTS);
});

it("for-you counts only my queue except runs (runs are always project-wide)", () => {
it("for-you counts only my queue", () => {
expect(computeInboxTabCounts(reports, "for-you")).toEqual({
pulls: 1,
reports: 1,
runs: 2,
});
});

it("entire-project counts the full inbox", () => {
expect(computeInboxTabCounts(reports, "entire-project")).toEqual({
pulls: 2,
reports: 2,
runs: 2,
});
});
});
Expand Down
6 changes: 0 additions & 6 deletions packages/core/src/inbox/reportMembership.ts
Original file line number Diff line number Diff line change
Expand Up @@ -209,13 +209,11 @@ export function matchesReviewerScope(
export interface InboxTabCounts {
pulls: number;
reports: number;
runs: number;
}

export const EMPTY_TAB_COUNTS: InboxTabCounts = {
pulls: 0,
reports: 0,
runs: 0,
};

export function computeInboxTabCounts(
Expand All @@ -225,10 +223,6 @@ export function computeInboxTabCounts(
const counts: InboxTabCounts = { ...EMPTY_TAB_COUNTS };
for (const report of reports) {
if (isExcludedFromInbox(report)) continue;
// Runs count is project-wide: reviewer assignment is an output of
// research, so the For-you / teammate filter is meaningless until a
// report reaches a downstream tab.
if (isAgentRunReport(report)) counts.runs += 1;
if (!matchesReviewerScope(report, scope)) continue;
if (isPullRequestReport(report)) counts.pulls += 1;
if (isReportTabReport(report)) counts.reports += 1;
Expand Down
1 change: 0 additions & 1 deletion packages/shared/src/analytics-events.ts
Original file line number Diff line number Diff line change
Expand Up @@ -551,7 +551,6 @@ export interface InboxViewedProperties {
*/
pulls_count?: number;
reports_count?: number;
runs_count?: number;
}

export interface InboxReportOpenedProperties {
Expand Down
2 changes: 1 addition & 1 deletion packages/ui/src/features/inbox/components/InboxTabBar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ export function InboxTabBar({ counts }: InboxTabBarProps) {
<span className="font-medium text-[13px]">
{INBOX_TAB_LABEL[key]}
</span>
{counts[key] > 0 && (
{key !== "runs" && counts[key] > 0 && (
<span
className={
isActive
Expand Down
3 changes: 1 addition & 2 deletions packages/ui/src/features/inbox/hooks/useInboxAllReports.ts
Original file line number Diff line number Diff line change
Expand Up @@ -150,8 +150,7 @@ export function useInboxAllReports(options?: {
// its true size from the backend total `count` (unaffected by the page cap)
// minus the non-report items the total also includes. PRs use the true
// `pullRequestTotal` (also a real backend count), so PRs sitting past the
// loaded page don't inflate Reports. Runs/failed without a PR stay
// loaded-derived — small, newest-first, and an accepted approximation.
// loaded page don't inflate Reports.
const loadedOtherNonReport = query.allReports.filter(
(r) =>
matchesReviewerScope(r, scope) &&
Expand Down
Loading