Skip to content

Where people and agents ship software together. The open-source git platform for the whole job: issues, agents, checks and deploys to the edge.

Commit

A notification put away in the panel stays away: dismissing several quickly made one come back for a moment and go again. Each card hid itself only while its own Done, Snooze or Move back was in flight; once that settled it showed again until the panel's list reloaded without it, and each further dismissal put that reload off. A card that stepped out now stays out until the list drops it, coming back only if its request failed or the item itself changed. Checked: apps/web tsc -b.

G1t-Session:
ses_01m4zx8827e389s5cwnekp1hzw
syntaqxcommitted Parent5f04e08Browse files
1 file+11−10/1 viewed
+11−1
7373 const fetcher = useFetcher<{ error?: string }>();
7474 const unread = isUnread(item);
7575 const leaving = isPending(fetcher, { id: item.id }) && ["done", "snooze", "undone"].includes(String(fetcher.formData?.get("intent")));
76+ // Once out, it stays out: the list reloads after its request settles, and
77+ // dismissing several quickly keeps putting that reload off. It comes back
78+ // only if the request failed or the item itself changed.
79+ const [left, setLeft] = useState<string | null>(null);
80+ useEffect(() => {
81+ if (leaving) setLeft(item.updatedAt);
82+ }, [leaving, item.updatedAt]);
83+ useEffect(() => {
84+ if (fetcher.state === "idle" && fetcher.data?.error) setLeft(null);
85+ }, [fetcher.state, fetcher.data]);
7686 const [now, setNow] = useState(() => Date.now());
7787 useEffect(() => setNow(Date.now()), [item.updatedAt]);
78− if (leaving) return null;
88+ if (leaving || left === item.updatedAt) return null;
7989
8090 const submit = (intent: string, extra?: Record<string, string>) =>
8191 fetcher.submit({ intent, id: item.id, ...extra }, { method: "post", action: ACTION });

Comments

Sign in to comment.