···77 let workingDirectory: URL
88 let repositoryRootURL: URL
99 let createdAt: Date?
1010+ let isMain: Bool
10111112 nonisolated init(
1213 id: String,
···2223 self.workingDirectory = workingDirectory
2324 self.repositoryRootURL = repositoryRootURL
2425 self.createdAt = createdAt
2626+ // Pre-compute the main-worktree flag at construction time so that hot SwiftUI
2727+ // paths never call the expensive `URL.standardizedFileURL` getter during view
2828+ // updates. The fast equality check covers the common case where callers
2929+ // already pass normalized URLs; the standardized fallback protects against
3030+ // any future call site that forgets to normalize first.
3131+ self.isMain =
3232+ workingDirectory == repositoryRootURL
3333+ || workingDirectory.standardizedFileURL == repositoryRootURL.standardizedFileURL
2534 }
2635}
2736