Build the VoiceOver tree and actions
The board window's accessibility tree per DESIGN/10: lanes are containers labeled "<title>, lane, N cards" (filter-aware count = renderedCards, the badge's own collection); cards are one flattened element each — label = title or the untitled placeholder, value = attachment count + "cut, pending paste", selection via trait; face icon, stripe, and paperclip are decorative and hidden. Masonry never leaks into traversal: slots carry order-keyed accessibilitySortPriority, so a wide lane reads by card order, not column-major. Lane titles carry the heading trait for the rotor. VO-Space is the ⌘-click analogue routed through the existing BoardStore.click funnel (SelectionGrammar stays the single answer for toggle and container-boundary rules) — cards and lane headers both. Context-menu rows double as custom accessibility actions, each calling the same private method as its menu row so the surfaces cannot drift; trash cards expose Delete and Reveal in Finder and never Open. The trash column is pinned last via sort priority 0, its label/value re-routed through the new AccessibilityPhrases seam; toggling trash visibility posts a one-line announcement from the store seam (both command faces). The invisible lane-resize drag strip leaves the tree — the stepper and menu items are the accessible width path. AccessibilityPhrases is the pure vocabulary seam (labels, values, plural folding shared with TrashModel.phrase), pinned by its own test suite. Both schemes build; 1466 unit tests green. Claude-Session: https://claude.ai/code/session_01SR4XGjmBE16ZUYWpfFHXwY
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
import AppKit
|
||||
import Observation
|
||||
import SwiftUI
|
||||
|
||||
@@ -290,6 +291,32 @@ extension BoardStore {
|
||||
clearSelection()
|
||||
}
|
||||
}
|
||||
announceTrashVisibility(shown)
|
||||
}
|
||||
|
||||
/// **"Toggling visibility is announced"** (10-accessibility.md ▸ Trash lane).
|
||||
///
|
||||
/// A whole container joins or leaves the accessibility tree here and nothing else marks it: the
|
||||
/// VoiceOver cursor does not move, no focus is lost, and the re-divide every lane performs is
|
||||
/// silent by nature. Announced from the store rather than from either caller for
|
||||
/// `setTrashVisible`'s own reason — the View menu row and the toolbar item are one command with
|
||||
/// two faces, and a consequence written at one of them would be missing from the other.
|
||||
///
|
||||
/// One post, and deliberately no machinery around it: the live board's announcements — foreign
|
||||
/// edits, vanishing focus, bracketed operations — are their own design (10 ▸ Live board
|
||||
/// announcements) with a summarizer and a debounce behind them, and this is not an instalment of
|
||||
/// that. Posted to the key window so it is attributed to the board the user is looking at, at
|
||||
/// medium priority: informative, and not worth interrupting speech already in progress.
|
||||
private func announceTrashVisibility(_ shown: Bool) {
|
||||
let element: Any = NSApplication.shared.keyWindow ?? NSApplication.shared
|
||||
NSAccessibility.post(
|
||||
element: element,
|
||||
notification: .announcementRequested,
|
||||
userInfo: [
|
||||
.announcement: AccessibilityPhrases.trashVisibility(shown: shown),
|
||||
.priority: NSAccessibilityPriorityLevel.medium.rawValue
|
||||
]
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user