Commit be54470
committed
Block TemplateInline file generation until "delete existing files" alert resolves
TemplateInline components with generateFile={true} auto-execute on page mount,
which was regenerating files (like .github/workflows/ci.yml) immediately after
the user deleted them. The user would delete files, refresh, and see them
reappear because:
1. Generated files check runs first → finds 0 files → no alert
2. TemplateInline auto-renders → recreates the files
Fix: add a `renderingEnabled` flag to GeneratedFilesContext that starts false
and is only set to true once the generated files check completes and either:
- No existing files were found, or
- The user resolved the alert (clicked "Keep Files" or "Delete Files")
TemplateInline now checks this flag before auto-rendering when generateFile
is true, preventing the race condition where files are regenerated before the
user decides what to do with existing ones.
https://claude.ai/code/session_01Js4Mce3EEoW3Z83kpNuSEC1 parent 707053c commit be54470
File tree
4 files changed
+59
-9
lines changed- web/src
- components/mdx/TemplateInline
- contexts
4 files changed
+59
-9
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
12 | 12 | | |
13 | 13 | | |
14 | 14 | | |
| 15 | + | |
15 | 16 | | |
16 | 17 | | |
17 | 18 | | |
| |||
57 | 58 | | |
58 | 59 | | |
59 | 60 | | |
| 61 | + | |
60 | 62 | | |
61 | 63 | | |
62 | 64 | | |
| |||
124 | 126 | | |
125 | 127 | | |
126 | 128 | | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
127 | 156 | | |
128 | 157 | | |
129 | 158 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
11 | 11 | | |
12 | 12 | | |
13 | 13 | | |
| 14 | + | |
14 | 15 | | |
15 | 16 | | |
16 | 17 | | |
| |||
62 | 63 | | |
63 | 64 | | |
64 | 65 | | |
| 66 | + | |
| 67 | + | |
65 | 68 | | |
66 | 69 | | |
67 | 70 | | |
| |||
203 | 206 | | |
204 | 207 | | |
205 | 208 | | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
206 | 215 | | |
207 | 216 | | |
208 | 217 | | |
209 | 218 | | |
210 | | - | |
| 219 | + | |
211 | 220 | | |
212 | 221 | | |
213 | 222 | | |
| |||
224 | 233 | | |
225 | 234 | | |
226 | 235 | | |
227 | | - | |
| 236 | + | |
228 | 237 | | |
229 | 238 | | |
230 | 239 | | |
231 | | - | |
| 240 | + | |
232 | 241 | | |
233 | 242 | | |
234 | 243 | | |
235 | 244 | | |
236 | | - | |
| 245 | + | |
237 | 246 | | |
238 | 247 | | |
239 | | - | |
| 248 | + | |
240 | 249 | | |
241 | 250 | | |
242 | | - | |
| 251 | + | |
243 | 252 | | |
244 | 253 | | |
245 | 254 | | |
| |||
265 | 274 | | |
266 | 275 | | |
267 | 276 | | |
268 | | - | |
| 277 | + | |
269 | 278 | | |
270 | 279 | | |
271 | 280 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
10 | 10 | | |
11 | 11 | | |
12 | 12 | | |
13 | | - | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
14 | 17 | | |
15 | 18 | | |
16 | 19 | | |
| |||
21 | 24 | | |
22 | 25 | | |
23 | 26 | | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
24 | 31 | | |
25 | | - | |
| 32 | + | |
26 | 33 | | |
27 | 34 | | |
28 | 35 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
9 | 14 | | |
10 | 15 | | |
11 | 16 | | |
0 commit comments