Commit a36e703
committed
Freshness UX: per-drive index status badge + menu in the volume switcher
Every real drive now carries a small index-freshness dot in the volume switcher,
in two placements: always-visible next to the dropdown trigger (the ACTIVE
drive, beside the SMB light), and per-row inside the dropdown. Four states map
from the backend `VolumeIndexStatus`: gray (not indexed), blue (scanning, pulses
unless reduce-motion), green (fresh), yellow (stale). Clicking the dot opens a
small themed menu — turn on / off, rescan, stop — with a "Last indexed: <date> ·
took <duration>" footer.
- `DriveIndexBadge.svelte`: the dot + popover menu, a focusable `<button>` with
an `aria-label` and `aria-haspopup` (no `role="img"` — axe rejects it on a
button). Reuses the existing colored-indicator + `use:tooltip` shape.
- `drive-index-status.ts`: the pure state→color/menu/duration mapping, unit-tested.
- `drive-index-manager.svelte.ts`: a reactive `volumeId → status` map that fetches
on demand and stays live by SUBSCRIBING to `index-freshness-changed` /
`index-scan-started` / `index-scan-complete` (subscribe, don't poll). Fetch
failures degrade to "no badge", never an unhandled rejection. `isDriveRow` is
the badge-eligibility predicate (real drives only, not favorites/groups).
- `VolumeBreadcrumb.svelte`: renders the badge in both placements and runs the
per-drive IPC for a picked action. A refused SMB enable/rescan is classified by
TYPED `SmbIndexGateReason` (never message text): `credentials_needed` routes
into the direct-connect/login flow, the rest show a friendly toast.
- Copy is i18n-ized under `fileExplorer.navigation.driveIndex.*`.
- Drive-by: reword a `volume_scanner` debug log to `key=value` form so it stops
tripping `pluralize-noun`.1 parent 556f850 commit a36e703
13 files changed
Lines changed: 1027 additions & 2 deletions
File tree
- apps/desktop
- src-tauri/src/indexing
- src/lib
- intl
- messages/en
- scripts/check-css-unused
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
211 | 211 | | |
212 | 212 | | |
213 | 213 | | |
214 | | - | |
| 214 | + | |
215 | 215 | | |
216 | 216 | | |
217 | 217 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
34 | 34 | | |
35 | 35 | | |
36 | 36 | | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
37 | 43 | | |
38 | 44 | | |
39 | 45 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
30 | 30 | | |
31 | 31 | | |
32 | 32 | | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
33 | 39 | | |
34 | 40 | | |
35 | 41 | | |
| |||
316 | 322 | | |
317 | 323 | | |
318 | 324 | | |
| 325 | + | |
| 326 | + | |
| 327 | + | |
| 328 | + | |
| 329 | + | |
| 330 | + | |
| 331 | + | |
| 332 | + | |
| 333 | + | |
| 334 | + | |
| 335 | + | |
| 336 | + | |
| 337 | + | |
| 338 | + | |
| 339 | + | |
| 340 | + | |
| 341 | + | |
| 342 | + | |
| 343 | + | |
| 344 | + | |
| 345 | + | |
| 346 | + | |
| 347 | + | |
| 348 | + | |
| 349 | + | |
| 350 | + | |
| 351 | + | |
319 | 352 | | |
320 | 353 | | |
321 | 354 | | |
| |||
Lines changed: 61 additions & 0 deletions
| 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 | + | |
| 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 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
0 commit comments