Skip to content

Commit ebf5ab7

Browse files
perf(web): thread notifications compile with the React Compiler
Co-Authored-By: Claude Opus 5.5 <[email protected]>
1 parent 6580831 commit ebf5ab7

2 files changed

Lines changed: 7 additions & 6 deletions

File tree

‎apps/web/reactCompiledFiles.ts‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,4 +29,5 @@ export const REACT_COMPILED_FILES = [
2929
"apps/web/src/browser/ServerBrowserSurface.tsx",
3030
"apps/web/src/assets/assetUrls.ts",
3131
"apps/web/src/components/ui/toggle-group.tsx",
32+
"apps/web/src/components/ThreadNotificationCoordinator.tsx",
3233
] as const;

‎apps/web/src/components/ThreadNotificationCoordinator.tsx‎

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ import {
1313
MessageCircleQuestionIcon,
1414
ShieldQuestionIcon,
1515
} from "lucide-react";
16-
import { useCallback, useEffect, useRef } from "react";
16+
import { useEffect, useRef } from "react";
1717

1818
import { getClientSettings, useClientSettings } from "../hooks/useSettings";
1919
import { useEnvironmentIds } from "../state/environments";
@@ -37,18 +37,18 @@ export function ThreadNotificationCoordinator() {
3737
const pending = useRef(
3838
new Map<string, { environmentId: EnvironmentId; notification: Notification }>(),
3939
);
40-
const onNotification = useCallback((environmentId: EnvironmentId, notification: Notification) => {
40+
const onNotification = (environmentId: EnvironmentId, notification: Notification) => {
4141
pending.current.get(notification.tag)?.notification.close();
4242
pending.current.set(notification.tag, { environmentId, notification });
4343
setNotificationBadge(pending.current.size);
44-
}, []);
44+
};
4545

4646
useEffect(() => {
4747
const activeIds = new Set(environmentIds);
4848
const count = pending.current.size;
49-
for (const [tag, { environmentId, notification }] of pending.current) {
50-
if (activeIds.has(environmentId)) continue;
51-
notification.close();
49+
for (const [tag, entry] of pending.current) {
50+
if (activeIds.has(entry.environmentId)) continue;
51+
entry.notification.close();
5252
pending.current.delete(tag);
5353
}
5454
if (count !== pending.current.size) setNotificationBadge(pending.current.size);

0 commit comments

Comments
 (0)