Commit 07b932c
authored
feat: add directory prompt on run and cloud mode gating (#132)
## Summary
Implements the frictionless directory selection flow: when clicking "Run" without a directory set, Array prompts the user to either select an existing directory or clone the repository.
## User Flow
### For tasks WITH `repository_config`:
When user clicks "Run (Local)" without a directory:
1. **Prompt**: "Do you have `org/repo` locally?"
2. **Options**:
- **"I have it locally"** → Opens native folder picker → Saves mapping → Runs task
- **"Clone for me"** → Triggers clone with progress UI → Saves mapping → User clicks Run again after clone
- **"Cancel"** → Returns to task detail
### For tasks WITHOUT `repository_config`:
When user clicks "Run (Local)" without a directory:
1. **Prompt**: "Select a working directory for this task"
2. **Opens folder picker** → Saves mapping → Runs task
### Invalid Directory Handling:
- If user selects an invalid directory → Validation fails silently → Prompt appears again
- No error spam, seamless recovery
- User can clear directory with X button and retry
### Working Directory Field:
- Shows **actual** directory that will be used (not derived fallback)
- Empty with "Not set - click Run to select" when no directory
- Clear button (X) appears only when directory is set
### Cloud Mode Gating:
- Cloud mode toggle is **disabled** for tasks without `repository_config`
- Tooltip explains: "Cloud mode requires a connected repository"
## Benefits
1. **Frictionless onboarding**: No upfront workspace configuration required
2. **Supports existing workflows**: Engineers can point to repos they already have cloned
3. **On-demand cloning**: Clone only when needed, with visual progress
4. **Flexible**: Supports both git-based and directory-only tasks
5. **Persistent**: Directory mappings survive app restarts
6. **Graceful recovery**: Invalid paths automatically re-prompt instead of erroring
7. **Clear UI**: Always shows what will actually be used
## Test Plan
- [x] Task with repo, no directory set → Prompt appears with 3 buttons
- [x] "I have it locally" → Folder picker opens → Selection persists
- [x] "Clone for me" → Clone progress shows → Directory saved after clone
- [x] Task without repo → Prompt shows "Select directory" with 2 buttons
- [x] Cloud mode disabled when no `repository_config` → Tooltip shows
- [x] Select invalid directory → Auto-prompts again (no error spam)
- [x] Clear directory with X button → Working directory shows empty → Run shows prompt
- [x] Working directory field shows actual path only
---
**Stack**: Built on top of:
- PR #128: Clone progress UI
- PR #130: Task directory store foundation
- PR #131: Integrate directory store into execution flow1 parent 236fc37 commit 07b932c
File tree
4 files changed
+168
-168
lines changed- src/renderer/features/task-detail
- components
- stores
4 files changed
+168
-168
lines changedLines changed: 10 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
| 10 | + | |
10 | 11 | | |
11 | 12 | | |
12 | 13 | | |
| |||
17 | 18 | | |
18 | 19 | | |
19 | 20 | | |
| 21 | + | |
20 | 22 | | |
21 | 23 | | |
22 | 24 | | |
| |||
58 | 60 | | |
59 | 61 | | |
60 | 62 | | |
61 | | - | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
62 | 70 | | |
63 | 71 | | |
64 | 72 | | |
65 | 73 | | |
66 | | - | |
| 74 | + | |
67 | 75 | | |
68 | 76 | | |
69 | 77 | | |
| |||
Lines changed: 1 addition & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
90 | 90 | | |
91 | 91 | | |
92 | 92 | | |
93 | | - | |
94 | | - | |
95 | 93 | | |
96 | 94 | | |
97 | 95 | | |
| |||
101 | 99 | | |
102 | 100 | | |
103 | 101 | | |
| 102 | + | |
104 | 103 | | |
105 | 104 | | |
106 | 105 | | |
| |||
Lines changed: 42 additions & 18 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
2 | 15 | | |
3 | 16 | | |
4 | 17 | | |
5 | | - | |
6 | | - | |
7 | 18 | | |
8 | 19 | | |
9 | 20 | | |
10 | 21 | | |
11 | | - | |
12 | | - | |
13 | 22 | | |
14 | 23 | | |
15 | 24 | | |
16 | 25 | | |
17 | 26 | | |
18 | | - | |
19 | | - | |
20 | 27 | | |
21 | | - | |
| 28 | + | |
| 29 | + | |
22 | 30 | | |
23 | 31 | | |
24 | 32 | | |
25 | 33 | | |
26 | 34 | | |
27 | 35 | | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
28 | 40 | | |
29 | 41 | | |
30 | 42 | | |
| |||
73 | 85 | | |
74 | 86 | | |
75 | 87 | | |
76 | | - | |
77 | | - | |
78 | | - | |
79 | | - | |
80 | | - | |
81 | | - | |
82 | | - | |
83 | | - | |
84 | | - | |
85 | | - | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
86 | 110 | | |
87 | 111 | | |
88 | 112 | | |
| |||
0 commit comments