Skip to content

Shared task board where people and AI coding agents work as teammates. Source-available, self-hostable.

Go

perf(inbox): warm the Snoozed and Archived tabs before they open (MUL-10056) (#11401)

Jiayuan Zhang5af69f2ecd52
diff --git a/packages/core/api/schemas.test.ts b/packages/core/api/schemas.test.ts
index 9166f2b460..f185da12f8 100644
--- a/packages/core/api/schemas.test.ts
+++ b/packages/core/api/schemas.test.ts
@@ -1590,6 +1590,24 @@ describe("SnoozedInboxListSchema", () => {
);
expect(parsed.map((item) => item.issue_identifier)).toEqual([undefined, null, "MUL-3"]);
});
+
+ it("keeps a row whose issue title or status is missing or unusable", () => {
+ const parsed = parseWithFallback(
+ [
+ row(),
+ row({ issue_id: "issue-2", issue_title: 7, issue_status: "" }),
+ row({ issue_id: "issue-3", issue_title: "Fix login", issue_status: "in_review" }),
+ ],
+ SnoozedInboxListSchema,
+ EMPTY_SNOOZED_INBOX,
+ ENDPOINT,
+ );
+ expect(parsed.map((item) => [item.issue_title, item.issue_status])).toEqual([
+ [undefined, undefined],
+ [null, null],
+ ["Fix login", "in_review"],
+ ]);
+ });
});
describe("InboxItemListSchema", () => {
diff --git a/packages/core/api/schemas.ts b/packages/core/api/schemas.ts
index 9167e7620c..fdc6c9ce9a 100644
--- a/packages/core/api/schemas.ts
+++ b/packages/core/api/schemas.ts
@@ -3469,6 +3469,9 @@ export const SnoozedInboxListSchema = z.array(
issue_id: z.string(),
// Older servers omit it; the row then links by issue_id.
issue_identifier: z.string().min(1).nullish().catch(null),
+ // Older servers omit them; the row then fetches the issue.
+ issue_title: z.string().nullish().catch(null),
+ issue_status: z.string().min(1).nullish().catch(null),
item_id: z.string(),
snoozed_until: z.string(),
snoozed_at: z.string(),
diff --git a/packages/core/types/inbox.ts b/packages/core/types/inbox.ts
index dbc3cb86ed..2f5ef23653 100644
--- a/packages/core/types/inbox.ts
+++ b/packages/core/types/inbox.ts
@@ -119,6 +119,9 @@ export interface SnoozedInboxIssue {
issue_id: string;
/** The issue's identifier (MUL-123) to link to; absent from older servers. */
issue_identifier?: string | null;
+ /** The issue's title and status; absent from older servers, which leave the row to fetch the issue. */
+ issue_title?: string | null;
+ issue_status?: IssueStatus | null;
/** The issue's newest notification: the id the snooze endpoints take. */
item_id: string;
snoozed_until: string;
diff --git a/packages/views/inbox/components/inbox-page.tsx b/packages/views/inbox/components/inbox-page.tsx
index c03e2461b4..197b425ba3 100644
--- a/packages/views/inbox/components/inbox-page.tsx
+++ b/packages/views/inbox/components/inbox-page.tsx
@@ -103,7 +103,7 @@ import { inboxTabFromParam, inboxTabHref, type InboxTab, type InboxView } from "
import { InboxTabs } from "./inbox-tabs";
import { InboxArchivedBar } from "./inbox-bar";
import { SnoozedInboxList } from "./snoozed-inbox-list";
-import { useArchivedInboxRows, useSnoozedInboxRows } from "./use-inbox-tab-rows";
+import { useArchivedInboxRows, useInboxTabPrefetch, useSnoozedInboxRows } from "./use-inbox-tab-rows";
import { useTypeLabels } from "./inbox-detail-label";
import {
getInboxDisplayTitle,
@@ -192,12 +192,14 @@ export function InboxPage() {
const items = useMemo(() => deduplicateInboxItems(rawItems), [rawItems]);
// The filters read every notification of an issue, not just its newest.
const activeRows = useMemo(() => rawItems.filter((item) => !item.archived), [rawItems]);
+ const archived = useArchivedInboxRows(wsId, isArchivedView);
const {
query: archiveQuery,
items: archivedItems,
filters: archiveFilters,
issueFieldsSupport: archiveIssueFields,
- } = useArchivedInboxRows(wsId, isArchivedView);
+ } = archived;
+ const prefetchTab = useInboxTabPrefetch(wsId, archived);
const fetchNextArchivedPage = archiveQuery.fetchNextPage;
const loadNextArchivedPage = useCallback(() => { void fetchNextArchivedPage(); }, [fetchNextArchivedPage]);
const archivedLoading = archiveQuery.isLoading;
@@ -870,6 +872,7 @@ export function InboxPage() {
<InboxTabs
tab={tab}
onSelect={setTab}
+ onPrefetch={prefetchTab}
unread={unreadCount}
snoozed={snoozed.rows.length}
size="page"
diff --git a/packages/views/inbox/components/inbox-tabs.tsx b/packages/views/inbox/components/inbox-tabs.tsx
index 736ec32f7f..a44486eab6 100644
--- a/packages/views/inbox/components/inbox-tabs.tsx
+++ b/packages/views/inbox/components/inbox-tabs.tsx
@@ -33,6 +33,7 @@ const TAB_ICONS: Record<InboxTab, typeof Inbox> = {
export function InboxTabs({
tab,
onSelect,
+ onPrefetch,
unread,
snoozed,
expanded,
@@ -41,6 +42,8 @@ export function InboxTabs({
}: {
tab: InboxTab;
onSelect: (tab: InboxTab) => void;
+ /** Called when a tab is pointed at or focused, so its list can load before the click. */
+ onPrefetch?: (tab: InboxTab) => void;
/** Left out (or 0) to show no count. */
unread?: number;
snoozed?: number;
@@ -104,6 +107,8 @@ export function InboxTabs({
aria-expanded={active ? expanded : undefined}
tabIndex={active ? 0 : -1}
onClick={() => onSelect(id)}
+ onPointerEnter={onPrefetch && !active ? () => onPrefetch(id) : undefined}
+ onFocus={onPrefetch && !active ? () => onPrefetch(id) : undefined}
className={cn(
"flex items-center rounded-md outline-none transition-colors focus-visible:outline-2 focus-visible:outline-solid focus-visible:outline-ring",
section ? "relative h-5 px-1" : "h-7 gap-1 px-2",
diff --git a/packages/views/inbox/components/snoozed-inbox-list.tsx b/packages/views/inbox/components/snoozed-inbox-list.tsx
index 8ac69c33ca..f6dcae2039 100644
--- a/packages/views/inbox/components/snoozed-inbox-list.tsx
+++ b/packages/views/inbox/components/snoozed-inbox-list.tsx
@@ -65,8 +65,12 @@ function SnoozedInboxRow({
}) {
const { t } = useT("inbox");
const locale = useLocale();
- const { data: issue } = useQuery(issueDetailOptions(wsId, entry.issue_id));
+ // The list carries the title and status; only an older server's leaves the row to fetch the issue.
+ const { data: issue } = useQuery({ ...issueDetailOptions(wsId, entry.issue_id), enabled: !entry.issue_title });
const { categoryOf, colorOf, iconOf } = useIssueStatuses(wsId);
+ const title = issue?.title ?? entry.issue_title;
+ const status = issue?.status ?? entry.issue_status;
+ const identifier = issue?.identifier ?? entry.issue_identifier;
const backAt = t(($) => $.snooze.back_at, { time: formatSnoozeTime(new Date(entry.snoozed_until), new Date(), locale) });
return (
<button
@@ -79,12 +83,12 @@ function SnoozedInboxRow({
)}
>
<span className="flex size-7 shrink-0 items-center justify-center">
- {issue ? (
+ {status ? (
<StatusIcon
- status={issue.status}
- category={categoryOf(issue.status)}
- color={colorOf(issue.status)}
- icon={iconOf(issue.status)}
+ status={status}
+ category={categoryOf(status)}
+ color={colorOf(status)}
+ icon={iconOf(status)}
className="size-4"
/>
) : (
@@ -92,10 +96,10 @@ function SnoozedInboxRow({
)}
</span>
<span className="min-w-0 flex-1">
- {issue ? (
+ {title ? (
<span className="flex min-w-0 items-center gap-2">
- <span className="truncate text-body">{issue.title}</span>
- <span className="shrink-0 text-caption tabular-nums text-muted-foreground">{issue.identifier}</span>
+ <span className="truncate text-body">{title}</span>
+ {identifier && <span className="shrink-0 text-caption tabular-nums text-muted-foreground">{identifier}</span>}
</span>
) : (
<Skeleton className="h-4 w-3/4" />
diff --git a/packages/views/inbox/components/use-inbox-tab-rows.ts b/packages/views/inbox/components/use-inbox-tab-rows.ts
index 699af97cc7..04f80e4d5c 100644
--- a/packages/views/inbox/components/use-inbox-tab-rows.ts
+++ b/packages/views/inbox/components/use-inbox-tab-rows.ts
@@ -1,7 +1,7 @@
"use client";
-import { useMemo, useState } from "react";
-import { useInfiniteQuery, useQuery } from "@tanstack/react-query";
+import { useEffect, useLayoutEffect, useMemo, useRef, useState } from "react";
+import { useInfiniteQuery, useQuery, useQueryClient } from "@tanstack/react-query";
import {
archivedInboxPagesOptions,
deduplicateArchivedInboxItems,
@@ -15,6 +15,7 @@ import {
} from "@multica/core/inbox/filter-store";
import type { SnoozedInboxIssue } from "@multica/core/types";
import { inboxListLoad } from "./use-filtered-inbox-rows";
+import type { InboxTab } from "./inbox-view";
const NO_SNOOZED: SnoozedInboxIssue[] = [];
@@ -46,15 +47,20 @@ export function useSnoozedInboxRows(wsId: string, enabled = true) {
* by the rows it returns: an empty answer proves nothing and must not change
* what is sent, so only rows without them (an older server) make those
* dimensions dormant.
+ *
+ * `prefetch` loads the first page under these same filters while the tab is
+ * closed, so opening it renders from cache.
*/
export function useArchivedInboxRows(wsId: string, enabled = true) {
+ const qc = useQueryClient();
const stored = useInboxFilters(wsId);
const [issueFields, setIssueFields] = useState<InboxFilterSupport>("supported");
const filters = useMemo(
() => effectiveInboxFilters(stored, { priority: "supported", issueFields, archived: true }),
[stored, issueFields],
);
- const query = useInfiniteQuery({ ...archivedInboxPagesOptions(wsId, filters), enabled: enabled && !!wsId });
+ const options = archivedInboxPagesOptions(wsId, filters);
+ const query = useInfiniteQuery({ ...options, enabled: enabled && !!wsId });
const items = useMemo(
() => deduplicateArchivedInboxItems(query.data?.pages.flatMap((page) => page.items) ?? []),
[query.data],
@@ -62,5 +68,42 @@ export function useArchivedInboxRows(wsId: string, enabled = true) {
if (issueFields !== "unsupported" && inboxIssueFieldsSupport(items) === "unsupported") {
setIssueFields("unsupported");
}
- return { query, items, filters, issueFieldsSupport: issueFields };
+ const prefetch = () => {
+ if (wsId) void qc.prefetchInfiniteQuery(options);
+ };
+ return { query, items, filters, issueFieldsSupport: issueFields, prefetch };
+}
+
+/**
+ * Warms the Snoozed and Archived tabs so a switch renders from cache: once
+ * the workspace is idle, and again when a tab is pointed at or focused.
+ *
+ * A prefetch adds no observer, so an inbox event only marks the warmed lists
+ * stale rather than refetching them; the tab refreshes once it opens.
+ */
+export function useInboxTabPrefetch(wsId: string, archived: { prefetch: () => void }) {
+ const qc = useQueryClient();
+ const prefetchTab = (tab: InboxTab) => {
+ if (!wsId) return;
+ if (tab === "archived") archived.prefetch();
+ else if (tab === "snoozed") void qc.prefetchQuery(snoozedInboxOptions(wsId));
+ };
+ const latest = useRef(prefetchTab);
+ useLayoutEffect(() => {
+ latest.current = prefetchTab;
+ });
+ useEffect(() => {
+ if (!wsId) return;
+ const warm = () => {
+ latest.current("snoozed");
+ latest.current("archived");
+ };
+ if (typeof window.requestIdleCallback === "function") {
+ const id = window.requestIdleCallback(warm, { timeout: 3000 });
+ return () => window.cancelIdleCallback(id);
+ }
+ const timer = window.setTimeout(warm, 1500);
+ return () => window.clearTimeout(timer);
+ }, [wsId]);
+ return prefetchTab;
}
diff --git a/packages/views/layout/panels/inbox-section.test.tsx b/packages/views/layout/panels/inbox-section.test.tsx
index 2286d22ad0..c281cb260a 100644
--- a/packages/views/layout/panels/inbox-section.test.tsx
+++ b/packages/views/layout/panels/inbox-section.test.tsx
@@ -14,7 +14,7 @@ import { useInboxSelectionStore } from "@multica/core/inbox/selection-store";
import { agentTaskSnapshotOptions } from "@multica/core/agents";
import type { Agent, AgentTask, InboxItem, SnoozedInboxIssue } from "@multica/core/types";
import { agentListOptions } from "@multica/core/workspace/queries";
-import { snoozedInboxOptions } from "@multica/core/inbox/queries";
+import { inboxKeys, snoozedInboxOptions } from "@multica/core/inbox/queries";
import { renderWithI18n } from "../../test/i18n";
import { NavigationProvider, type NavigationAdapter } from "../../navigation";
import { PanelBody } from "../panel-nav";
@@ -37,7 +37,7 @@ const state = vi.hoisted(() => ({
unsnooze: vi.fn(() => Promise.resolve()),
}));
-const apiMock = vi.hoisted(() => ({ listInbox: vi.fn(), listArchivedInboxPage: vi.fn() }));
+const apiMock = vi.hoisted(() => ({ listInbox: vi.fn(), listArchivedInboxPage: vi.fn(), getIssue: vi.fn() }));
vi.mock("@multica/core/api", async (importOriginal) => ({
...(await importOriginal<typeof import("@multica/core/api")>()),
api: apiMock,
@@ -192,6 +192,10 @@ beforeEach(() => {
]) {
spy.mockReset();
}
+ // The section warms the archive while it is closed.
+ apiMock.listArchivedInboxPage.mockReset();
+ apiMock.listArchivedInboxPage.mockResolvedValue({ items: [], nextCursor: null, hasMore: false });
+ apiMock.getIssue.mockReset();
// Rows with the actor line; the compact default has tests of its own.
useSidebarTreeStore.setState({ inboxCollapsed: false, inboxSettings: { ...DEFAULT_SIDEBAR_INBOX_SETTINGS, compact: false } });
useInboxFilterStore.getState().clearFilters("ws-1");
@@ -799,6 +803,72 @@ describe("InboxSection", () => {
expect(state.unsnooze).toHaveBeenCalledWith(expect.objectContaining({ id: "z1" }));
});
+ it("shows a snoozed issue's title and status from the list without fetching the issue", async () => {
+ renderSection([item({ id: "n1", issue_id: "issue-a" })], null, "/acme/issues", [], [
+ {
+ issue_id: "issue-z",
+ issue_identifier: "MUL-26",
+ issue_title: "Ship the release notes",
+ issue_status: "todo",
+ item_id: "z1",
+ snoozed_until: "2099-01-01T09:00:00Z",
+ snoozed_at: "2026-11-10T09:00:00Z",
+ updates: 0,
+ },
+ ]);
+
+ fireEvent.click(screen.getByRole("tab", { name: /^Snoozed/ }));
+ expect(await screen.findByRole("link", { name: /^Ship the release notes/ })).toBeInTheDocument();
+ expect(document.querySelector('[data-inbox-snoozed-row] [data-mc="status-icon"]')).not.toBeNull();
+ expect(apiMock.getIssue).not.toHaveBeenCalled();
+ });
+
+ it("loads the archive when its tab is pointed at, so the click renders from cache", async () => {
+ apiMock.listArchivedInboxPage.mockResolvedValue({
+ items: [item({ id: "a1", issue_id: "issue-x", title: "Done with this", archived: true })],
+ nextCursor: null,
+ hasMore: false,
+ });
+ renderSection([item({ id: "n1", issue_id: "issue-a" })]);
+
+ const tab = screen.getByRole("tab", { name: /^Archived/ });
+ fireEvent.pointerEnter(tab);
+ await waitFor(() => expect(apiMock.listArchivedInboxPage).toHaveBeenCalledOnce());
+ // Settled before the click: the tab opens on its rows with no request of its own.
+ await act(() => Promise.resolve());
+ fireEvent.click(tab);
+ expect(await screen.findByRole("link", { name: /^Done with this/ })).toBeInTheDocument();
+ expect(apiMock.listArchivedInboxPage).toHaveBeenCalledOnce();
+ });
+
+ it("warms the archive once idle, and an inbox event only marks it stale until it opens", async () => {
+ apiMock.listArchivedInboxPage.mockResolvedValueOnce({
+ items: [item({ id: "a1", issue_id: "issue-x", title: "Done with this", archived: true })],
+ nextCursor: null,
+ hasMore: false,
+ });
+ apiMock.listArchivedInboxPage.mockReturnValue(new Promise(() => {}));
+ vi.useFakeTimers({ toFake: ["setTimeout", "clearTimeout"] });
+ let client: QueryClient;
+ try {
+ ({ client } = renderSection([item({ id: "n1", issue_id: "issue-a" })]));
+ expect(apiMock.listArchivedInboxPage).not.toHaveBeenCalled();
+ await act(async () => {
+ vi.advanceTimersByTime(1500);
+ });
+ } finally {
+ vi.useRealTimers();
+ }
+ await waitFor(() => expect(apiMock.listArchivedInboxPage).toHaveBeenCalledOnce());
+ await act(() => client.invalidateQueries({ queryKey: inboxKeys.archived("ws-1") }));
+ expect(apiMock.listArchivedInboxPage).toHaveBeenCalledOnce();
+
+ // Opening it shows the warmed rows while the refresh is still out.
+ fireEvent.click(screen.getByRole("tab", { name: /^Archived/ }));
+ expect(await screen.findByRole("link", { name: /^Done with this/ })).toBeInTheDocument();
+ expect(apiMock.listArchivedInboxPage).toHaveBeenCalledTimes(2);
+ });
+
it("swaps the lists at once with reduced motion", () => {
useAppearanceStore.getState().set({ reduceMotion: true });
renderSection([item({ id: "n1", issue_id: "issue-a" })], null, "/acme/issues", [], [
diff --git a/packages/views/layout/panels/inbox-section.tsx b/packages/views/layout/panels/inbox-section.tsx
index dfa9e3dc42..5352e6cca7 100644
--- a/packages/views/layout/panels/inbox-section.tsx
+++ b/packages/views/layout/panels/inbox-section.tsx
@@ -51,7 +51,11 @@ import { InboxContextMenuProvider, useInboxContextMenu } from "../../inbox/compo
import type { InboxRowActions } from "../../inbox/components/inbox-item-actions";
import { InboxDeleteDialog } from "../../inbox/components/inbox-delete-dialog";
import { formatSnoozeTime } from "../../inbox/components/inbox-snooze-time";
-import { useArchivedInboxRows, useSnoozedInboxRows } from "../../inbox/components/use-inbox-tab-rows";
+import {
+ useArchivedInboxRows,
+ useInboxTabPrefetch,
+ useSnoozedInboxRows,
+} from "../../inbox/components/use-inbox-tab-rows";
import { useTypeLabels } from "../../inbox/components/inbox-detail-label";
import { InboxActorAvatar, InboxActorLine } from "../../inbox/components/inbox-actor";
import { InboxFilterMenu } from "../../inbox/components/inbox-filter-menu";
@@ -212,6 +216,7 @@ export function InboxSection({
const openRowKey = pageTab === "inbox" ? pageKey : null;
const snoozed = useSnoozedInboxRows(wsId);
const archived = useArchivedInboxRows(wsId, tab === "archived" && !collapsed);
+ const prefetchTab = useInboxTabPrefetch(wsId, archived);
const leaveIfOpen = (item: InboxItem, cleared: LastInboxCleared) => {
const key = inboxRowKey(item);
if (key === openRowKey) leave(key, nextInboxRow(all, key), cleared);
@@ -415,6 +420,7 @@ export function InboxSection({
<InboxTabs
tab={tab}
onSelect={selectTab}
+ onPrefetch={prefetchTab}
unread={showCount ? unread : undefined}
snoozed={snoozed.rows.length}
expanded={!collapsed}
@@ -1365,10 +1371,12 @@ function SnoozedSectionRow({
const { t } = useT("inbox");
const locale = useLocale();
const p = useWorkspacePaths();
- const { data: issue } = useQuery(issueDetailOptions(wsId, entry.issue_id));
+ // The list carries the title and status; only an older server's leaves the row to fetch the issue.
+ const { data: issue } = useQuery({ ...issueDetailOptions(wsId, entry.issue_id), enabled: !entry.issue_title });
const { categoryOf, colorOf, iconOf } = useIssueStatuses(wsId);
const backAt = formatSnoozeTime(new Date(entry.snoozed_until), new Date(), locale);
- const title = issue?.title ?? entry.issue_identifier ?? "";
+ const title = issue?.title ?? entry.issue_title ?? entry.issue_identifier ?? "";
+ const status = issue?.status ?? entry.issue_status;
const unsnoozeLabel = t(($) => $.snooze.unsnooze);
const isPresent = useIsPresent();
const reduceMotion = useReducedMotion();
@@ -1389,12 +1397,12 @@ function SnoozedSectionRow({
>
<div {...panelRowAnchor(active)} className={cn(PANEL_ROW_CLASS, panelRowStateClass(active), "relative")}>
<span aria-hidden className="flex size-3.5 shrink-0">
- {issue && (
+ {status && (
<StatusIcon
- status={issue.status}
- category={categoryOf(issue.status)}
- color={colorOf(issue.status)}
- icon={iconOf(issue.status)}
+ status={status}
+ category={categoryOf(status)}
+ color={colorOf(status)}
+ icon={iconOf(status)}
className="size-3.5"
/>
)}
diff --git a/server/internal/handler/inbox_snooze.go b/server/internal/handler/inbox_snooze.go
index a58cf47680..8f3239f8bd 100644
--- a/server/internal/handler/inbox_snooze.go
+++ b/server/internal/handler/inbox_snooze.go
@@ -18,9 +18,12 @@ type SnoozedInboxResponse struct {
IssueID string `json:"issue_id"`
// The identifier (MUL-123) the row links to; see InboxItemResponse.
IssueIdentifier *string `json:"issue_identifier"`
- ItemID string `json:"item_id"`
- SnoozedUntil string `json:"snoozed_until"`
- SnoozedAt string `json:"snoozed_at"`
+ // The issue's title and status, so the row renders without fetching it.
+ IssueTitle *string `json:"issue_title"`
+ IssueStatus *string `json:"issue_status"`
+ ItemID string `json:"item_id"`
+ SnoozedUntil string `json:"snoozed_until"`
+ SnoozedAt string `json:"snoozed_at"`
// Rows that arrived on the issue while it was snoozed.
Updates int64 `json:"updates"`
}
@@ -64,6 +67,8 @@ func (h *Handler) ListSnoozedInbox(w http.ResponseWriter, r *http.Request) {
resp[i] = SnoozedInboxResponse{
IssueID: uuidToString(row.IssueID),
IssueIdentifier: inboxIssueIdentifier(issuePrefix, row.IssueNumber),
+ IssueTitle: textToPtr(row.IssueTitle),
+ IssueStatus: textToPtr(row.IssueStatus),
ItemID: uuidToString(row.ItemID),
SnoozedUntil: timestampToString(row.SnoozedUntil),
SnoozedAt: timestampToString(row.SnoozedAt),
diff --git a/server/internal/handler/inbox_snooze_test.go b/server/internal/handler/inbox_snooze_test.go
index feca9fea0f..2212447444 100644
--- a/server/internal/handler/inbox_snooze_test.go
+++ b/server/internal/handler/inbox_snooze_test.go
@@ -115,6 +115,9 @@ func TestSnoozeInboxTakesTheWholeIssueOutUntilItsTime(t *testing.T) {
if len(rows) != 1 || rows[0].IssueID != f.issueID || rows[0].ItemID != newest || rows[0].Updates != 0 {
t.Fatalf("snoozed = %+v, want the issue with its newest row and no updates", rows)
}
+ if rows[0].IssueTitle == nil || *rows[0].IssueTitle != "Snoozed issue" || rows[0].IssueStatus == nil || *rows[0].IssueStatus != "todo" {
+ t.Fatalf("snoozed issue title/status = %v/%v, want the issue's own", rows[0].IssueTitle, rows[0].IssueStatus)
+ }
if got, err := time.Parse(time.RFC3339, rows[0].SnoozedUntil); err != nil || !got.Equal(until) {
t.Fatalf("snoozed_until = %q, want %s", rows[0].SnoozedUntil, until)
}
diff --git a/server/pkg/db/generated/inbox.sql.go b/server/pkg/db/generated/inbox.sql.go
index 984f58a68c..f089b7827a 100644
--- a/server/pkg/db/generated/inbox.sql.go
+++ b/server/pkg/db/generated/inbox.sql.go
@@ -1022,7 +1022,9 @@ SELECT g.issue_id::uuid AS issue_id,
g.snoozed_until::timestamptz AS snoozed_until,
g.snoozed_at::timestamptz AS snoozed_at,
g.updates::bigint AS updates,
- iss.number AS issue_number
+ iss.number AS issue_number,
+ iss.title AS issue_title,
+ iss.status AS issue_status
FROM (
SELECT i.issue_id,
max(i.snoozed_until) AS snoozed_until,
@@ -1071,12 +1073,15 @@ type ListSnoozedInboxRow struct {
SnoozedAt pgtype.Timestamptz `json:"snoozed_at"`
Updates int64 `json:"updates"`
IssueNumber pgtype.Int4 `json:"issue_number"`
+ IssueTitle pgtype.Text `json:"issue_title"`
+ IssueStatus pgtype.Text `json:"issue_status"`
}
// The recipient's snoozed issues, soonest back first (MUL-9333). `updates` is
// how many rows arrived while snoozed; `item_id` is the issue's newest row,
// the one the snooze endpoints take. `issue_number` builds the identifier the
-// row links to.
+// row links to; `issue_title` and `issue_status` let the row render without
+// fetching each issue (MUL-10056).
func (q *Queries) ListSnoozedInbox(ctx context.Context, arg ListSnoozedInboxParams) ([]ListSnoozedInboxRow, error) {
rows, err := q.db.Query(ctx, listSnoozedInbox, arg.WorkspaceID, arg.RecipientID, arg.HiddenProjectIds)
if err != nil {
@@ -1093,6 +1098,8 @@ func (q *Queries) ListSnoozedInbox(ctx context.Context, arg ListSnoozedInboxPara
&i.SnoozedAt,
&i.Updates,
&i.IssueNumber,
+ &i.IssueTitle,
+ &i.IssueStatus,
); err != nil {
return nil, err
}
diff --git a/server/pkg/db/queries/inbox.sql b/server/pkg/db/queries/inbox.sql
index 78126bc003..8231bd1798 100644
--- a/server/pkg/db/queries/inbox.sql
+++ b/server/pkg/db/queries/inbox.sql
@@ -451,13 +451,16 @@ RETURNING item.*;
-- The recipient's snoozed issues, soonest back first (MUL-9333). `updates` is
-- how many rows arrived while snoozed; `item_id` is the issue's newest row,
-- the one the snooze endpoints take. `issue_number` builds the identifier the
--- row links to.
+-- row links to; `issue_title` and `issue_status` let the row render without
+-- fetching each issue (MUL-10056).
SELECT g.issue_id::uuid AS issue_id,
newest.id AS item_id,
g.snoozed_until::timestamptz AS snoozed_until,
g.snoozed_at::timestamptz AS snoozed_at,
g.updates::bigint AS updates,
- iss.number AS issue_number
+ iss.number AS issue_number,
+ iss.title AS issue_title,
+ iss.status AS issue_status
FROM (
SELECT i.issue_id,
max(i.snoozed_until) AS snoozed_until,