Skip to content

Commit e10344c

Browse files
t3dotggclaude
andcommitted
feat(web): thank stargazers in place so the confetti has no toast slide
Co-Authored-By: Claude Opus 5.5 <[email protected]>
1 parent 914c659 commit e10344c

2 files changed

Lines changed: 8 additions & 4 deletions

File tree

‎apps/web/src/components/GitHubStarPrompt.test.ts‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -165,11 +165,12 @@ describe("recordPromptSent", () => {
165165
vi.unstubAllGlobals();
166166
});
167167
it("stars on click, opens GitHub when starring fails, and asks for a click once the click expired", async () => {
168-
setup({ sent: 5 });
168+
const store = setup({ sent: 5 });
169169
await (await startSession()).send();
170170
click(add.mock.lastCall?.[0].actionProps);
171171
await vi.advanceTimersByTimeAsync(0);
172-
expect(add.mock.lastCall?.[0].title).toBe("Thanks for the star!");
172+
expect(update.mock.lastCall?.[1]).toMatchObject({ title: "Thanks for the star!" });
173+
expect(store.get("t3code:github-star-prompt:dismissed")).toBe("true");
173174
expect(openExternal).not.toHaveBeenCalled();
174175

175176
setup({ sent: 5 });

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

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,12 +38,15 @@ function showStarPrompt(environmentId: EnvironmentId) {
3838
const starInPlace = async () => {
3939
toastManager.update(id, { actionProps: { children: "Starring…", disabled: true } });
4040
if (await starRepository(environmentId)) {
41-
close();
42-
toastManager.add({
41+
// Thank them in place: a closing and opening toast would slide under the confetti.
42+
dismiss();
43+
toastManager.update(id, {
4344
type: "success",
4445
title: "Thanks for the star!",
4546
description: "It really helps T3 Code grow.",
4647
timeout: 5_000,
48+
actionProps: undefined,
49+
data: {},
4750
});
4851
celebrate();
4952
return;

0 commit comments

Comments
 (0)