10 — Interaction Specification (Files Module)
- 1. Opening the upload sheet
- 2. Picking a file
- 3. Upload progress
- 4. Upload failure
- 5. Download interaction
- 6. Delete confirmation
- 7. Long-press & swipe
(proposed) - 8. Drag & drop (desktop)
(forward-looking) - 9. Offline behavior
- 10. Pull-to-refresh
- 11. Motion budget summary
Micro-interactions and motion for file flows. Motion tokens (
m-fast,m-base), haptics, and platform patterns are authoritative in 00-shared/08_Interaction_&_Motion — this file applies them to the files domain.
1. Opening the upload sheet
- Trigger: "Attach" CTA →
AppBottomSheetslides up (m-base, 280 ms, ease-out); scrim dims list. - Tablet/desktop: centered dialog ≤ 480 dp, scale+fade (
m-fast). - Haptic: light (
HapticFeedback.lightImpact) on open (mobile).
2. Picking a file
- System picker is a platform-owned transition (no app animation).
- On selection return: preview card animates in (
m-fastfade+slide 8 dp);UploadCTA becomes enabled (color shift per tokens — no bounce). - Re-pick replaces the preview (old card out
m-fast, new in).
3. Upload progress
- Progress card:
AppProgressfills 0→100% with per-frame value from transportonSendProgress; percent label; bytes counter1.2 MB / 3.2 MB. - Indeterminate until first progress event (server buffering) —
AppProgressindeterminate variant, not a frozen 0%. - Cancel: press state ripple; card collapses out (
m-fast); snackbar "Upload cancelled". - Success: card → green check 200 ms → auto-dismiss; tile inserts into list with
m-baseslide + highlight pulse (2 ×m-fast).
4. Upload failure
- Card flips to error color; inline "Retry" button (re-POST). Error shake on the card
(8 dp,
m-fast) per 00-shared/08. - Snackbar alternative only when the card is dismissed.
5. Download interaction
- Tap download → progress row appears under the tile (inline, no full-screen dialog for single files).
- Percent from
onReceiveProgress; indeterminate until first bytes. - Done (web): browser download UI takes over — show snackbar "Downloaded
name". - Done (mobile): system notification; tap → share/open sheet
(forward-looking). - Failure: row shows error + Retry (restarts from 0 — no resume).
6. Delete confirmation
- Menu →
AppDialogdestructive variant: title + file name + redDelete(danger color token),Cancelghost. - Confirm: button spinner (no double-tap), row removal animates out (
m-basecollapse), snackbar "File deleted". No undo action(proposed: restore later). - Dismiss: scrim tap / back / ESC cancels without animation of the row.
7. Long-press & swipe (proposed)
- Long-press row → multi-select mode
(proposed); swipe-left → delete shortcut on admin rows(proposed)— requires server multi-delete(planned)before shipping.
8. Drag & drop (desktop) (forward-looking)
- Drag a local file onto the list/section → drop zone highlight → auto-open UploadSheet prefilled. Browser-only; no server change.
9. Offline behavior
- Offline banner pins to top of list; upload/download actions disabled with explanation
(no server reachability). Reconnect → retry queue drains
(forward-looking).
10. Pull-to-refresh
- List re-fetch (
GET /files) with standardRefreshIndicator; no haptic unless completion > 500 ms (platform default).
11. Motion budget summary
| Interaction | Token | Note |
|---|---|---|
| Sheet open/close | m-base | bottom slide |
| Row insert/remove | m-base | collapse + highlight pulse |
| Preview card swap | m-fast | fade + 8 dp slide |
| Error shake | m-fast | 8 dp |
| Dialog confirm | m-fast | scale+fade |