Commit 808dc94
feat(web): show login wall on duplicated chat for askgh (#939)
* feat(web): show login wall when anonymous user sends message on duplicated chat
When EXPERIMENT_ASK_GH_ENABLED is true, anonymous users who duplicate a
public chat and try to send a follow-up message are now shown a login
modal instead of sending the message. After OAuth redirect, the pending
message is automatically restored and submitted.
Also fixes vi.Mock type errors in listCommitsApi.test.ts by importing
Mock type directly from vitest.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
* chore: add CHANGELOG entry for #939
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
* fix(web): mock @sourcebot/shared in utils.test.ts to fix server env error
The test was failing because importing utils.ts transitively pulled in
server-side environment variables via createLogger, which crashes in
the jsdom test environment.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
* refactor(web): move askgh login wall into useCreateNewChatThread hook
Centralizes the login wall logic in the hook so all chat creation entry
points are guarded automatically. This adds the login wall to the
general /chat landing page and removes the duplicate manual logic from
the askgh landing page.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>1 parent 564480d commit 808dc94
File tree
12 files changed
+169
-76
lines changed- packages/web/src
- app
- [domain]
- askgh/[owner]/[repo]
- components
- chat
- [id]
- components
- components
- features
- chat
- components/chatThread
- git
12 files changed
+169
-76
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
14 | 14 | | |
15 | 15 | | |
16 | 16 | | |
| 17 | + | |
17 | 18 | | |
18 | 19 | | |
19 | 20 | | |
| |||
Lines changed: 10 additions & 58 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
8 | | - | |
| 8 | + | |
9 | 9 | | |
10 | 10 | | |
11 | 11 | | |
12 | 12 | | |
13 | | - | |
14 | | - | |
15 | | - | |
16 | | - | |
17 | | - | |
18 | | - | |
19 | | - | |
| 13 | + | |
20 | 14 | | |
21 | 15 | | |
22 | 16 | | |
23 | 17 | | |
24 | 18 | | |
25 | 19 | | |
26 | 20 | | |
27 | | - | |
28 | 21 | | |
29 | 22 | | |
30 | 23 | | |
| |||
34 | 27 | | |
35 | 28 | | |
36 | 29 | | |
37 | | - | |
38 | 30 | | |
39 | 31 | | |
40 | | - | |
41 | | - | |
| 32 | + | |
42 | 33 | | |
43 | | - | |
44 | | - | |
45 | 34 | | |
46 | 35 | | |
47 | 36 | | |
| |||
53 | 42 | | |
54 | 43 | | |
55 | 44 | | |
56 | | - | |
57 | | - | |
58 | | - | |
59 | | - | |
60 | | - | |
61 | | - | |
62 | | - | |
63 | | - | |
64 | | - | |
65 | | - | |
66 | | - | |
67 | | - | |
68 | | - | |
69 | | - | |
70 | | - | |
71 | | - | |
72 | | - | |
73 | | - | |
74 | | - | |
75 | | - | |
76 | | - | |
77 | | - | |
78 | | - | |
79 | | - | |
80 | | - | |
81 | | - | |
82 | | - | |
83 | | - | |
84 | | - | |
85 | | - | |
86 | | - | |
87 | | - | |
88 | | - | |
89 | | - | |
90 | | - | |
91 | | - | |
92 | | - | |
93 | | - | |
94 | | - | |
95 | 45 | | |
96 | 46 | | |
97 | 47 | | |
| |||
119 | 69 | | |
120 | 70 | | |
121 | 71 | | |
122 | | - | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
123 | 75 | | |
124 | 76 | | |
125 | 77 | | |
| |||
155 | 107 | | |
156 | 108 | | |
157 | 109 | | |
158 | | - | |
159 | | - | |
160 | | - | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
161 | 113 | | |
162 | 114 | | |
163 | 115 | | |
164 | 116 | | |
165 | | - | |
| 117 | + | |
Lines changed: 0 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
11 | | - | |
12 | 11 | | |
13 | 12 | | |
14 | 13 | | |
| |||
48 | 47 | | |
49 | 48 | | |
50 | 49 | | |
51 | | - | |
52 | 50 | | |
53 | 51 | | |
54 | 52 | | |
| |||
59 | 57 | | |
60 | 58 | | |
61 | 59 | | |
62 | | - | |
63 | 60 | | |
64 | 61 | | |
65 | 62 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
18 | 18 | | |
19 | 19 | | |
20 | 20 | | |
21 | | - | |
22 | 21 | | |
23 | 22 | | |
24 | 23 | | |
| |||
Lines changed: 12 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
10 | 10 | | |
11 | 11 | | |
12 | 12 | | |
| 13 | + | |
13 | 14 | | |
14 | 15 | | |
15 | 16 | | |
16 | 17 | | |
17 | 18 | | |
| 19 | + | |
18 | 20 | | |
19 | 21 | | |
20 | 22 | | |
21 | 23 | | |
22 | 24 | | |
23 | 25 | | |
| 26 | + | |
24 | 27 | | |
25 | | - | |
| 28 | + | |
26 | 29 | | |
27 | 30 | | |
28 | 31 | | |
| |||
65 | 68 | | |
66 | 69 | | |
67 | 70 | | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
68 | 78 | | |
69 | 79 | | |
70 | | - | |
| 80 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
103 | 103 | | |
104 | 104 | | |
105 | 105 | | |
| 106 | + | |
106 | 107 | | |
107 | 108 | | |
108 | 109 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
981 | 981 | | |
982 | 982 | | |
983 | 983 | | |
| 984 | + | |
| 985 | + | |
| 986 | + | |
| 987 | + | |
| 988 | + | |
| 989 | + | |
| 990 | + | |
| 991 | + | |
| 992 | + | |
| 993 | + | |
984 | 994 | | |
985 | 995 | | |
986 | 996 | | |
| |||
Lines changed: 60 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
28 | 28 | | |
29 | 29 | | |
30 | 30 | | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
31 | 34 | | |
32 | 35 | | |
33 | 36 | | |
34 | 37 | | |
35 | 38 | | |
36 | 39 | | |
| 40 | + | |
| 41 | + | |
37 | 42 | | |
38 | 43 | | |
39 | 44 | | |
| |||
71 | 76 | | |
72 | 77 | | |
73 | 78 | | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
74 | 82 | | |
75 | 83 | | |
76 | 84 | | |
| |||
200 | 208 | | |
201 | 209 | | |
202 | 210 | | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
| 240 | + | |
| 241 | + | |
| 242 | + | |
203 | 243 | | |
204 | 244 | | |
205 | 245 | | |
| |||
287 | 327 | | |
288 | 328 | | |
289 | 329 | | |
290 | | - | |
| 330 | + | |
| 331 | + | |
| 332 | + | |
| 333 | + | |
| 334 | + | |
| 335 | + | |
| 336 | + | |
| 337 | + | |
| 338 | + | |
| 339 | + | |
| 340 | + | |
| 341 | + | |
291 | 342 | | |
292 | 343 | | |
293 | 344 | | |
| |||
297 | 348 | | |
298 | 349 | | |
299 | 350 | | |
300 | | - | |
| 351 | + | |
301 | 352 | | |
302 | 353 | | |
303 | 354 | | |
| |||
449 | 500 | | |
450 | 501 | | |
451 | 502 | | |
| 503 | + | |
| 504 | + | |
| 505 | + | |
| 506 | + | |
| 507 | + | |
| 508 | + | |
| 509 | + | |
452 | 510 | | |
453 | 511 | | |
454 | 512 | | |
0 commit comments