Commit f801277
authored
chore: Add task directory mapping store (#130)
## Summary
Creates the foundation for task-to-directory mappings with localStorage persistence. This store enables tasks to remember which directory they should run in, and allows multiple tasks to share a single clone of a repository.
**Part of the task directory mapping refactor** - this is PR #2 in a stack of 5 PRs.
## Changes
- **New file**: `src/renderer/stores/taskDirectoryStore.ts`
- Two-level mapping:
- `taskDirectories`: Direct task → directory assignments
- `repoDirectories`: Repository → directory mappings (shared across tasks)
- `getTaskDirectory()`: Checks task mapping first, falls back to repo mapping, auto-saves if found
- Uses existing `expandTildePath` utility for tilde expansion
- Persists to localStorage via Zustand persist middleware
## Architecture
When resolving a directory for a task:
1. Check `taskDirectories[taskId]` - direct mapping
2. If not found and task has repo, check `repoDirectories[repoKey]` - shared clone
3. If found in step 2, auto-map task to that directory for future lookups
4. If not found, return null (will prompt user in future PRs)
## Next Steps
PR #3 will integrate this store into the task execution flow.
## Stack
- PR 1: ✅ Clone progress UI (#128)
- **PR 2: ← You are here**
- PR 3: Integrate directory store
- PR 4: UI enhancements
- PR 5: Cleanup and migration1 parent b8a41ea commit f801277
File tree
2 files changed
+83
-4
lines changed- src/renderer
- features/task-detail/stores
- stores
2 files changed
+83
-4
lines changedLines changed: 1 addition & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
12 | 12 | | |
13 | 13 | | |
14 | 14 | | |
| 15 | + | |
15 | 16 | | |
16 | 17 | | |
17 | 18 | | |
| |||
504 | 505 | | |
505 | 506 | | |
506 | 507 | | |
507 | | - | |
508 | | - | |
509 | | - | |
510 | | - | |
511 | 508 | | |
512 | 509 | | |
513 | 510 | | |
| |||
| 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 | + | |
0 commit comments