Repository navigation
Commit 24d3853
fix(autoblog): server-owned in-flight state replaces flaky client poller
The Previews section gave four different inconsistent experiences after
clicking Generate: the "~60–90s" promise was wrong, the 5-min client
poller would give up and tell users to refresh manually, the page itself
showed no in-flight indicator while the worker was running, and a
silent generation failure left the section stuck on "No previews yet"
with no signal anything had happened.
Move ownership of the in-flight state from the client poller to the
page itself:
- page queries lx_keyword for status='generating' and renders a third
state in the amber section: "⏳ N generating now" with the keyword
name and a generating badge
- new AutoblogAutoRefresh client component calls router.refresh() every
8s while inFlightCount > 0 and stops cleanly when it hits zero, so
the preview link appears on its own
- generateArticleNow drops the 5-min waitForNewArticle poller — POST,
refresh once, let the page take over
- empty-state copy now says "1–3 minutes" to match the worker's real
ballpark (LLM + image + embeddings)
- /api/lx/articles/latest deleted; no callers remain
Silent generation failures still aren't surfaced (they need
lx_keyword.updated_at + last_error to filter by recency and show the
reason) — held that for a follow-up to keep this change focused.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>1 parent c6ec186 commit 24d3853
4 files changed
Lines changed: 86 additions & 139 deletions
File tree
- app
- (app)/projects/[id]/autoblog
- api/lx/articles/latest
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
14 | 14 | | |
15 | 15 | | |
16 | 16 | | |
17 | | - | |
18 | | - | |
19 | | - | |
20 | | - | |
21 | | - | |
22 | | - | |
23 | | - | |
24 | | - | |
25 | | - | |
26 | | - | |
27 | | - | |
28 | | - | |
29 | | - | |
30 | | - | |
31 | | - | |
32 | | - | |
33 | | - | |
34 | | - | |
35 | | - | |
36 | | - | |
37 | | - | |
38 | | - | |
39 | | - | |
40 | | - | |
41 | | - | |
42 | | - | |
43 | | - | |
44 | | - | |
45 | | - | |
46 | | - | |
47 | | - | |
48 | | - | |
49 | | - | |
50 | | - | |
51 | 17 | | |
52 | 18 | | |
53 | 19 | | |
| |||
79 | 45 | | |
80 | 46 | | |
81 | 47 | | |
82 | | - | |
| 48 | + | |
83 | 49 | | |
84 | | - | |
85 | 50 | | |
86 | 51 | | |
87 | 52 | | |
| 53 | + | |
88 | 54 | | |
89 | | - | |
90 | | - | |
91 | 55 | | |
92 | 56 | | |
93 | 57 | | |
94 | | - | |
95 | | - | |
96 | | - | |
97 | | - | |
98 | | - | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
99 | 66 | | |
100 | | - | |
101 | | - | |
102 | | - | |
103 | | - | |
104 | | - | |
105 | | - | |
106 | | - | |
107 | | - | |
108 | | - | |
109 | | - | |
110 | | - | |
111 | | - | |
112 | | - | |
113 | | - | |
114 | | - | |
| 67 | + | |
115 | 68 | | |
116 | 69 | | |
117 | 70 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
| 9 | + | |
9 | 10 | | |
10 | 11 | | |
11 | 12 | | |
| |||
89 | 90 | | |
90 | 91 | | |
91 | 92 | | |
| 93 | + | |
92 | 94 | | |
93 | 95 | | |
94 | 96 | | |
| |||
128 | 130 | | |
129 | 131 | | |
130 | 132 | | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
131 | 145 | | |
| 146 | + | |
132 | 147 | | |
133 | 148 | | |
134 | 149 | | |
| |||
193 | 208 | | |
194 | 209 | | |
195 | 210 | | |
196 | | - | |
197 | | - | |
198 | | - | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
199 | 218 | | |
200 | 219 | | |
201 | 220 | | |
202 | 221 | | |
203 | | - | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
204 | 225 | | |
205 | 226 | | |
206 | 227 | | |
| |||
223 | 244 | | |
224 | 245 | | |
225 | 246 | | |
| 247 | + | |
| 248 | + | |
| 249 | + | |
| 250 | + | |
| 251 | + | |
| 252 | + | |
| 253 | + | |
| 254 | + | |
| 255 | + | |
| 256 | + | |
| 257 | + | |
| 258 | + | |
| 259 | + | |
| 260 | + | |
| 261 | + | |
| 262 | + | |
| 263 | + | |
| 264 | + | |
| 265 | + | |
| 266 | + | |
| 267 | + | |
| 268 | + | |
| 269 | + | |
| 270 | + | |
226 | 271 | | |
227 | 272 | | |
228 | 273 | | |
229 | 274 | | |
230 | | - | |
231 | | - | |
| 275 | + | |
| 276 | + | |
232 | 277 | | |
233 | 278 | | |
234 | 279 | | |
| |||
This file was deleted.
0 commit comments