Commit de7df1f
refactor(tables): drive import tray by polling derived from server, not SSE
Import progress no longer holds an SSE connection per importing table. The tray
now derives its importing rows live from the table list (React Query), polled
only while an import is in flight; the table detail page keeps its own
cell-state SSE for grid refresh.
- store holds only client-only state now: optimistic uploads, which terminal
completions to surface this session, canceled ids, menu open — no copied
importStatus/rowsProcessed.
- useWorkspaceImports is the single source: polls via a data-predicate
refetchInterval, derives rows, and fires completion toasts on the
importing -> terminal transition.
- kickoff handlers use startUpload/setUploadPercent/endUpload; the invalidated
list refetch surfaces the server row and polling takes over.
- removes use-hydrate-import-tray + use-import-progress-tracker (folded in).
- trims over-verbose comments across the import paths.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>1 parent 5fa7391 commit de7df1f
11 files changed
Lines changed: 234 additions & 389 deletions
File tree
- apps/sim
- app/workspace/[workspaceId]/tables
- [tableId]/hooks
- components
- import-csv-dialog
- hooks/queries
- lib/table
- stores/table/import-tray
Lines changed: 2 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
236 | 236 | | |
237 | 237 | | |
238 | 238 | | |
239 | | - | |
240 | | - | |
| 239 | + | |
| 240 | + | |
241 | 241 | | |
242 | 242 | | |
243 | 243 | | |
| |||
Lines changed: 14 additions & 42 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
40 | 40 | | |
41 | 41 | | |
42 | 42 | | |
43 | | - | |
44 | | - | |
45 | | - | |
46 | | - | |
47 | | - | |
48 | | - | |
| 43 | + | |
| 44 | + | |
49 | 45 | | |
50 | 46 | | |
51 | 47 | | |
| |||
110 | 106 | | |
111 | 107 | | |
112 | 108 | | |
113 | | - | |
114 | | - | |
115 | | - | |
116 | | - | |
117 | | - | |
| 109 | + | |
118 | 110 | | |
119 | 111 | | |
120 | 112 | | |
| |||
329 | 321 | | |
330 | 322 | | |
331 | 323 | | |
332 | | - | |
333 | | - | |
| 324 | + | |
| 325 | + | |
334 | 326 | | |
335 | | - | |
336 | | - | |
337 | | - | |
| 327 | + | |
338 | 328 | | |
339 | 329 | | |
340 | 330 | | |
| |||
353 | 343 | | |
354 | 344 | | |
355 | 345 | | |
356 | | - | |
357 | | - | |
358 | | - | |
359 | | - | |
360 | | - | |
361 | | - | |
362 | | - | |
363 | | - | |
| 346 | + | |
364 | 347 | | |
365 | 348 | | |
366 | 349 | | |
367 | 350 | | |
368 | | - | |
369 | | - | |
370 | | - | |
371 | | - | |
372 | | - | |
373 | | - | |
374 | | - | |
375 | | - | |
376 | | - | |
| 351 | + | |
| 352 | + | |
| 353 | + | |
| 354 | + | |
| 355 | + | |
| 356 | + | |
377 | 357 | | |
378 | | - | |
379 | | - | |
380 | | - | |
381 | | - | |
382 | | - | |
383 | | - | |
384 | | - | |
385 | | - | |
386 | 358 | | |
387 | 359 | | |
388 | | - | |
| 360 | + | |
389 | 361 | | |
390 | 362 | | |
391 | 363 | | |
| |||
Lines changed: 17 additions & 34 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | | - | |
4 | 3 | | |
5 | 4 | | |
6 | 5 | | |
| |||
10 | 9 | | |
11 | 10 | | |
12 | 11 | | |
13 | | - | |
| 12 | + | |
14 | 13 | | |
15 | | - | |
16 | | - | |
| 14 | + | |
17 | 15 | | |
18 | 16 | | |
19 | 17 | | |
| |||
23 | 21 | | |
24 | 22 | | |
25 | 23 | | |
26 | | - | |
27 | | - | |
| 24 | + | |
| 25 | + | |
28 | 26 | | |
29 | 27 | | |
30 | | - | |
31 | | - | |
32 | | - | |
33 | | - | |
34 | | - | |
35 | | - | |
36 | | - | |
37 | | - | |
38 | | - | |
39 | | - | |
40 | | - | |
| 28 | + | |
41 | 29 | | |
42 | | - | |
| 30 | + | |
43 | 31 | | |
44 | 32 | | |
45 | 33 | | |
46 | | - | |
47 | | - | |
48 | | - | |
49 | | - | |
50 | 34 | | |
51 | 35 | | |
52 | 36 | | |
53 | 37 | | |
54 | 38 | | |
55 | | - | |
56 | | - | |
57 | | - | |
58 | | - | |
59 | | - | |
60 | | - | |
61 | | - | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
62 | 45 | | |
63 | 46 | | |
64 | 47 | | |
| |||
73 | 56 | | |
74 | 57 | | |
75 | 58 | | |
76 | | - | |
77 | | - | |
| 59 | + | |
| 60 | + | |
78 | 61 | | |
79 | 62 | | |
80 | | - | |
| 63 | + | |
81 | 64 | | |
82 | 65 | | |
83 | 66 | | |
84 | 67 | | |
85 | | - | |
86 | | - | |
| 68 | + | |
| 69 | + | |
87 | 70 | | |
88 | 71 | | |
89 | 72 | | |
| |||
Lines changed: 6 additions & 6 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
| 1 | + | |
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
| |||
17 | 17 | | |
18 | 18 | | |
19 | 19 | | |
20 | | - | |
21 | | - | |
22 | | - | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
23 | 24 | | |
24 | | - | |
| 25 | + | |
25 | 26 | | |
26 | 27 | | |
27 | 28 | | |
| |||
49 | 50 | | |
50 | 51 | | |
51 | 52 | | |
52 | | - | |
53 | 53 | | |
54 | 54 | | |
55 | 55 | | |
| |||
Lines changed: 0 additions & 71 deletions
This file was deleted.
0 commit comments