Commit 3112801
committed
Nit: De-dupe
Wrap-up cleanup after the size-coloring pass.
- The "wrap a formatted size string in a colored span" helper had four near-identical copies: `colorSize` in `lib/ai/ai-state.svelte.ts`, `lib/file-operations/transfer/transfer-error-messages.ts`, and `lib/settings/sections/AiLocalSection.svelte`, plus `colorizeFormattedSize` in `lib/file-explorer/views/full-list-utils.ts`. Extracted to one exported `colorizeSizeString(text)` in `selection-info-utils.ts`, alongside the existing `formatSizeHtmlColored(bytes, format)`. Tier resolution still goes through `tierClassForUnit`.
- `lib/ui/CLAUDE.md`: added `Size.svelte` to the components table and a short section documenting when to reach for `<Size bytes={…} />` vs. `formatSizeHtmlColored()` vs. `colorizeSizeString()`. The file-list size column keeps its inline `formatSizeForDisplay` usage — noted why.colorSize helper, document <Size>
1 parent 357c4fa commit 3112801
6 files changed
Lines changed: 46 additions & 43 deletions
File tree
- apps/desktop/src/lib
- ai
- file-explorer
- selection
- views
- file-operations/transfer
- settings/sections
- ui
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
14 | 14 | | |
15 | 15 | | |
16 | 16 | | |
17 | | - | |
18 | | - | |
19 | | - | |
20 | | - | |
21 | | - | |
22 | | - | |
23 | | - | |
24 | | - | |
| 17 | + | |
25 | 18 | | |
26 | 19 | | |
27 | 20 | | |
| |||
214 | 207 | | |
215 | 208 | | |
216 | 209 | | |
217 | | - | |
218 | | - | |
219 | | - | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
220 | 213 | | |
221 | 214 | | |
222 | 215 | | |
| |||
Lines changed: 11 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
84 | 84 | | |
85 | 85 | | |
86 | 86 | | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
87 | 98 | | |
88 | 99 | | |
89 | 100 | | |
| |||
Lines changed: 5 additions & 12 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
9 | | - | |
| 9 | + | |
10 | 10 | | |
11 | 11 | | |
12 | 12 | | |
| |||
250 | 250 | | |
251 | 251 | | |
252 | 252 | | |
253 | | - | |
254 | | - | |
255 | | - | |
256 | | - | |
257 | | - | |
258 | | - | |
259 | | - | |
260 | 253 | | |
261 | 254 | | |
262 | | - | |
| 255 | + | |
263 | 256 | | |
264 | 257 | | |
265 | 258 | | |
| |||
280 | 273 | | |
281 | 274 | | |
282 | 275 | | |
283 | | - | |
| 276 | + | |
284 | 277 | | |
285 | 278 | | |
286 | 279 | | |
| |||
297 | 290 | | |
298 | 291 | | |
299 | 292 | | |
300 | | - | |
| 293 | + | |
301 | 294 | | |
302 | 295 | | |
303 | 296 | | |
| |||
367 | 360 | | |
368 | 361 | | |
369 | 362 | | |
370 | | - | |
| 363 | + | |
371 | 364 | | |
372 | 365 | | |
373 | 366 | | |
| |||
Lines changed: 2 additions & 9 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
10 | 10 | | |
11 | 11 | | |
12 | 12 | | |
13 | | - | |
| 13 | + | |
14 | 14 | | |
15 | 15 | | |
16 | | - | |
17 | | - | |
18 | | - | |
19 | | - | |
20 | | - | |
21 | | - | |
22 | | - | |
23 | 16 | | |
24 | 17 | | |
25 | 18 | | |
| |||
150 | 143 | | |
151 | 144 | | |
152 | 145 | | |
153 | | - | |
| 146 | + | |
154 | 147 | | |
155 | 148 | | |
156 | 149 | | |
| |||
Lines changed: 4 additions & 11 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
22 | 22 | | |
23 | 23 | | |
24 | 24 | | |
25 | | - | |
26 | | - | |
27 | | - | |
28 | | - | |
29 | | - | |
30 | | - | |
31 | | - | |
32 | | - | |
| 25 | + | |
33 | 26 | | |
34 | 27 | | |
35 | 28 | | |
| |||
299 | 292 | | |
300 | 293 | | |
301 | 294 | | |
302 | | - | |
303 | | - | |
304 | | - | |
| 295 | + | |
| 296 | + | |
| 297 | + | |
305 | 298 | | |
306 | 299 | | |
307 | 300 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
15 | 15 | | |
16 | 16 | | |
17 | 17 | | |
| 18 | + | |
18 | 19 | | |
19 | 20 | | |
20 | 21 | | |
| |||
180 | 181 | | |
181 | 182 | | |
182 | 183 | | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
183 | 203 | | |
184 | 204 | | |
185 | 205 | | |
| |||
0 commit comments