Skip to content

Replace list-virtual cNav_bar with shared pagination - #1093

Open
TrapoSAMA wants to merge 2 commits into
postfixadmin:masterfrom
TrapoSAMA:traposama-list-virtual-pagination
Open

Replace list-virtual cNav_bar with shared pagination#1093
TrapoSAMA wants to merge 2 commits into
postfixadmin:masterfrom
TrapoSAMA:traposama-list-virtual-pagination

Conversation

@TrapoSAMA

Copy link
Copy Markdown
Contributor

Summary

This is the second step of #1064, following #1090.

  • replace list-virtual.php's cNav_bar HTML renderer with normalized items for the shared templates/_pagination.tpl
  • preserve the selected domain and nested search parameter in every page link
  • use stable #aliases and #mailboxes anchors for the two independently rendered lists
  • render the same accessible Bootstrap 5 pagination above and below each list
  • remove the now-unused arrow-l.png, arrow-r.png, and arrow-u.png assets
  • add focused tests for first, previous, range, next, query-string, and invalid-page-size behavior

The alphabetical ranges still come from the existing create_page_browser() logic. This change only normalizes those ranges for the shared renderer and removes the PHP-generated table/image markup.

Validation

  • focused pagination tests: 12 tests, 149 assertions
  • PHP-CS-Fixer dry run: clean
  • parallel PHP lint: clean
  • Psalm: no errors
  • Smarty compilation of list-virtual.tpl: clean
  • authenticated XAMPP/browser checks with page_size=20 and populated alias/mailbox lists:
    • first and second pages
    • active/disabled states and aria-current
    • stable section anchors
    • nested search[_] and domain propagation
    • desktop and mobile layouts
    • no console errors, broken images, or legacy arrow-image requests

The complete local suite was also exercised. The changed pagination tests passed; the remaining failures are the existing Windows/XAMPP environment-specific checks for Unix commands, DNS discovery, GD, and URL path escaping.

@DavidGoodwin

Copy link
Copy Markdown
Member

thanks @TrapoSAMA

am I being old, or is there something not quite right with the pagination controls here?

image
  • should the controls be at the top AND bottom of the list ?
  • can we stop the page jumping around when you go from one page to the next (using any of the bootstrap controls).
  • do we need to have some background colors applied or something so it's clearer which is the forward block ,and which is mailboxes etc? or can the pagination controls move within the :: Forwards block?

more like this ?

list-virtual doctored a little

@TrapoSAMA

Copy link
Copy Markdown
Contributor Author

Thanks, you were right: the pagination controls were outside the section they controlled, so the anchor could land on the list while leaving the controls out of context.

I've moved both the top and bottom pagers inside the respective Forwards and Mailboxes cards. The existing card header and border now provide the visual grouping without adding new colors, and the existing #aliases / #mailboxes anchors return to the correct section when changing pages.

I validated both pagers with populated lists on desktop and mobile, including page navigation and horizontal overflow, with no browser console errors. The focused pagination tests pass on PHP 8.4 (11 tests, 37 assertions).

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.

2 participants