Commit 5bd7348
Image dataset (#61)
* feat(dataset): Improve CSV file management in dataset dialog
Implements drag-and-drop reordering and deletion for CSV files
in the dataset creation/editing dialog.
Key changes:
- Uses dnd-kit for drag-and-drop functionality.
- Stores the ordered list of selected file names in the dataset's `data` field.
- Continues to send actual `File` objects for new/updated files to the API via the `files` field.
- Updates UI to display file names, sizes for new files, and allows reordering and deletion.
- Adds unit tests for new interactions and logic using Vitest.
- Ensures all build, lint, and type checks pass.
This addresses the issue of maintaining file order and allowing
more flexible file management for CSV datasets.
* add image type to dataset
* add image type
* feat: Add image type to dataset dialog
This commit introduces a new 'image' dataset type to the dataset creation and update dialog.
Key changes:
- Added "image" as an option in the dataset type selection.
- Implemented image file selection, allowing you to choose common image formats (PNG, JPG, GIF).
- Added functionality to generate and display small image thumbnails in the file list for selected images.
- Updated data structures, submission logic, and validation to support the new image type.
- Included unit tests to cover the new functionality, including image selection, thumbnail display (mocked), and submission.
The file input for images now shows a preview thumbnail for each selected image file in the list, enhancing your experience when working with image datasets.
* fix tests
* fix vision cli integration test
* update
* [Frontend] Add image dataset preview functionality
This commit introduces the ability to preview image datasets.
When a dataset with type 'image' is previewed, the images are
displayed as cards, with each card showing the image and its
filename below it. Multiple images are displayed per row in a
responsive grid layout.
Key changes:
- Modified `DatasetPreviewDialog` to handle `type: "image"`.
- Used `Card` components to display each image and its filename.
- Added unit tests for the new image preview functionality,
covering successful rendering, empty lists, loading, and error states.
Note: Full verification of tests, tsc, and pnpm build was hindered
by persistent environmental issues.
The changes are submitted based on the successful implementation
of the code and test logic.
* update
* fix update image dataset
* fix lint
* style: Remove unnecessary comments from dataset tests
I removed explanatory code comments from `ui/src/components/dialog/dataset/dataset.test.tsx` to improve readability and maintainability.
The tests themselves remain unchanged in functionality. All tests (excluding the intentionally skipped image tests) continue to pass, and both `tsc` and `pnpm build` complete successfully.
* fix lint
* fix test
---------
Co-authored-by: google-labs-jules[bot] <161369871+google-labs-jules[bot]@users.noreply.github.com>1 parent a631bc8 commit 5bd7348
24 files changed
Lines changed: 1509 additions & 560 deletions
File tree
- api
- cmd/cli
- ent
- dataset
- migrate
- schema
- services
- dataset
- source
- table
- tests/cli
- snapshots
- ui
- src
- components
- dialog/dataset
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
6 | | - | |
7 | 6 | | |
8 | 7 | | |
9 | 8 | | |
| |||
12 | 11 | | |
13 | 12 | | |
14 | 13 | | |
15 | | - | |
16 | | - | |
17 | 14 | | |
18 | 15 | | |
19 | 16 | | |
| |||
28 | 25 | | |
29 | 26 | | |
30 | 27 | | |
31 | | - | |
| 28 | + | |
32 | 29 | | |
33 | 30 | | |
34 | 31 | | |
35 | 32 | | |
36 | | - | |
| 33 | + | |
37 | 34 | | |
38 | 35 | | |
39 | 36 | | |
40 | 37 | | |
41 | 38 | | |
42 | 39 | | |
43 | | - | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
44 | 44 | | |
45 | 45 | | |
46 | 46 | | |
| |||
107 | 107 | | |
108 | 108 | | |
109 | 109 | | |
110 | | - | |
| 110 | + | |
111 | 111 | | |
112 | 112 | | |
113 | 113 | | |
114 | 114 | | |
115 | 115 | | |
116 | 116 | | |
117 | | - | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
118 | 121 | | |
119 | 122 | | |
120 | 123 | | |
121 | 124 | | |
122 | | - | |
| 125 | + | |
123 | 126 | | |
124 | 127 | | |
125 | 128 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
72 | 72 | | |
73 | 73 | | |
74 | 74 | | |
75 | | - | |
| 75 | + | |
76 | 76 | | |
77 | 77 | | |
78 | 78 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
181 | 181 | | |
182 | 182 | | |
183 | 183 | | |
184 | | - | |
| 184 | + | |
185 | 185 | | |
186 | 186 | | |
187 | 187 | | |
188 | 188 | | |
189 | 189 | | |
190 | | - | |
| 190 | + | |
191 | 191 | | |
192 | | - | |
| 192 | + | |
193 | 193 | | |
| 194 | + | |
194 | 195 | | |
195 | 196 | | |
196 | 197 | | |
| |||
199 | 200 | | |
200 | 201 | | |
201 | 202 | | |
202 | | - | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
203 | 208 | | |
204 | 209 | | |
| 210 | + | |
205 | 211 | | |
206 | 212 | | |
207 | | - | |
| 213 | + | |
208 | 214 | | |
209 | 215 | | |
210 | 216 | | |
| |||
307 | 313 | | |
308 | 314 | | |
309 | 315 | | |
310 | | - | |
| 316 | + | |
311 | 317 | | |
312 | 318 | | |
313 | 319 | | |
314 | 320 | | |
315 | 321 | | |
316 | 322 | | |
317 | 323 | | |
318 | | - | |
| 324 | + | |
319 | 325 | | |
320 | 326 | | |
321 | 327 | | |
322 | | - | |
323 | | - | |
324 | | - | |
325 | | - | |
326 | | - | |
327 | | - | |
328 | 328 | | |
329 | 329 | | |
330 | | - | |
| 330 | + | |
| 331 | + | |
| 332 | + | |
| 333 | + | |
331 | 334 | | |
332 | 335 | | |
333 | 336 | | |
334 | 337 | | |
335 | | - | |
| 338 | + | |
336 | 339 | | |
337 | 340 | | |
338 | 341 | | |
| |||
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
36 | 36 | | |
37 | 37 | | |
38 | 38 | | |
39 | | - | |
| 39 | + | |
40 | 40 | | |
41 | 41 | | |
42 | 42 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
| 10 | + | |
10 | 11 | | |
11 | 12 | | |
12 | 13 | | |
13 | 14 | | |
14 | 15 | | |
15 | 16 | | |
16 | | - | |
17 | 17 | | |
18 | 18 | | |
19 | 19 | | |
| |||
39 | 39 | | |
40 | 40 | | |
41 | 41 | | |
42 | | - | |
43 | | - | |
44 | | - | |
45 | | - | |
46 | | - | |
47 | | - | |
48 | | - | |
49 | | - | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
50 | 48 | | |
51 | | - | |
52 | | - | |
53 | | - | |
54 | | - | |
55 | | - | |
| 49 | + | |
| 50 | + | |
56 | 51 | | |
57 | | - | |
| 52 | + | |
58 | 53 | | |
59 | | - | |
60 | | - | |
61 | | - | |
62 | | - | |
63 | | - | |
64 | | - | |
65 | | - | |
66 | | - | |
67 | | - | |
68 | | - | |
69 | | - | |
70 | | - | |
71 | | - | |
72 | | - | |
73 | | - | |
74 | | - | |
75 | | - | |
76 | | - | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
77 | 58 | | |
78 | | - | |
79 | | - | |
80 | | - | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
81 | 63 | | |
82 | 64 | | |
83 | 65 | | |
84 | | - | |
| 66 | + | |
85 | 67 | | |
86 | | - | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
87 | 74 | | |
88 | 75 | | |
89 | 76 | | |
90 | 77 | | |
91 | | - | |
| 78 | + | |
92 | 79 | | |
93 | 80 | | |
94 | 81 | | |
| |||
119 | 106 | | |
120 | 107 | | |
121 | 108 | | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
122 | 113 | | |
123 | 114 | | |
124 | 115 | | |
| |||
161 | 152 | | |
162 | 153 | | |
163 | 154 | | |
164 | | - | |
165 | | - | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
166 | 160 | | |
167 | 161 | | |
168 | 162 | | |
169 | 163 | | |
170 | 164 | | |
171 | | - | |
| 165 | + | |
172 | 166 | | |
173 | 167 | | |
174 | 168 | | |
175 | 169 | | |
176 | 170 | | |
177 | 171 | | |
178 | | - | |
179 | | - | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
180 | 187 | | |
181 | 188 | | |
182 | 189 | | |
| |||
217 | 224 | | |
218 | 225 | | |
219 | 226 | | |
220 | | - | |
| 227 | + | |
221 | 228 | | |
222 | 229 | | |
223 | 230 | | |
| |||
229 | 236 | | |
230 | 237 | | |
231 | 238 | | |
232 | | - | |
| 239 | + | |
233 | 240 | | |
234 | 241 | | |
235 | 242 | | |
| |||
276 | 283 | | |
277 | 284 | | |
278 | 285 | | |
| 286 | + | |
| 287 | + | |
| 288 | + | |
| 289 | + | |
| 290 | + | |
279 | 291 | | |
280 | 292 | | |
281 | 293 | | |
| |||
0 commit comments