Skip to content
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

[r/boards] initialize pagination #3200

Open
7 tasks
salmad3 opened this issue Nov 26, 2024 · 0 comments
Open
7 tasks

[r/boards] initialize pagination #3200

salmad3 opened this issue Nov 26, 2024 · 0 comments

Comments

@salmad3
Copy link
Member

salmad3 commented Nov 26, 2024

Context:

Implement pagination for listing boards and threads within the r/boards realm. The existing avl pager package provides a foundation for this functionality, which we'll adapt and extend to meet the needs of boards. Pagination for comments and nested comments being discussed and will follow this update.

Acceptance Criteria:

  • Implements pagination for listing boards using the existing avl pager package:

    Example
    boardsPager := pager.NewPager(boardsTree, defaultPageSize)
    page := boardsPager.GetPage(pageNumber)
  • Implements pagination for listing threads within a board:

    Example
    threadsPager := pager.NewPager(board.ThreadsTree, defaultPageSize)
    page := threadsPager.GetPageWithSize(pageNumber, pageSize)
  • Extends the UI to display paginated results and navigation controls using the Selector() method:

    Example
    paginationUI := page.Selector()
  • Uses a hardcoded default page size to start (e.g., 10 items per page)

  • Handles invalid page numbers or sizes gracefully by defaulting to the first page

  • Ensures compatibility with existing board-related structs

  • Includes unit tests for pagination functionality

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant