Skip to content

Conversation

@c-julin
Copy link
Contributor

@c-julin c-julin commented Jan 24, 2026

Summary

Fixes an issue where searching/filtering messages while on page 2+ would show no results because the pagination index exceeded the filtered result set.

Changes

  • Bound pageIndex to valid range based on filtered results count
  • Preserves original pageIndex state so clearing the search returns to the same page

Test plan

  • Navigate to a topic with enough messages to have multiple pages
  • Go to page 2
  • Use the "Filter table content" search box to filter messages
  • Verify results are displayed (previously showed empty)
  • Clear the search and verify you return to page 2

Bound pageIndex to valid range based on filtered results so searching
while on page 2+ shows results instead of empty page. The original
pageIndex is preserved so clearing the search returns to the same page.

// Message Table rendering variables and functions
// Bound pageIndex to valid range based on filtered results
const totalPages = Math.max(1, Math.ceil(filteredMessages.length / pageSize));
Copy link
Collaborator

@jvorcak jvorcak Jan 26, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

isn't there some util function for this already?, if not shouldn't there be some?

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

Successfully merging this pull request may close these issues.

3 participants