Skip to content

Preserve remote repository curation across a disconnect#463

Merged
sbertix merged 1 commit into
mainfrom
sbertix/remote-repo-customization
Jun 22, 2026
Merged

Preserve remote repository curation across a disconnect#463
sbertix merged 1 commit into
mainfrom
sbertix/remote-repo-customization

Conversation

@sbertix

@sbertix sbertix commented Jun 22, 2026

Copy link
Copy Markdown
Collaborator

Summary

A remote repository (over SSH) is kept in the sidebar as an empty placeholder while its host is unreachable, so the entry isn't pruned. On any non-initial reload while disconnected, reconcileSidebarState read that empty roster as "these worktrees are gone" and pruned the repository's curation against it:

  • a pinned remote worktree (git or folder) was dropped, and demoted to unpinned on reconnect, and
  • the stored branch-collapse prefixes (collapsedBranchPrefixes) were wiped.

Separately, the "can't reach" error row rendered only the section-level title/color. A remote folder's custom name/color live on its synthetic folder-worktree item (the folder row is a worktree row), so they were lost while disconnected even though the live folder row shows them.

Changes

  • Skip the liveness prune and the branch-collapse prune for an unresolved remote placeholder (host != nil && worktrees.isEmpty), so its curation survives until the host resolves or the user removes it. Applies to remote git repos and folders alike.
  • On the disconnected error row, fall back to the folder-worktree item for the custom name/color, so it matches the live folder row.

Tests

RemoteDisconnectCurationTests:

  • a pin survives a disconnect (git and folder)
  • a reachable remote still prunes genuinely-vanished worktrees
  • collapsed-branch-prefixes survive a disconnect
  • the disconnected folder error row keeps its custom name/color

All 1941 tests pass; build and lint clean.

A disconnected remote is kept in the roster as an empty placeholder (no
worktrees). reconcileSidebarState read that empty roster as "these worktrees
are gone" and pruned the repo's curation against it on any non-initial reload:
a pinned remote worktree (git or folder) was dropped and demoted to unpinned on
reconnect, and the stored branch-collapse prefixes were wiped. Skip both prunes
for an unresolved remote placeholder so its curation survives until the host
resolves or the user removes it.

The "can't reach" error row also rendered only the section-level title/color, so
a remote folder (whose custom name/color live on its synthetic folder-worktree
item) lost them while disconnected, even though the live folder row shows them.
Fall back to the folder-worktree item so the error row matches the live row.
@sbertix sbertix enabled auto-merge (squash) June 22, 2026 23:40
@tuist

tuist Bot commented Jun 22, 2026

Copy link
Copy Markdown

🛠️ Tuist Run Report 🛠️

Builds 🔨

Scheme Status Duration Commit
supacode 2m 51s b47079f85

@sbertix sbertix merged commit a04597d into main Jun 22, 2026
1 check passed
@sbertix sbertix deleted the sbertix/remote-repo-customization branch June 22, 2026 23:50
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