-
Notifications
You must be signed in to change notification settings - Fork 2
chore: Add task directory mapping store #130
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
+83
−4
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Contributor
Author
This stack of pull requests is managed by Graphite. Learn more about stacking. |
6 tasks
4 tasks
jonathanlab
approved these changes
Nov 17, 2025
8 tasks
lucasheriques
added a commit
that referenced
this pull request
Nov 17, 2025
When clicking "Run (Local)" without a directory set: - Tasks WITH repository_config: Prompt "Do you have it locally?" → "I have it locally" opens folder picker → "Clone for me" triggers clone flow with progress UI - Tasks WITHOUT repository_config: Prompt "Select working directory" → Opens folder picker Cloud mode changes: - Disable Cloud mode toggle for tasks without repository_config - Show tooltip: "Cloud mode requires a connected repository" Technical changes: - Updated runTask() in taskExecutionStore to prompt before showing error - Integrated with existing clone flow and progress UI (PR #128) - Persist selected directories via taskDirectoryStore (PR #130, #131) - Removed noisy directory source badges (simplified UX) This creates a frictionless flow where engineers can easily point to existing repos or clone them on-demand, while still supporting directory-only tasks for non-git workflows.
lucasheriques
added a commit
that referenced
this pull request
Nov 17, 2025
When clicking "Run (Local)" without a directory set: - Tasks WITH repository_config: Prompt "Do you have it locally?" → "I have it locally" opens folder picker → "Clone for me" triggers clone flow with progress UI - Tasks WITHOUT repository_config: Prompt "Select working directory" → Opens folder picker Cloud mode changes: - Disable Cloud mode toggle for tasks without repository_config - Show tooltip: "Cloud mode requires a connected repository" Technical changes: - Updated runTask() in taskExecutionStore to prompt before showing error - Integrated with existing clone flow and progress UI (PR #128) - Persist selected directories via taskDirectoryStore (PR #130, #131) - Removed noisy directory source badges (simplified UX) This creates a frictionless flow where engineers can easily point to existing repos or clone them on-demand, while still supporting directory-only tasks for non-git workflows.
eb783d3 to
eea62c0
Compare
lucasheriques
added a commit
that referenced
this pull request
Nov 18, 2025
When clicking "Run (Local)" without a directory set: - Tasks WITH repository_config: Prompt "Do you have it locally?" → "I have it locally" opens folder picker → "Clone for me" triggers clone flow with progress UI - Tasks WITHOUT repository_config: Prompt "Select working directory" → Opens folder picker Cloud mode changes: - Disable Cloud mode toggle for tasks without repository_config - Show tooltip: "Cloud mode requires a connected repository" Technical changes: - Updated runTask() in taskExecutionStore to prompt before showing error - Integrated with existing clone flow and progress UI (PR #128) - Persist selected directories via taskDirectoryStore (PR #130, #131) - Removed noisy directory source badges (simplified UX) This creates a frictionless flow where engineers can easily point to existing repos or clone them on-demand, while still supporting directory-only tasks for non-git workflows.
eea62c0 to
d0bfba0
Compare
Contributor
Author
Merge activity
|
- Create taskDirectoryStore with localStorage persistence - Support two-level mapping (taskId → dir, repoKey → dir) - Auto-map tasks to existing repo clones - Use existing expandTildePath utility Foundation for PR #3 (directory integration).
d0bfba0 to
7804c3e
Compare
lucasheriques
added a commit
that referenced
this pull request
Nov 18, 2025
## Summary - Integrates `taskDirectoryStore` into task execution flow - Tasks now check stored directory mappings before deriving paths from workspace - Persists directory assignments when repos are set or cloned - Enables per-task directory customization and repo sharing across tasks ## Changes - **`taskExecutionStore.ts`**: Updated `initializeRepoPath()` to check `taskDirectoryStore` first, then fall back to workspace-based derivation. Updated `setRepoPath()` to persist task→directory mapping. - **`cloneStore.ts`**: Updated `handleComplete()` to save repo→directory mapping after successful clone for future task reuse. ## Test Plan - [ ] Clone a repo for a task → verify mapping is saved - [ ] Run another task with the same repo → verify it reuses the cloned directory - [ ] Manually set a directory for a task → verify it persists across app restarts - [ ] Verify tasks without `repository_config` still work --- **Stack**: Built on top of: - PR #128: Clone progress UI - PR #130: Task directory store foundation
lucasheriques
added a commit
that referenced
this pull request
Nov 18, 2025
When clicking "Run (Local)" without a directory set: - Tasks WITH repository_config: Prompt "Do you have it locally?" → "I have it locally" opens folder picker → "Clone for me" triggers clone flow with progress UI - Tasks WITHOUT repository_config: Prompt "Select working directory" → Opens folder picker Cloud mode changes: - Disable Cloud mode toggle for tasks without repository_config - Show tooltip: "Cloud mode requires a connected repository" Technical changes: - Updated runTask() in taskExecutionStore to prompt before showing error - Integrated with existing clone flow and progress UI (PR #128) - Persist selected directories via taskDirectoryStore (PR #130, #131) - Removed noisy directory source badges (simplified UX) This creates a frictionless flow where engineers can easily point to existing repos or clone them on-demand, while still supporting directory-only tasks for non-git workflows.
lucasheriques
added a commit
that referenced
this pull request
Nov 18, 2025
## 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 flow
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.

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
src/renderer/stores/taskDirectoryStore.tstaskDirectories: Direct task → directory assignmentsrepoDirectories: Repository → directory mappings (shared across tasks)getTaskDirectory(): Checks task mapping first, falls back to repo mapping, auto-saves if foundexpandTildePathutility for tilde expansionArchitecture
When resolving a directory for a task:
taskDirectories[taskId]- direct mappingrepoDirectories[repoKey]- shared cloneNext Steps
PR #3 will integrate this store into the task execution flow.
Stack