Skip to content

Start chat from a chosen directory#106

Open
mcintyre94 wants to merge 1 commit intomainfrom
start-chat-from-directory-e216cd70
Open

Start chat from a chosen directory#106
mcintyre94 wants to merge 1 commit intomainfrom
start-chat-from-directory-e216cd70

Conversation

@mcintyre94
Copy link
Owner

Summary

  • Directory selector in empty chat state — a tappable folder row above session suggestions lets you change the working directory per-chat without visiting Overview; selecting a directory immediately refreshes the session list for that path
  • Hierarchical directory pickerDirectoryPickerView now drills down into subdirectories with a "Use" button to confirm selection; worktrees under ~/.wisp/worktrees/ appear in a dedicated section with {repo} / {branch} display names and session counts; worktrees load once on appear rather than re-scanning on every navigation step
  • Fix session suppression — removed spriteUsesWorktrees; usesWorktree is now just worktreePath != nil, so non-worktree chats on a sprite that also has worktree chats correctly show their session suggestions (e.g. resuming from a git repo root)
  • changeWorkingDirectory on ChatViewModel — persists the per-chat directory to SwiftData and re-fetches remote sessions; extracted clearRemoteSessions() helper and fixed selectRemoteSession not resetting hasAnyRemoteSessions
  • String.displayPath extension — consolidates the /home/sprite~/ conversion previously duplicated across DirectoryPickerView, ChatView, and SpriteOverviewView

Test plan

  • New chat: folder row appears above session suggestions showing current working directory
  • Tap folder row → directory picker opens as sheet starting at parent of current directory
  • Navigate into subdirectories; "Use" button selects currentPath; "Parent directory" row goes up; stops at /
  • Worktrees section appears when ~/.wisp/worktrees/ has entries; shows {repo} / {branch} with session count
  • Selecting a directory closes the sheet and session suggestions refresh for the new path
  • On a sprite with worktree chats, open a non-worktree chat — session suggestions now appear (previously suppressed)
  • Overview working directory picker still works via NavigationLink with no changes needed

🤖 Generated with Claude Code

- Add a working directory row to the empty chat state so users can
  change directory without going to Overview first; tapping opens the
  directory picker as a sheet and immediately refreshes session suggestions
- Rewrite DirectoryPickerView with hierarchical drill-down navigation,
  session counts per directory, and a dedicated Worktrees section listing
  ~/.wisp/worktrees entries (for cross-device resume)
- Remove spriteUsesWorktrees: session suggestions now show for any
  non-worktree chat regardless of other chats on the same sprite,
  enabling resume from a git repo root
- Add ChatViewModel.changeWorkingDirectory which persists the change and
  re-fetches remote sessions; extract clearRemoteSessions helper and fix
  selectRemoteSession not resetting hasAnyRemoteSessions
- Add String.displayPath extension to consolidate the /home/sprite → ~/
  conversion used across three views

Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
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.

1 participant