Commit 0cc4755
authored
feat: task list in
# Interactive task selector for `vp run`
https://github.com/user-attachments/assets/b70fe000-b890-4d04-9786-c76455b28780
When `vp run` is called without a task or with a typo, show an
interactive fuzzy-searchable selector (TTY) or a plain task list (piped
stdin).
## Interactive mode (TTY)
- Fuzzy-searchable list powered by `nucleo-matcher`
- Arrow keys to navigate, Enter to select, Esc to cancel
- Scrollable when the list exceeds the viewport (page size = 8)
- Typo pre-filled as initial search query with "Task not found" header
- Selected task runs with original flags (`-r`, `-t`, extra args)
preserved
- Command shown in cyan, matching the execution summary style
## Non-interactive mode (piped stdin)
- Plain text list: `taskName: command`
- "Did you mean" suggestions for typos (fuzzy-matched)
- Exits with failure status for typo case
## Key implementation details
- **`vite_select` crate** — standalone UI widget with crossterm
rendering, fuzzy matching, `after_render` callback for test milestones
- **`RunFlags`** — extracted as `Copy` struct with `#[clap(flatten)]` so
flags survive `RunCommand` consumption
- **`RecursiveTaskNotFound`** error variant — recursive queries (`-r`)
now error on unmatched task names instead of silently returning an empty
graph
- **Nested task safety** — `task_not_found_name()` returns `None` when
the call stack is non-empty, so errors from nested tasks (e.g. `vp run
nonexistent` inside a task script) propagate as-is instead of triggering
the selector
## E2E tests
12 test cases across `task-select` and `task-list` fixtures covering:
- Non-interactive list, did-you-mean, recursive did-you-mean
- Interactive select, search-then-select, typo pre-fill, cancel
- Scroll through long list (12 tasks, page size 8)
- Flag preservation (`-r`, `-t`)
- Nested task error propagation (typo in task script fails without
showing selector)vp run (#148)1 parent 7311b74 commit 0cc4755
File tree
65 files changed
+2044
-288
lines changed- crates
- vite_select
- src
- vite_task_bin
- src
- tests/e2e_snapshots
- fixtures
- interactions-no-vp
- snapshots
- task-list
- packages
- app
- lib
- snapshots
- task-select-truncate
- packages/app
- snapshots
- task-select
- packages
- app
- lib
- snapshots
- vite_task_graph/src
- vite_task_plan/src
- vite_task
- src
- cli
- session
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
65 files changed
+2044
-288
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
9 | 12 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
48 | 48 | | |
49 | 49 | | |
50 | 50 | | |
| 51 | + | |
51 | 52 | | |
52 | | - | |
53 | 53 | | |
54 | 54 | | |
55 | 55 | | |
| |||
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 | |
|---|---|---|---|
| |||
85 | 85 | | |
86 | 86 | | |
87 | 87 | | |
| 88 | + | |
88 | 89 | | |
89 | 90 | | |
90 | 91 | | |
91 | | - | |
| 92 | + | |
92 | 93 | | |
93 | 94 | | |
94 | 95 | | |
| |||
135 | 136 | | |
136 | 137 | | |
137 | 138 | | |
| 139 | + | |
138 | 140 | | |
139 | 141 | | |
140 | 142 | | |
| |||
| 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 | + | |
| 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 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
0 commit comments