Skip to content

Commit 8e71546

Browse files
committed
fix(webapp): wake toast and unread dot show with the panel open too
The poll only ran while the panel was closed, so a wake in any chat other than the visible one announced nothing until the panel closed.
1 parent a3faea8 commit 8e71546

1 file changed

Lines changed: 6 additions & 6 deletions

File tree

apps/webapp/app/components/dashboard-agent/DashboardAgent.tsx

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -144,12 +144,12 @@ export function DashboardAgent({
144144
setWatchRequest((current) => ({ spec, seq: (current?.seq ?? 0) + 1 }));
145145
}, []);
146146

147-
// The dot's poll, and the toast's. Runs only while the panel is CLOSED — an
148-
// open panel shows the wake in the transcript, so polling then would only race
149-
// the read marker. Both the interval and the on-close refresh come from this
150-
// effect re-running on `open`.
147+
// The dot's poll, and the toast's. Runs whether the panel is open or not: a
148+
// wake in a chat that isn't on screen (another chat open, or none) must
149+
// announce itself either way. `toastedWakes` keeps a wake that streamed into
150+
// the visible transcript from toasting twice across polls.
151151
useEffect(() => {
152-
if (!hasAccess || open) return;
152+
if (!hasAccess) return;
153153

154154
let cancelled = false;
155155
const load = async () => {
@@ -184,7 +184,7 @@ export function DashboardAgent({
184184
cancelled = true;
185185
window.clearInterval(interval);
186186
};
187-
}, [hasAccess, open, actionPath, setPanelOpen, openChat]);
187+
}, [hasAccess, actionPath, setPanelOpen, openChat]);
188188

189189
// A chat the user is now looking at has no unread wakes. Zeroes the dot right
190190
// away (the poll restores the truth on close if another chat still has one) and

0 commit comments

Comments
 (0)