@devries-cameron20 / t3code Mirror · read-only / commits / cefb544af3
Fork 0

The best way to control Claude Code, Codex and more from any computer or phone

Mirrored from https://github.com/Camo67/t3code.git

Synced Nov 22, 05:45 UTC

feat(web): celebrate a GitHub star with confetti (#29987)

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>

Theo Browne committed Nov 2, 2026 at 23:26 UTC cefb544af3c98224874419198c0359b652ca3c94
4 files changed +49 -4
apps/web/package.json
+2
@@ -54,6 +54,7 @@
54 "@tiptap/pm": "^3.31.3",
55 "@tiptap/react": "^3.31.3",
56 "@tiptap/starter-kit": "^3.31.3",
57 + "canvas-confetti": "1.9.4",
58 "class-variance-authority": "^0.7.1",
59 "culori": "^4.0.2",
60 "dompurify": "^3.4.16",
@@ -97,6 +98,7 @@
98 "@effect/vitest": "catalog:",
99 "@tailwindcss/vite": "^4.0.0",
100 "@tanstack/router-plugin": "^1.161.0",
101 + "@types/canvas-confetti": "1.9.0",
102 "@types/compression": "^1.8.1",
103 "@types/culori": "^4.0.1",
104 "@types/hast": "^3.0.4",
apps/web/src/components/GitHubStarPrompt.test.ts
+3 -2
@@ -165,11 +165,12 @@ describe("recordPromptSent", () => {
165 vi.unstubAllGlobals();
166 });
167 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 });
169 await (await startSession()).send();
170 click(add.mock.lastCall?.[0].actionProps);
171 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");
174 expect(openExternal).not.toHaveBeenCalled();
175
176 setup({ sent: 5 });
apps/web/src/components/GitHubStarPrompt.tsx
+28 -2
@@ -38,8 +38,17 @@ function showStarPrompt(environmentId: EnvironmentId) {
38 const starInPlace = async () => {
39 toastManager.update(id, { actionProps: { children: "Starring…", disabled: true } });
40 if (await starRepository(environmentId)) {
41 - close();
42 - toastManager.add({ type: "success", title: "Thanks for the star!", timeout: 4_000 });
41 + // Thank them in place: a closing and opening toast would slide under the confetti.
42 + dismiss();
43 + toastManager.update(id, {
44 + type: "success",
45 + title: "Thanks for the star!",
46 + description: "It really helps T3 Code grow.",
47 + timeout: 5_000,
48 + actionProps: undefined,
49 + data: {},
50 + });
51 + celebrate();
52 return;
53 }
54 // Browsers block new tabs once the click's activation expires; desktop opens through its bridge.
@@ -62,6 +71,23 @@ function showStarPrompt(environmentId: EnvironmentId) {
71 });
72 }
73
74 +// One burst out of the toast. The library loads only here, and its canvas stops when done.
75 +function celebrate() {
76 + void import("canvas-confetti")
77 + .then(({ default: confetti }) =>
78 + confetti({
79 + particleCount: 160,
80 + spread: 360,
81 + startVelocity: 38,
82 + gravity: 1.6,
83 + ticks: 140,
84 + origin: { x: 0.83, y: 0.15 },
85 + disableForReducedMotion: true,
86 + }),
87 + )
88 + .catch(() => undefined);
89 +}
90 +
91 // Resolves after IDLE_MS without input while this window has focus.
92 function waitForIdle() {
93 return new Promise<void>((resolve) => {
pnpm-lock.yaml
+16
@@ -1143,6 +1143,9 @@ importers:
1143 '@tiptap/starter-kit':
1144 specifier: ^3.31.3
1145 version: 3.31.3
1146 + canvas-confetti:
1147 + specifier: 1.9.4
1148 + version: 1.9.4
1149 class-variance-authority:
1150 specifier: ^0.7.1
1151 version: 0.7.1
@@ -1267,6 +1270,9 @@ importers:
1270 '@tanstack/router-plugin':
1271 specifier: ^1.161.0
1272 version: 1.168.13(@tanstack/react-router@1.170.10(react-dom@19.3.0(react@19.3.0))(react@19.3.0))(@voidzero-dev/vite-plus-core@1.4.0(@tsc-rs/typescript@0.8.0)(@types/node@24.12.4)(@volar/typescript@2.4.28(@tsc-rs/typescript@0.8.0))(esbuild@0.28.2)(jiti@2.7.0)(terser@5.48.0)(unrun@0.2.39)(yaml@2.9.0))(supports-color@8.1.1)
1273 + '@types/canvas-confetti':
1274 + specifier: 1.9.0
1275 + version: 1.9.0
1276 '@types/compression':
1277 specifier: ^1.8.1
1278 version: 1.8.1
@@ -7008,6 +7014,9 @@ packages:
7014 '@types/cacheable-request@6.0.3':
7015 resolution: {integrity: sha512-IQ3EbTzGxIigb1I3qPZc1rWJnH0BmSKv5QYTalEwweFvyBDLSAe24zP0le/hyi7ecGfZVlIVAg4BZqb8WBwKqw==}
7016
7017 + '@types/canvas-confetti@1.9.0':
7018 + resolution: {integrity: sha512-aBGj/dULrimR1XDZLtG9JwxX1b4HPRF6CX9Yfwh3NvstZEm1ZL7RBnel4keCPSqs1ANRu1u2Aoz9R+VmtjYuTg==}
7019 +
7020 '@types/chai@5.2.3':
7021 resolution: {integrity: sha512-Mw558oeA9fFbv65/y4mHtXDs9bPnFMZAL/jxdPFUpOHHIXX91mcgEHbS5Lahr+pwZFR8A7GQleRWeI6cGFC2UA==}
7022
@@ -7947,6 +7956,9 @@ packages:
7956 caniuse-lite@1.0.30001810:
7957 resolution: {integrity: sha512-TITQPUkaz+aVk5GL6NhOdwk1aEaNTSDPsGFWrTuhKGtjTF70jL/Oht2W4c6rXUe5fu7Ie19VIahAXHIIiWWNeg==}
7958
7959 + canvas-confetti@1.9.4:
7960 + resolution: {integrity: sha512-yxQbJkAVrFXWNbTUjPqjF7G+g6pDotOUHGbkZq2NELZUMDpiJ85rIEazVb8GTaAptNW2miJAXbs1BtioA251Pw==}
7961 +
7962 capnp-es@0.0.16:
7963 resolution: {integrity: sha512-pqhhnRqGfDdgHa+rz4JVO9j1jnkyqsHRYrD4RBtIwxCknYSRG7Mjs+x3IRfd20u+ZGS0IhW2L7cDv9ZcIkCYhQ==}
7964 hasBin: true
@@ -16574,6 +16586,8 @@ snapshots:
16586 '@types/node': 24.12.4
16587 '@types/responselike': 1.0.3
16588
16589 + '@types/canvas-confetti@1.9.0': {}
16590 +
16591 '@types/chai@5.2.3':
16592 dependencies:
16593 '@types/deep-eql': 4.0.2
@@ -17735,6 +17749,8 @@ snapshots:
17749
17750 caniuse-lite@1.0.30001810: {}
17751
17752 + canvas-confetti@1.9.4: {}
17753 +
17754 capnp-es@0.0.16(@tsc-rs/typescript@0.8.0):
17755 optionalDependencies:
17756 typescript: '@tsc-rs/typescript@0.8.0'