Comments join attachments on the card face — a quiet bubble-and-count chip, present-only
A card whose thread holds one comment or more now draws a second trailing chip beside the paperclip: a secondary-tinted bubble glyph plus its count, shown only when the count is above zero (design ruling 2026-08-09, card e729e30a). Same styling family as the attachments chip — caption size, secondary tint, decorative and hidden outright from the accessibility tree — but this one carries a visible count rather than staying icon-only, per the ruling's own "bubble-style SF Symbol + count." It sits after the attachments chip at the row's trailing edge, in both the live title row and the drag replica. The count is a new `Card.commentCount` field the loader fills with a readdir over `comments/`'s identity-shaped children that carry their own `index.md` — `BoardLoader.commentCount(in:)`, built on the same `identityShapedChildren` predicate a trash entry's held-card count already uses. Never a parse: `.draft` and `.trash/` are excluded for free, the same dot-prefixed hidden-entry skip `CommentThread.load` documents for both, so the walk stays exactly the O(cards) shape 01-storage-format.md § Enhanced schema already commits to. Because the count rides inside the `card: Card` parameter `CardFaceView` already takes — not a new parameter of its own — drawing the chip costs nothing beyond a field read on an already-compared value: no new Observable read joins the body, and the equatable gate already covers it via `Card`'s synthesized `Equatable`. The one divergence from the comments pane's parsed count is documented rather than hidden: a comment folder whose `index.md` exists but fails to parse is a `Stray` the thread read excludes by opening and rejecting it, a cost this readdir does not pay. The face may then read one comment high until that folder is fixed or removed — the trade the ruling's "cheap directory-entry count… not a parse" asks for, over paying full parse cost on every card of every load. Every well-formed comment, and every card with no malformed one, agrees with the pane exactly. VoiceOver: `AccessibilityPhrases.cardValue` gains a `comments: Int` parameter, appended after attachments and before the cut-pending phrase — the same left-to-right order the two chips draw in, so a sighted read and a VoiceOver read never disagree about which comes first. The trashed lane row's own call site (an opaque unit with no comments to speak of) passes `comments: 0`. Docs: DESIGN/03-board-ui.md's card-face section describes both chips and retires the stale "closed with no growth" sentence, honestly recording the 2026-08-09 growth (the hero banner landed hours earlier, this chip after it) as exposure of facts the card already carries rather than a body excerpt. DESIGN/10-accessibility.md's flattened-element sentence gains the comment count. DESIGN/01-storage-format.md's Enhanced schema paragraph records the chip as shipped. WISHLIST #9 is marked shipped in place — not renumbered, since #10 and #11 are cross-referenced elsewhere. Tests: CardCommentCountListingTests (BoardLoaderTests.swift) pins the readdir against a synthetic tree — no comments/ folder, an empty one, non-identity-shaped and index-less strays excluded, .draft/.trash/ excluded for free, agreement with CommentThread.load's parsed count in the well-formed case, and the one documented divergence on a malformed index.md. AccessibilityPhrasesTests covers cardValue's new parameter alone, alongside attachments, and all three fragments together. ViewEquatableTests pins that a comment landing on a card is a gate difference. BoardRenderPerformanceTests adds a render-cost guard: one comment added to one card on a hosted 180-card board re-renders a handful of bodies, not the board. Claude-Session: https://claude.ai/code/session_014PtZdPwqZuqEDLc6wZMtEy
This commit is contained in:
@@ -25,12 +25,18 @@ import os
|
||||
/// shape rule — `attachments` and `comments` are non-UUID-shaped and would read as strays, not
|
||||
/// levels, so they never need special-casing against the stray warning.
|
||||
///
|
||||
/// **Two reads inside a card folder**, both of them flat name listings and nothing more — neither
|
||||
/// opens a file, descends, warns, or fails a load; each degrades to `[]`:
|
||||
/// **Three reads inside a card folder**, all of them flat directory listings and nothing more —
|
||||
/// none opens a file's *contents*, descends past one level, warns, or fails a load; each degrades to
|
||||
/// its empty answer (`[]` or `0`):
|
||||
///
|
||||
/// - `attachmentNames(in:)` — `attachments/`, feeding `Card.attachments`. The board window's face
|
||||
/// needs it before a card window exists (the quiet paperclip indicator — 03-board-ui.md § Card
|
||||
/// face), and the snapshot is where it reads from.
|
||||
/// - `commentCount(in:)` — `comments/`, feeding `Card.commentCount` (design ruling 2026-08-09, card
|
||||
/// e729e30a). A count of identity-shaped children carrying `index.md`, never a parse of one — the
|
||||
/// distinction that keeps this a directory listing rather than the per-comment read
|
||||
/// `CommentThread.load` does, and keeps the walk O(cards) exactly as 01-storage-format.md §
|
||||
/// Enhanced schema's "the board snapshot never loads comment content" already required.
|
||||
/// - `looseFileNames(in:ignoring:)` — the card folder *itself*, feeding `LoadResult.looseCardFiles`.
|
||||
/// This is the loose-file carve-out's **detection** half (01-storage-format.md § Fractal layout ▸
|
||||
/// Rules, settled 2026-07-28): a regular file sitting beside a card's `index.md` belongs in
|
||||
@@ -694,6 +700,7 @@ public enum BoardLoader: Sendable {
|
||||
storedOrder: Double?,
|
||||
heldCards: Int,
|
||||
attachments: [String],
|
||||
commentCount: Int,
|
||||
document: FrontmatterDocument
|
||||
)] = []
|
||||
var trashKinds: [ItemID: IntegrityRules.ObjectKind] = [:]
|
||||
@@ -764,8 +771,9 @@ public enum BoardLoader: Sendable {
|
||||
// **The subtree is counted, never walked** (03-board-ui.md § Trash: an opaque unit
|
||||
// showing its title and held-card count). The count is the same listing the shape
|
||||
// fallback asks for, so a `kind: lane` entry pays for exactly one directory read and a
|
||||
// kindless one pays for none extra — and a card pays for its attachment listing only,
|
||||
// which is why each side is read under its own arm rather than unconditionally.
|
||||
// kindless one pays for none extra — and a card pays for its attachment listing and its
|
||||
// comment count only, which is why each side is read under its own arm rather than
|
||||
// unconditionally.
|
||||
//
|
||||
// Neither `kind: board` nor `kind: comment` reaches here as itself — `trashKind` treats
|
||||
// both as unrecognized and answers by shape — so the non-lane arm is the card answer and
|
||||
@@ -778,6 +786,7 @@ public enum BoardLoader: Sendable {
|
||||
storedOrder: order.order,
|
||||
heldCards: isLane ? children().count : 0,
|
||||
attachments: isLane ? [] : attachmentNames(in: entryURL),
|
||||
commentCount: isLane ? 0 : commentCount(in: entryURL),
|
||||
document: document
|
||||
))
|
||||
}
|
||||
@@ -831,6 +840,7 @@ public enum BoardLoader: Sendable {
|
||||
hero: document.hero,
|
||||
order: order,
|
||||
attachments: entry.attachments,
|
||||
commentCount: entry.commentCount,
|
||||
document: document
|
||||
))
|
||||
}
|
||||
@@ -1115,6 +1125,7 @@ public enum BoardLoader: Sendable {
|
||||
/// input to `Ranks.resolvedOrders(of:stored:name:)`.
|
||||
let storedOrder: Double?
|
||||
let attachments: [String]
|
||||
let commentCount: Int
|
||||
let document: FrontmatterDocument
|
||||
/// This card's coerce-tier records for the strict fields, which only the rulebook can make
|
||||
/// (a missing key leaves no trace in `document.coercedFields`).
|
||||
@@ -1141,6 +1152,7 @@ public enum BoardLoader: Sendable {
|
||||
hero: document.hero,
|
||||
order: order,
|
||||
attachments: attachments,
|
||||
commentCount: commentCount,
|
||||
document: document
|
||||
)
|
||||
}
|
||||
@@ -1156,10 +1168,10 @@ public enum BoardLoader: Sendable {
|
||||
/// `path` is root-relative and names the *folder*; the errors this throws name its `index.md`.
|
||||
/// Callers guard `isUUIDShaped` and `hasIndex` first, exactly as the lane walk always has.
|
||||
///
|
||||
/// The **attachment listing stays fresh** here, memo or no memo (`ParseMemo` ▸ Scope): a hit
|
||||
/// spares this card's `index.md` read and nothing else, because an attachment arriving in
|
||||
/// `attachments/` never touches `index.md` and a card whose paperclip went stale would be the
|
||||
/// memo lying about the tree.
|
||||
/// The **attachment listing and the comment count stay fresh** here, memo or no memo (`ParseMemo`
|
||||
/// ▸ Scope): a hit spares this card's `index.md` read and nothing else, because a file arriving
|
||||
/// in `attachments/` or a comment arriving in `comments/` never touches `index.md`, and a card
|
||||
/// whose paperclip or comment chip went stale would be the memo lying about the tree.
|
||||
private static func parseCard(
|
||||
at cardURL: URL,
|
||||
path: String,
|
||||
@@ -1182,6 +1194,7 @@ public enum BoardLoader: Sendable {
|
||||
schema: schema.schema,
|
||||
storedOrder: order.order,
|
||||
attachments: attachmentNames(in: cardURL),
|
||||
commentCount: commentCount(in: cardURL),
|
||||
document: document,
|
||||
coercions: [schema.coerced, order.coerced].compactMap { $0 },
|
||||
stamp: read.stamp
|
||||
@@ -1281,6 +1294,32 @@ public enum BoardLoader: Sendable {
|
||||
.sorted { $0.localizedStandardCompare($1) == .orderedAscending }
|
||||
}
|
||||
|
||||
/// The number of comments `<card>/comments/` holds — **a readdir, not a parse** (design ruling
|
||||
/// 2026-08-09, card e729e30a; WISHLIST #9's own suggested shape). `0` when there is no
|
||||
/// `comments/` at all, which is the overwhelmingly common card.
|
||||
///
|
||||
/// **The same predicate `identityShapedChildren(of:)` already uses for a trash entry's held-card
|
||||
/// count**: children of the folder that are both identity-shaped and carry their own `index.md`
|
||||
/// — no YAML opened, no frontmatter parsed. `.draft` and `.trash/` need no special-casing here
|
||||
/// either: both are dot-prefixed, and `directoryCandidates` (`identityShapedChildren`'s own
|
||||
/// source) skips hidden entries, exactly the exclusion `CommentThread.load` documents for the
|
||||
/// same two folders.
|
||||
///
|
||||
/// **Diverges from `CommentThread.load`'s parsed `comments.count` in exactly one case**: a
|
||||
/// folder whose `index.md` exists but fails to parse (not UTF-8, unparseable YAML) is a `Stray`
|
||||
/// the thread read excludes by actually opening and rejecting it — a cost this count does not
|
||||
/// pay, because paying it for every card on every load is precisely the O(cards × parsed
|
||||
/// comments) walk 01-storage-format.md § Enhanced schema keeps out of the snapshot. The chip may
|
||||
/// then read one comment high until that one folder is fixed or removed; every well-formed
|
||||
/// comment, and every card with no malformed one, agrees with the pane exactly.
|
||||
///
|
||||
/// Internal rather than `private`, `attachmentNames(in:)`'s own reason: nothing outside this file
|
||||
/// calls it today, but the count belongs beside the enumeration it is built from
|
||||
/// (`identityShapedChildren`), not duplicated at a second call site later.
|
||||
static func commentCount(in cardFolder: URL) -> Int {
|
||||
identityShapedChildren(of: CommentThread.folder(inCard: cardFolder)).count
|
||||
}
|
||||
|
||||
/// A card folder's **loose top-level files** — the one carve-out to uniform stray tolerance
|
||||
/// (01-storage-format.md § Fractal layout ▸ Rules, settled 2026-07-28, "Lanework-owns-the-board"):
|
||||
/// "a regular file sitting beside a card's `index.md` (not `attachments/`, not a reserved name)
|
||||
|
||||
@@ -236,11 +236,14 @@ public struct Lane: Identifiable, Sendable, Equatable {
|
||||
public var isDeleted: Bool { !deleted.isMissing }
|
||||
}
|
||||
|
||||
/// A card: `<root>/<guid>/<guid>/index.md`, plus the *names* of its attachments. Structurally
|
||||
/// still a leaf — `comments/` (future, out-of-scope) and the attachment files' contents live
|
||||
/// alongside `index.md` on disk and are not modeled here; `attachments` is the one thing the
|
||||
/// snapshot reaches inside a card folder for, because two board-window surfaces need it before
|
||||
/// any card window exists (see its own doc comment).
|
||||
/// A card: `<root>/<guid>/<guid>/index.md`, plus the *names* of its attachments and a *count* of
|
||||
/// its comments. Structurally still a leaf — the attachment files' contents and every comment's
|
||||
/// own frontmatter and body live alongside `index.md` on disk and are not modeled here; `comments/`
|
||||
/// stays window-scoped exactly as 01-storage-format.md § Enhanced schema rules ("the board snapshot
|
||||
/// never loads comment content"), and `commentCount` does not change that — it is a readdir, not a
|
||||
/// parse. `attachments` and `commentCount` are what the snapshot reaches inside a card folder for,
|
||||
/// because board-window surfaces need them before any card window exists (see each field's own doc
|
||||
/// comment).
|
||||
public struct Card: Identifiable, Sendable, Equatable {
|
||||
public let id: ItemID
|
||||
|
||||
@@ -293,6 +296,24 @@ public struct Card: Identifiable, Sendable, Equatable {
|
||||
/// `index.md` does — no separate invalidation path to keep honest.
|
||||
public let attachments: [String]
|
||||
|
||||
/// The card's comment count — **a readdir, not a parse** (design ruling 2026-08-09, card
|
||||
/// e729e30a; WISHLIST #9's own suggested shape). Counts `comments/`'s identity-shaped children
|
||||
/// that carry a readable `index.md` (`BoardLoader.commentCount(in:)`, `identityShapedChildren`'s
|
||||
/// pattern) — the same cost class as `attachments` above, so the walk stays O(cards) exactly as
|
||||
/// 01-storage-format.md § Enhanced schema requires. It agrees with `CommentThread.load`'s parsed
|
||||
/// count in the overwhelming case; the one divergence is a comment whose `index.md` exists but
|
||||
/// fails to parse (bad YAML, non-UTF-8), which the thread read excludes as a `Stray` and this
|
||||
/// count does not pay to detect — the face may then read one comment high until that folder is
|
||||
/// fixed or removed. `.draft` and `.trash/` are excluded for free, the way they are everywhere
|
||||
/// else this thread is read: both are dot-prefixed, and the loader's directory listing skips
|
||||
/// hidden entries.
|
||||
///
|
||||
/// The board-window comments pane feeds the face's chip nothing — this field is the one and only
|
||||
/// source, so a chip and the pane it opens onto can never quietly show two different numbers for
|
||||
/// the same reason (the divergence above aside, which is a stray on disk, not a bug in either
|
||||
/// reader).
|
||||
public let commentCount: Int
|
||||
|
||||
/// The full parsed `index.md`; unknown/reserved keys ride along uninterpreted.
|
||||
public let document: FrontmatterDocument
|
||||
|
||||
|
||||
@@ -128,17 +128,27 @@ enum AccessibilityPhrases {
|
||||
/// the dim is the sighted signal, this is the other one.
|
||||
static let cutPending = "cut, pending paste"
|
||||
|
||||
/// A card element's value — the attachment count when it has files, the cut-pending phrase when
|
||||
/// it is staged for paste, both when both, and **the empty string when neither**.
|
||||
/// A card element's value — the attachment count and the comment count when the card has either
|
||||
/// (design ruling 2026-08-09, card e729e30a — the comments chip's face value gains "N comments"
|
||||
/// beside the existing attachment wording), the cut-pending phrase when it is staged for paste,
|
||||
/// any mix of the three, and **the empty string when none apply**.
|
||||
///
|
||||
/// **Attachments before comments**, matching the chips' own left-to-right order on the face
|
||||
/// (`CardFaceView.titleRow`: attachments, then comments) — one reading order for the two
|
||||
/// surfaces, so a sighted user's eye and a VoiceOver user's ear never disagree about which comes
|
||||
/// first. `commentCount` is `AccessibilityPhrases`' own — the pane's plural folding, reused
|
||||
/// rather than restated, so a face value and the comments pane's header can never fold "1
|
||||
/// comment" two different ways.
|
||||
///
|
||||
/// Empty rather than `nil` on purpose: the modifier that consumes it is unconditional, because a
|
||||
/// `if` around `.accessibilityValue` would put the whole card face inside a `_ConditionalContent`
|
||||
/// that flips identity — and therefore rebuilds the face, dropping its measured height and its
|
||||
/// marquee registration — the moment an attachment lands or a cut is pasted. An empty AXValue
|
||||
/// speaks as nothing, which is exactly what "no value" should sound like.
|
||||
static func cardValue(attachments: Int, isCutPending: Bool) -> String {
|
||||
/// marquee registration — the moment an attachment lands, a comment posts, or a cut is pasted. An
|
||||
/// empty AXValue speaks as nothing, which is exactly what "no value" should sound like.
|
||||
static func cardValue(attachments: Int, comments: Int, isCutPending: Bool) -> String {
|
||||
var parts: [String] = []
|
||||
if attachments > 0 { parts.append(attachmentCount(attachments)) }
|
||||
if comments > 0 { parts.append(commentCount(comments)) }
|
||||
if isCutPending { parts.append(cutPending) }
|
||||
return parts.joined(separator: ", ")
|
||||
}
|
||||
|
||||
@@ -185,11 +185,20 @@ enum BoardMetrics {
|
||||
em(0.75, bodyPointSize: bodyPointSize)
|
||||
}
|
||||
|
||||
/// Between the icon, the title and the attachments chip.
|
||||
/// Between the icon, the title and the two trailing chips — attachments, then comments
|
||||
/// (`CardFaceView.titleRow`; the comments chip joined 2026-08-09).
|
||||
static func cardRowSpacing(bodyPointSize: CGFloat) -> CGFloat {
|
||||
em(0.45, bodyPointSize: bodyPointSize)
|
||||
}
|
||||
|
||||
/// Inside the comments chip only: between its bubble glyph and its count text
|
||||
/// (`CardFaceView.commentsIndicator`) — tighter than `cardRowSpacing`, which separates the
|
||||
/// face's own row items, because this is one chip's internal rhythm, closer to a badge's own
|
||||
/// glyph-to-digit spacing than to a row gap.
|
||||
static func chipGlyphSpacing(bodyPointSize: CGFloat) -> CGFloat {
|
||||
em(0.2, bodyPointSize: bodyPointSize)
|
||||
}
|
||||
|
||||
/// The masonry's spacing — between interior columns and between stacked cards within a column.
|
||||
///
|
||||
/// The lane registers this into `LaneDropRegistry.Grid`, so the drop model's analytic resting
|
||||
|
||||
@@ -82,8 +82,9 @@ enum CardFaceRole: Sendable {
|
||||
// MARK: - Card face
|
||||
|
||||
/// The card face: a rounded plate carrying a leading SF Symbol, the title (or its quiet "Untitled"
|
||||
/// placeholder), a quiet trailing attachments indicator, and a left-edge colour accent stripe
|
||||
/// (03-board-ui.md § Card face, § Styling ▸ Capabilities).
|
||||
/// placeholder), two quiet trailing chips — attachments and comments, each present-only — and a
|
||||
/// left-edge colour accent stripe (03-board-ui.md § Card face, § Styling ▸ Capabilities). The
|
||||
/// comments chip joined 2026-08-09 (design ruling, card e729e30a).
|
||||
///
|
||||
/// ### One face, two containers
|
||||
///
|
||||
@@ -96,10 +97,13 @@ enum CardFaceRole: Sendable {
|
||||
///
|
||||
/// ### Title-only, deliberately
|
||||
///
|
||||
/// **No body excerpt** — settled, "the face stays title-only … the old 'iterate on the card face
|
||||
/// later' item is closed with no growth". The only face chip in scope is attachments, "a quiet
|
||||
/// indicator when the card has files — the title dominates", which is why the paperclip is a
|
||||
/// secondary-tinted caption and not a count pill: the eye should land on the title.
|
||||
/// **No body excerpt** — settled, and still true after 2026-08-09's growth (the hero banner, the
|
||||
/// comments chip): the face never draws a preview of the card's own prose, and never will — what
|
||||
/// grew is exposure of facts the card already carries structurally (an attachment named as hero, a
|
||||
/// folder count), not content. Two face chips are in scope: **attachments**, "a quiet indicator when
|
||||
/// the card has files — the title dominates", and **comments**, its same-vocabulary twin — a
|
||||
/// secondary-tinted glyph (plus a count, for comments — see `commentsIndicator`) rather than a count
|
||||
/// pill, so the eye still lands on the title first.
|
||||
///
|
||||
/// ### Two lenient fields, two different fallbacks
|
||||
///
|
||||
@@ -356,11 +360,12 @@ struct CardFaceView: View, Equatable {
|
||||
// `isRenaming` is (`CardFaceRole`).
|
||||
.accessibilityElement(children: isRenaming ? .contain : .ignore)
|
||||
.accessibilityLabel(AccessibilityPhrases.cardLabel(title: card.title.value))
|
||||
// The attachment count, the deferred cut's "cut, pending paste", or both — and the empty
|
||||
// string when neither, which speaks as nothing (see `AccessibilityPhrases.cardValue` for why
|
||||
// it is not a conditional modifier).
|
||||
// The attachment count, the comment count, the deferred cut's "cut, pending paste", or any
|
||||
// mix of the three — and the empty string when none apply, which speaks as nothing (see
|
||||
// `AccessibilityPhrases.cardValue` for why it is not a conditional modifier).
|
||||
.accessibilityValue(AccessibilityPhrases.cardValue(
|
||||
attachments: card.attachments.count,
|
||||
comments: card.commentCount,
|
||||
isCutPending: store.transient.pendingCut.ids.contains(card.id)
|
||||
))
|
||||
// "Selection state is always readable from the element (trait)" — the other half of "state
|
||||
@@ -652,6 +657,7 @@ struct CardFaceView: View, Equatable {
|
||||
.lineLimit(4)
|
||||
.frame(maxWidth: .infinity, alignment: .leading)
|
||||
attachmentsIndicator
|
||||
commentsIndicator
|
||||
}
|
||||
.padding(BoardMetrics.cardContentPadding(bodyPointSize: pointSize))
|
||||
.padding(.leading, stripeWidth)
|
||||
@@ -861,10 +867,11 @@ struct CardFaceView: View, Equatable {
|
||||
.foregroundStyle(iconTint)
|
||||
.imageScale(.medium)
|
||||
titleOrEditor
|
||||
// The title takes the row's width so the indicator sits hard against the trailing
|
||||
// The title takes the row's width so the chips sit hard against the trailing
|
||||
// edge — and so the rename field fills the same span the title occupied.
|
||||
.frame(maxWidth: .infinity, alignment: .leading)
|
||||
attachmentsIndicator
|
||||
commentsIndicator
|
||||
}
|
||||
}
|
||||
|
||||
@@ -908,8 +915,8 @@ struct CardFaceView: View, Equatable {
|
||||
}
|
||||
}
|
||||
|
||||
/// The one face chip in scope — shown only when the card actually has files, and quiet enough
|
||||
/// that the title still dominates (03-board-ui.md § Card face). The count goes to the
|
||||
/// One of the two face chips in scope — shown only when the card actually has files, and quiet
|
||||
/// enough that the title still dominates (03-board-ui.md § Card face). The count goes to the
|
||||
/// accessibility *value* rather than onto the face: it is useful to know, not to look at.
|
||||
///
|
||||
/// **Decorative, and hidden outright** (10-accessibility.md): "face icon and chips are
|
||||
@@ -927,6 +934,37 @@ struct CardFaceView: View, Equatable {
|
||||
}
|
||||
}
|
||||
|
||||
/// The comments chip — attachments' twin, joined 2026-08-09 (design ruling, card e729e30a):
|
||||
/// shown only when the card has one comment or more, same secondary-tinted, decorative,
|
||||
/// present-only vocabulary as `attachmentsIndicator`. **Carries a visible count**, unlike the
|
||||
/// paperclip, because the ruling asks for "a quiet indicator (bubble-style SF Symbol + count)" —
|
||||
/// still quiet (caption size, secondary tint, no pill background), just not icon-only; the count
|
||||
/// answers "how many" the way a lane's own card-count badge does one level up, without spending a
|
||||
/// tap to find out.
|
||||
///
|
||||
/// **`card.commentCount` is the one and only source** — a snapshot field the loader fills with a
|
||||
/// readdir (`BoardLoader.commentCount(in:)`, `Card.commentCount`'s own doc comment), never a
|
||||
/// per-face parse — so drawing this chip costs nothing beyond reading a field already on the
|
||||
/// compared `card` parameter (RENDER-INSTRUMENTATION.md ▸ Selection is O(board) in card bodies:
|
||||
/// no new Observable read joins this body, and no new `CardFaceView` parameter was needed either,
|
||||
/// since the count already rides inside `card`).
|
||||
///
|
||||
/// **Decorative and hidden outright**, `attachmentsIndicator`'s exact reasons: the flattened
|
||||
/// element carries the comment count in its value (`AccessibilityPhrases.cardValue`), so a label
|
||||
/// here would be redundant even before the flattening drops it.
|
||||
@ViewBuilder
|
||||
private var commentsIndicator: some View {
|
||||
if card.commentCount > 0 {
|
||||
HStack(spacing: BoardMetrics.chipGlyphSpacing(bodyPointSize: pointSize)) {
|
||||
Image(systemName: "bubble")
|
||||
Text("\(card.commentCount)")
|
||||
}
|
||||
.boardFont(.caption)
|
||||
.foregroundStyle(.secondary)
|
||||
.accessibilityHidden(true)
|
||||
}
|
||||
}
|
||||
|
||||
/// K1 · left edge stripe, painted with the resolved `background` — "a card's [colour paints] a
|
||||
/// stripe along its left edge; the surfaces themselves keep the standard chrome, so coloured
|
||||
/// title text never sits on a coloured fill" (03-board-ui.md § Styling ▸ Capabilities).
|
||||
|
||||
@@ -168,9 +168,11 @@ struct TrashLaneRowView: View, Equatable {
|
||||
.accessibilityElement(children: .ignore)
|
||||
.accessibilityLabel(AccessibilityPhrases.trashedLaneLabel(title: lane.title.value, cards: lane.heldCards))
|
||||
// The cut-pending phrase, on the row's value — the card element's rule, minus the attachment
|
||||
// count an opaque unit has no answer for.
|
||||
// and comment counts an opaque unit has no answer for (comments are card-level only, and a
|
||||
// trashed lane's cards are not individually addressable).
|
||||
.accessibilityValue(AccessibilityPhrases.cardValue(
|
||||
attachments: 0,
|
||||
comments: 0,
|
||||
isCutPending: store.transient.pendingCut.ids.contains(lane.id)
|
||||
))
|
||||
.accessibilityAddTraits(isSelected ? [.isSelected] : [])
|
||||
|
||||
Reference in New Issue
Block a user