Skip to content

feat(top): add vertical pagination to statistics views - #152

Open
zbinorama wants to merge 1 commit into
lesovsky:masterfrom
zbinorama:top_vertical_scroll
Open

zbinorama wants to merge 1 commit into
lesovsky:masterfrom
zbinorama:top_vertical_scroll

Conversation

@zbinorama

@zbinorama zbinorama commented Sep 11, 2026

Copy link
Copy Markdown
Contributor

Summary

Large statistics views in pgcenter top could not be fully inspected when
the result contained more rows than fit in the terminal.

This change adds vertical pagination using PgUp and PgDn:

  • keeps the table header visible while paging;
  • preserves the current snapshot during redraws;
  • clamps the vertical offset after filtering, refresh, and terminal resize;
  • preserves horizontal column scrolling;
  • resets the vertical position when switching views or changing sorting/filtering;
  • adds tests for pagination, filtering, redraws, header rendering, and scroll offsets.

Validation

  • make test
  • make build
  • Manual TUI verification with PostgreSQL fixtures on port 21917
  • Verified PgDnPgDnPgUp with a result exceeding terminal height

Follow-up

Horizontal scrolling remains on the existing viewCh redraw path. It is
outside the scope of this change, but could be migrated to the dedicated
redrawCh path in a follow-up change.

AI assistance: OpenAI Codex was used to assist with the implementation and tests. The changes were reviewed and validated by the author.

Add PgUp and PgDn handlers for paging through rows in the main statistics
view while keeping the table header visible.

Preserve the current snapshot during redraws, clamp the vertical offset after
filtering, refresh, and terminal resize, and retain the horizontal column
position.

Add tests for page offsets, filtered rows, redraw behavior, header rendering,
horizontal offset preservation, and the PgUp/PgDn handlers.
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.

1 participant