Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions src/Conclave.App/Sessions/Database.cs
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,17 @@ public static string DefaultPath()
return System.IO.Path.Combine(dir, "conclave.db");
}

// Worktrees live under ~/.Conclave on every platform — separate from the app-data
// directory (which on Windows sits inside AppData\Roaming\Conclave) so per-file paths
// stay clear of Windows' 260-char MAX_PATH limit. Every saved character matters: the
// 32-char project id and slug already cost ~40, and git itself appends paths like
// ".git/worktrees/<name>/index.lock" inside the linked worktree.
public static string DefaultWorktreeRoot()
{
var home = Environment.GetFolderPath(Environment.SpecialFolder.UserProfile);
return System.IO.Path.Combine(home, ".Conclave");
}

public static long Now() => DateTimeOffset.UtcNow.ToUnixTimeMilliseconds();

private void Migrate()
Expand Down
3 changes: 1 addition & 2 deletions src/Conclave.App/Sessions/SessionManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,7 @@ public static SessionManager Open(Tokens tokens)
{
var dbPath = Database.DefaultPath();
var db = Database.Open(dbPath);
var root = Path.Combine(Path.GetDirectoryName(dbPath)!, "worktrees");
return new SessionManager(db, root, tokens);
return new SessionManager(db, Database.DefaultWorktreeRoot(), tokens);
}

// --- Loading ---
Expand Down
2 changes: 1 addition & 1 deletion src/Conclave.App/ViewModels/NewSessionVm.cs
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ public string WorktreePath
var slug = DeriveSlug(_branch);
if (_project.IsFusion)
return $"{_project.MemberIds.Count} worktrees · {slug}";
return $"worktrees/{_project.Id[..8]}/{slug}";
return $"~/.Conclave/{_project.Id[..8]}/{slug}";
}
}

Expand Down
Loading