An unopenable repository fails loudly — the standing row, the paused surface, the honest heal
Claude-Session: https://claude.ai/code/session_014PtZdPwqZuqEDLc6wZMtEy
This commit is contained in:
@@ -69,13 +69,21 @@ final class BoardSettingsPresentation {
|
||||
/// What the sheet would show right now — and therefore, when empty, that there is no sheet to
|
||||
/// show (`BoardSettingsAvailability`).
|
||||
var sections: [BoardSettingsSection] {
|
||||
BoardSettingsSection.resolve(tier: tier, mode: git?.mode ?? .none)
|
||||
BoardSettingsSection.resolve(
|
||||
tier: tier,
|
||||
mode: git?.mode ?? .none,
|
||||
isRepositoryUnreadable: git?.isRepositoryUnreadable ?? false
|
||||
)
|
||||
}
|
||||
|
||||
/// Both doors' validation: the menu row's `disabled` state and whether the popover shows its row
|
||||
/// at all.
|
||||
var isReachable: Bool {
|
||||
BoardSettingsAvailability.resolve(tier: tier, mode: git?.mode ?? .none)
|
||||
BoardSettingsAvailability.resolve(
|
||||
tier: tier,
|
||||
mode: git?.mode ?? .none,
|
||||
isRepositoryUnreadable: git?.isRepositoryUnreadable ?? false
|
||||
)
|
||||
}
|
||||
|
||||
/// **Opening, not toggling** — unlike ⌘I. A sheet is modal to its window and carries its own
|
||||
@@ -141,7 +149,15 @@ enum BoardSettingsSection: String, Equatable, CaseIterable, Identifiable {
|
||||
}
|
||||
}
|
||||
|
||||
static func resolve(tier: Tier, mode: BoardGitMode) -> [BoardSettingsSection] {
|
||||
/// - Parameter isRepositoryUnreadable: whether the board's `.git` exists and will not open
|
||||
/// (`HistoryStore.isRepositoryUnreadable`). Defaulted, because it can only ever be true in mode
|
||||
/// `git` — every other mode has no repository for the probe to have failed on, and a caller
|
||||
/// that has no git state to ask is describing one of those boards.
|
||||
static func resolve(
|
||||
tier: Tier,
|
||||
mode: BoardGitMode,
|
||||
isRepositoryUnreadable: Bool = false
|
||||
) -> [BoardSettingsSection] {
|
||||
// **The free tier has no setup to host** (12-editions.md ▸ The free tier and `.git`): git is
|
||||
// the Pro subscription's, "any `.git` is inert", and 03 gives the free tier's whole git story
|
||||
// as the popover's one-line pointer. There is nothing for a sheet to be about.
|
||||
@@ -150,7 +166,19 @@ enum BoardSettingsSection: String, Equatable, CaseIterable, Identifiable {
|
||||
case .none:
|
||||
return [.git]
|
||||
case .git:
|
||||
return [.branch, .commitIdentity]
|
||||
// **An unreadable repository hosts no setup either** (06-history-undo.md ▸ Rules, the
|
||||
// corrupt-`.git` loud failure, ruled 2026-07-31: "the whole git surface paused …
|
||||
// Lanework leaves the repository untouched"), and it lands on repo-nested's emptiness by
|
||||
// repo-nested's own reasoning, one step further along: both sections here are *writes* to
|
||||
// a repository — a branch created in it, an identity written into its config — and there
|
||||
// is no repository the app can open to write either into. An empty sheet would be the
|
||||
// greyed-out button 06 rules out one level up, so the surface simply does not exist for
|
||||
// such a board and the popover's own prose carries the explanation
|
||||
// (`BoardGitBranchSurface.unreadableNote`).
|
||||
//
|
||||
// The mode stays `.git` throughout — this is emptiness *within* git mode, never a fall
|
||||
// to mode none, which is what would let add-git be offered against an existing `.git`.
|
||||
return isRepositoryUnreadable ? [] : [.branch, .commitIdentity]
|
||||
case .repoNested:
|
||||
// **Nothing setup-shaped can apply** (06 ▸ Rules): the board lives inside a repository
|
||||
// Lanework leaves alone, so there is no add-git (the design is insistent that the option
|
||||
@@ -192,8 +220,16 @@ enum BoardSettingsSection: String, Equatable, CaseIterable, Identifiable {
|
||||
/// this board.
|
||||
enum BoardSettingsAvailability {
|
||||
|
||||
static func resolve(tier: Tier, mode: BoardGitMode) -> Bool {
|
||||
!BoardSettingsSection.resolve(tier: tier, mode: mode).isEmpty
|
||||
static func resolve(
|
||||
tier: Tier,
|
||||
mode: BoardGitMode,
|
||||
isRepositoryUnreadable: Bool = false
|
||||
) -> Bool {
|
||||
!BoardSettingsSection.resolve(
|
||||
tier: tier,
|
||||
mode: mode,
|
||||
isRepositoryUnreadable: isRepositoryUnreadable
|
||||
).isEmpty
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user