chore(web): record the useProgressToasts return-type exception
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 <cliff@futurescale.com>
This commit is contained in:
parent
edac58e304
commit
2fca87c0ad
1 changed files with 7 additions and 0 deletions
|
|
@ -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,
|
||||
|
|
|
|||
Loading…
Reference in a new issue