Skip to content

Conversation

@lucasheriques
Copy link
Contributor

@lucasheriques lucasheriques commented Nov 17, 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:

Copy link
Contributor Author

lucasheriques commented Nov 17, 2025

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 lucasheriques marked this pull request as ready for review November 17, 2025 21:18
@lucasheriques lucasheriques requested a review from a team as a code owner November 17, 2025 21:18
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 lucasheriques force-pushed the feat/integrate-directory-store branch from e93427d to df6b057 Compare November 17, 2025 21:20
@lucasheriques lucasheriques force-pushed the feat/task-directory-store branch from eb783d3 to eea62c0 Compare November 17, 2025 21:20
Copy link
Contributor

@jonathanlab jonathanlab left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚢

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 lucasheriques force-pushed the feat/task-directory-store branch from eea62c0 to d0bfba0 Compare November 18, 2025 11:37
@lucasheriques lucasheriques force-pushed the feat/integrate-directory-store branch from df6b057 to 677f962 Compare November 18, 2025 11:37
Copy link
Contributor Author

lucasheriques commented Nov 18, 2025

Merge activity

  • Nov 18, 11:39 AM UTC: A user started a stack merge that includes this pull request via Graphite.
  • Nov 18, 11:42 AM UTC: Graphite rebased this pull request as part of a merge.
  • Nov 18, 11:43 AM UTC: @lucasheriques merged this pull request with Graphite.

@lucasheriques lucasheriques changed the base branch from feat/task-directory-store to graphite-base/131 November 18, 2025 11:40
@lucasheriques lucasheriques changed the base branch from graphite-base/131 to main November 18, 2025 11:41
- Use taskDirectoryStore for directory resolution in initializeRepoPath()
- Persist directory mappings when setRepoPath() is called
- Save repo→directory mapping after clone completion
- Support tasks without repository_config

Enables per-task directory customization and repo sharing across tasks.
@lucasheriques lucasheriques force-pushed the feat/integrate-directory-store branch from 677f962 to 08df673 Compare November 18, 2025 11:42
@lucasheriques lucasheriques merged commit 236fc37 into main Nov 18, 2025
9 of 10 checks passed
@lucasheriques lucasheriques deleted the feat/integrate-directory-store branch November 18, 2025 11:43
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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants