Commit 9b9a4ca
committed
Tooling: Virtual MTP device in dev via CMDR_VIRTUAL_MTP
Lets devs exercise MTP flows (drag&drop, transfers, conflict dialogs) in a normal `pnpm dev` session without real hardware:
- `CMDR_VIRTUAL_MTP=1 pnpm dev` registers a virtual "Virtual Pixel 9" device in the volume picker, pre-populated with folders/files so drag&drop is testable immediately. `=<dir>` backs it with a custom directory tree.
- Compile-time still feature-gated: the wrapper (`tauri-wrapper.js`) appends `--features virtual-mtp` to the dev build only when the env var is set, so release `pnpm build` binaries stay feature-free. First use after a plain `pnpm dev` triggers a full-ish rebuild (feature-set change).
- Runtime gate unified in `activate_from_env_if_requested()`: registers when either an E2E run (`CMDR_E2E_MODE=1`) or `CMDR_VIRTUAL_MTP` is set, never when `CMDR_E2E_SKIP_VIRTUAL_MTP_SETUP` is set. A `virtual-mtp`-compiled binary launched with none of those vars stays inert, so the dev opt-in is purely additive to the E2E path (harness behavior unchanged).
- Default fixtures now mirror `test/e2e-shared/mtp-fixtures.ts` (DCIM/Burst included).
- Pure `decide_startup_root` gating logic is unit-tested.
- Docs: new `docs/tooling/virtual-mtp.md`, plus notes in `mtp/CLAUDE.md`, the scripts `CLAUDE.md`, and the testing docs.1 parent f977ed9 commit 9b9a4ca
8 files changed
Lines changed: 298 additions & 36 deletions
File tree
- apps/desktop
- scripts
- src-tauri/src
- mtp
- docs
- tooling
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
8 | | - | |
9 | | - | |
10 | | - | |
11 | | - | |
12 | | - | |
13 | | - | |
14 | | - | |
15 | | - | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
16 | 16 | | |
17 | 17 | | |
18 | 18 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
41 | 41 | | |
42 | 42 | | |
43 | 43 | | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
44 | 69 | | |
45 | 70 | | |
46 | 71 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
427 | 427 | | |
428 | 428 | | |
429 | 429 | | |
430 | | - | |
431 | | - | |
432 | | - | |
433 | | - | |
| 430 | + | |
| 431 | + | |
| 432 | + | |
| 433 | + | |
| 434 | + | |
| 435 | + | |
434 | 436 | | |
435 | | - | |
436 | | - | |
437 | | - | |
| 437 | + | |
438 | 438 | | |
439 | 439 | | |
440 | 440 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
17 | 17 | | |
18 | 18 | | |
19 | 19 | | |
20 | | - | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
21 | 31 | | |
22 | 32 | | |
23 | 33 | | |
| |||
0 commit comments