-
Notifications
You must be signed in to change notification settings - Fork 389
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(boards2): pagination #3586
base: devx/feature/boardsv2
Are you sure you want to change the base?
feat(boards2): pagination #3586
Conversation
🛠 PR Checks Summary🔴 Maintainers must be able to edit this pull request (more info) Manual Checks (for Reviewers):
Read More🤖 This bot helps streamline PR reviews by verifying automated checks and providing guidance for contributors and reviewers. ✅ Automated Checks (for Contributors):🔴 Maintainers must be able to edit this pull request (more info) ☑️ Contributor Actions:
☑️ Reviewer Actions:
📚 Resources:Debug
|
page := p.Iterate(&post.replies, func(_ string, value interface{}) bool { | ||
reply := value.(*Post) | ||
|
||
sb.WriteString(indent) | ||
sb.WriteString("\n") | ||
sb.WriteString(reply.Render(nil, commentsIndent, levels-1)) | ||
return false | ||
}) | ||
|
||
if page != nil { | ||
sb.WriteString("\n---\n") | ||
sb.WriteString(page.Picker()) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should be optional because p
could be nil
. Shouldn't we make sure not to render pager when p == nil
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@jeronimoalbi check content of p.Iterate
which is nil
-safe actually.
https://goplay.tools/snippet/dBX1Td7u68w
func (opts *PaginationOpts) Iterate(tree *avl.Tree, cb func(k string, val interface{}) bool) *pager.Page {
if opts == nil {
tree.Iterate("", "", cb)
return nil
}
....
}
Implement pagination for boards, threads and replies.
Closes #3200, #3539
CC @jeronimoalbi @salmad3