Skip to content

fix(desktop): Stabilize Discover pagination bar width#545

Open
Augustas11 wants to merge 1 commit into
AntSeed:mainfrom
Augustas11:fix/desktop-discover-pagination-shift
Open

fix(desktop): Stabilize Discover pagination bar width#545
Augustas11 wants to merge 1 commit into
AntSeed:mainfrom
Augustas11:fix/desktop-discover-pagination-shift

Conversation

@Augustas11
Copy link
Copy Markdown
Contributor

Fixes #498.

Problem

The pagination bar at the bottom of the Discover page shifts horizontally as users navigate between pages. buildPaginationTokens in apps/desktop/src/renderer/ui/components/chat/DiscoverWelcome.tsx:332 returns:

  • 6 tokens for edges (page <= 3 or page >= totalPages - 2): [1, 2, 3, '…', N-1, N]
  • 7 tokens for middle pages: [1, '…', p-1, p, p+1, '…', N]

.pagination has no reserved width, so the container resizes with the token count and the bar visibly jumps.

Fix

One-line CSS change: add min-width: 240px to .pagination in apps/desktop/src/renderer/ui/components/chat/DiscoverWelcome.module.scss. 240px holds the widest layout (7 tokens × 28px button min-width + 6 × 4px gaps + 2 ellipses + headroom for two-digit page numbers).

Test plan

  • Open Discover with enough providers to produce 5+ pages
  • Click through pages 1 → 2 → 3 → 4 → 5 → last and back
  • Confirm the pagination bar does not shift horizontally at any boundary
  • Verify behavior at the 520px breakpoint where .pagination-bar switches to align-items: flex-start

Disclosure

This PR was drafted with assistance from a Claude Code agent. The change has been reviewed and is being submitted by me (@Augustas11).

The pagination bar shifts horizontally as users navigate between pages
because buildPaginationTokens returns 6 tokens at the edges (page <= 3
or page >= totalPages - 2) and 7 tokens for middle pages, with no
reserved width on the .pagination container.

Add min-width: 240px to .pagination so the container reserves space
for the widest layout (7 tokens including two ellipses). Fixes AntSeed#498.
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.

[Bug] Pagination component shifts/jumps when navigating from page 28 to 27

1 participant