From b928e27c18242d06d3c5ba136668128f0f41dd92 Mon Sep 17 00:00:00 2001 From: Eric Bailey Date: Tue, 14 Oct 2025 10:08:07 -0500 Subject: [PATCH] Update comments --- src/state/queries/usePostThread/traversal.ts | 6 +++--- src/state/queries/usePostThread/types.ts | 12 ++++++------ 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/src/state/queries/usePostThread/traversal.ts b/src/state/queries/usePostThread/traversal.ts index f4e6e39c28..19cb522cd5 100644 --- a/src/state/queries/usePostThread/traversal.ts +++ b/src/state/queries/usePostThread/traversal.ts @@ -135,10 +135,10 @@ export function sortAndAnnotateThreadItems( } else if (AppBskyUnspeccedDefs.isThreadItemPost(item.value)) { if (parentMetadata) { /* - * Set this value before incrementing the parent's repliesSeenCounter + * Set this value before incrementing the `repliesIndexCounter`, since + * `repliesIndexCounter` is 1-indexed and `replyIndex` is 0-indexed. */ metadata!.replyIndex = parentMetadata.repliesIndexCounter - // Increment the parent's repliesIndexCounter parentMetadata.repliesIndexCounter += 1 } @@ -193,7 +193,7 @@ export function sortAndAnnotateThreadItems( storeTraversalMetadata(metadatas, childMetadata) if (childParentMetadata) { /* - * Set this value before incrementing the parent's + * Set this value before incrementing the * `repliesIndexCounter`, since `repliesIndexCounter` is * 1-indexed and `replyIndex` is 0-indexed. */ diff --git a/src/state/queries/usePostThread/types.ts b/src/state/queries/usePostThread/types.ts index 926f223b68..785e865f34 100644 --- a/src/state/queries/usePostThread/types.ts +++ b/src/state/queries/usePostThread/types.ts @@ -201,9 +201,9 @@ export type TraversalMetadata = { * After traversal, we can use this to calculate if we actually got all the * replies we expected, or if some were blocked, etc. * - * Because this value is incremented startging from 0, it is 1-indexed. So to - * when comparing to the `replyIndex`, you'll need to subtract 1 from this - * value. + * Note: this is a "counter", not an "index". Because this value is + * incremented starting from 0, it is 1-indexed. So to when comparing to the + * `replyIndex`, you'll need to subtract 1 from this value. */ repliesSeenCounter: number /** @@ -211,9 +211,9 @@ export type TraversalMetadata = { * for populating the `replyIndex` of the post by referencing this value on * the parent. * - * Because this value is incremented startging from 0, it is 1-indexed. So to - * when comparing to the `replyIndex`, you'll need to subtract 1 from this - * value. + * Note: this is a "counter", not an "index". Because this value is + * incremented starting from 0, it is 1-indexed. So to when comparing to the + * `replyIndex`, you'll need to subtract 1 from this value. */ repliesIndexCounter: number /**