From 2fca87c0ad6b19be9e236a87cffddc041d28828d Mon Sep 17 00:00:00 2001 From: cliffhall Date: Wed, 26 Aug 2026 20:10:55 -0400 Subject: [PATCH] chore(web): record the useProgressToasts return-type exception MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Copilot's second pass accepted every code fix and re-raised one item: useProgressToasts is the only extracted hook that returns nothing, which contradicts #2128's "each hook returns one object" criterion, and the disagreement was recorded nowhere a reader would find it. Its ask was either a result object or an explicit exception. Taking the second: the hook subscribes, shows toasts and unsubscribes, and the only state it owns is toast-id bookkeeping the caller must not see, so `{}` would advertise an API that is not there. The criterion exists to stop a hook handing back a long list of loose values — useTabUiState's twenty-two is the case it was written against, and that one does return a bundled object. Noted in the hook's own doc block (so it reads as a decision rather than an oversight) and on #2128 itself, so the acceptance criteria and the implementation agree. Signed-off-by: cliffhall --- clients/web/src/hooks/useProgressToasts.ts | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/clients/web/src/hooks/useProgressToasts.ts b/clients/web/src/hooks/useProgressToasts.ts index 61258c1e..6fbaf8be 100644 --- a/clients/web/src/hooks/useProgressToasts.ts +++ b/clients/web/src/hooks/useProgressToasts.ts @@ -32,6 +32,13 @@ export type InspectorClientEventSource = Pick< * are the at-a-glance, in-context signal. Toasts are keyed by progress stream * (see `progressToastId`) and replaced per tick, so a chatty server updates one * toast rather than stacking one per tick. + * + * Returns nothing — the recorded exception to #2128's "each hook returns one + * object" criterion, which exists to stop a hook handing back a long list of + * loose values (`useTabUiState`'s twenty-two is the case it was written + * against). This hook subscribes, shows toasts and unsubscribes; the only + * state it owns is toast-id bookkeeping the caller must not see. An empty + * object would advertise an API that is not there. */ export function useProgressToasts( inspectorClient: InspectorClientEventSource | null,