This commit is contained in:
Eric Bailey
2025-05-27 13:32:28 -05:00
parent 7a7708348a
commit 3223ab859b
4 changed files with 102 additions and 100 deletions
+4 -4
View File
@@ -56,8 +56,7 @@ export function flatten(
i + 1 + (pi - parents.length),
0,
views.readMore({
item,
parent: parent,
parent,
}),
)
parents.pop()
@@ -94,8 +93,7 @@ export function flatten(
i + 2 + (pi - parents.length),
0,
views.readMore({
item,
parent: parent,
parent,
}),
)
parents.pop()
@@ -116,6 +114,8 @@ export function flatten(
}
}
console.log(flattened)
/*
* Insert hidden items and buttons to show them
*/
+1 -3
View File
@@ -101,16 +101,14 @@ export function threadPost({
}
export function readMore({
item,
parent,
}: {
item: Extract<Slice, {type: 'threadPost'}>
parent: Extract<Slice, {type: 'threadPost'}>
}) {
return {
type: 'readMore' as const,
key: `readMore:${parent.uri}`,
indent: parent.depth + (item.depth < parent.depth ? -1 : 0),
indent: parent.depth,
replyCount: parent.value.moreReplies,
nextAnchor: parent,
nextAnchorUri: new AtUri(parent.uri),