Skip to content

Conversation

@lucasheriques
Copy link
Contributor

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

  • Task with repo, no directory set → Prompt appears with 3 buttons
  • "I have it locally" → Folder picker opens → Selection persists
  • "Clone for me" → Clone progress shows → Directory saved after clone
  • Task without repo → Prompt shows "Select directory" with 2 buttons
  • Cloud mode disabled when no repository_config → Tooltip shows
  • Select invalid directory → Auto-prompts again (no error spam)
  • Clear directory with X button → Working directory shows empty → Run shows prompt
  • Working directory field shows actual path only

Stack: Built on top of:

Copy link
Contributor Author

lucasheriques commented Nov 17, 2025

@lucasheriques lucasheriques force-pushed the feat/directory-picker-ui branch from 0ddb010 to d7bb808 Compare November 17, 2025 18:46
@lucasheriques lucasheriques changed the title feat: add directory source indicators and cloud mode gating feat: add directory prompt on run and cloud mode gating Nov 17, 2025
@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 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/directory-picker-ui branch from 2c538f0 to 35aaf71 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.

Nice, 🚢.

We definitely need to clean up this giant runTask action at one point, it's responsible for too much stuff and getting hard to read.

@lucasheriques lucasheriques force-pushed the feat/integrate-directory-store branch from df6b057 to 677f962 Compare November 18, 2025 11:37
@lucasheriques lucasheriques force-pushed the feat/directory-picker-ui branch from 35aaf71 to 086c2de 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:44 AM UTC: Graphite rebased this pull request as part of a merge.
  • Nov 18, 11:45 AM UTC: @lucasheriques merged this pull request with Graphite.

@lucasheriques lucasheriques changed the base branch from feat/integrate-directory-store to graphite-base/132 November 18, 2025 11:42
@lucasheriques lucasheriques changed the base branch from graphite-base/132 to main November 18, 2025 11:43
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/directory-picker-ui branch from 086c2de to 57f1aef Compare November 18, 2025 11:44
@lucasheriques lucasheriques merged commit 07b932c into main Nov 18, 2025
9 of 10 checks passed
@lucasheriques lucasheriques deleted the feat/directory-picker-ui branch November 18, 2025 11:45
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