Address review feedback on nested reply threading

- Remove invalid aria-setsize={-1}; the real set size isn't tracked here.
- Make aria-expanded an explicit boolean and keep aria-controls consistent
  across active/inactive Reply buttons.
- Fix cycle field docstring to match its boolean type.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01BYiUtZMQeA5RHggQw73wto
This commit is contained in:
2026-09-07 21:55:51 +02:00
parent 924438f6b7
commit 7d2bd1c03e
3 changed files with 3 additions and 4 deletions

View File

@@ -334,7 +334,6 @@ function ThreadNode({
<div
role="treeitem"
aria-level={depth}
aria-setsize={-1}
aria-expanded={node.children.length > 0 ? true : undefined}
className={cn(
!isRootReply &&

View File

@@ -74,8 +74,8 @@ export function NoteCard({ event, compact, onReply, replyOpen, className }: Note
size="sm"
className="h-7 gap-1.5 px-2 text-xs text-muted-foreground"
onClick={() => onReply(event)}
aria-expanded={replyOpen}
aria-controls={replyOpen ? 'reply-composer' : undefined}
aria-expanded={!!replyOpen}
aria-controls="reply-composer"
>
<MessageSquareReply className="size-3.5" aria-hidden />
Reply

View File

@@ -144,7 +144,7 @@ export interface ReplyNode {
children: ReplyNode[];
/** True when the event landed here as a fallback, not via its NIP-10 tags. */
misplaced: boolean;
/** Depth of the cycle this event is part of, when its chain loops. */
/** Whether this event's chain loops back on itself. */
cycle?: boolean;
}