Development: Let applicants choose jobs per page - #2501
Conversation
Up to standards ✅🟢 Issues
|
| Metric | Results |
|---|---|
| Complexity | 53 |
NEW Get contextual insights on your PRs based on Codacy's metrics, along with PR and Jira context, without leaving GitHub. Enable AI reviewer
TIP This summary will be updated as you push new changes.
Surfaces a 10/20/30/40/50 page-size dropdown on every paginated view that uses the shared dynamic-table component. When a storageKey input is supplied the chosen size is hydrated from localStorage on init and persisted on every change, so it survives navigation and reloads. Migrate the job overview's standalone p-table to dynamic-table and wire it up with storageKey="jobsPerPage". The lazy-load event continues to carry the new rows value to the server. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
790f362 to
2bcc3ed
Compare
|
There hasn't been any activity on this pull request recently. Therefore, this pull request has been automatically marked as stale and will be closed if no further activity occurs within seven days. Thank you for your contributions. |
# Conflicts: # src/main/webapp/app/job/job-overview/job-card-list/job-card-list.component.ts
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
|
There hasn't been any activity on this pull request recently. Therefore, this pull request has been automatically marked as stale and will be closed if no further activity occurs within seven days. Thank you for your contributions. |
|
There hasn't been any activity on this pull request recently. Therefore, this pull request has been automatically marked as stale and will be closed if no further activity occurs within seven days. Thank you for your contributions. |
|
There hasn't been any activity on this pull request recently. Therefore, this pull request has been automatically marked as stale and will be closed if no further activity occurs within seven days. Thank you for your contributions. |
|
There hasn't been any activity on this pull request recently. Therefore, this pull request has been automatically marked as stale and will be closed if no further activity occurs within seven days. Thank you for your contributions. |
|
There hasn't been any activity on this pull request recently. Therefore, this pull request has been automatically marked as stale and will be closed if no further activity occurs within seven days. Thank you for your contributions. |
The page sizes on offer went up to 50, which no view in the app comes close to needing. Almost every table starts at 10, so the smaller steps give a useful choice in both directions instead of four options nobody would pick. It also fixes the member picker, which starts at 5 and so had no matching entry in its own dropdown. The specs used 30 as their stand-in for a second valid page size. The hydration test would now fail on that, since the stored value is checked against the options on offer and would fall back rather than be applied. Co-Authored-By: Claude <noreply@anthropic.com>
A full page of rows is a long scroll on a phone, so tables now start on the smallest page size there. A size the reader picked before still wins, and the choice is not written to storage, so widening the window later does not leave them stuck on a short page. Tables that do not offer five keep the size they asked for. The dependency list runs to hundreds of entries and starts at 25, which the shared sizes do not offer, so its dropdown had nothing selected. It now offers sizes of its own. The interviewee picker sized its page to the number of people it was showing and never listened for page changes, so its paginator only ever had one page and its size dropdown did nothing. It no longer has one. Co-Authored-By: Claude <noreply@anthropic.com>
Only the job overview listened for the resolved page size, so everywhere else still opened a full page on a phone. Each table now binds it, which also gets them the stored preference for free if a view later opts into one. The binding writes straight to the page-size signal rather than adding a setter to eleven components. Every one of these tables already reloads from the table's lazy-load event, so changing the size reloads as before. The dependency list and the interviewee picker stay out: the first offers its own larger sizes and never five, the second has no paginator. Co-Authored-By: Claude <noreply@anthropic.com>
|
Small correction to my own commit message on 26466f8: it claims the new page sizes also fixed the add-members picker, which "starts at 5 and so had no matching entry in its own dropdown". That is wrong — that picker uses a bare |
Job cards are tall, so ten of them is a long scroll on a phone whatever size the reader last picked on a wider screen. The overview now keeps the short page on small screens every visit. This stays opt-in. Everywhere else a remembered size still wins, and the short page only applies when nothing has been remembered yet. Co-Authored-By: Claude <noreply@anthropic.com>
Choosing the page size after the first load only relabelled the paginator. PrimeNG assigns the rows input straight to a field and reloads on init, paging, sorting and filtering, so a size set from our side never reached the server: the overview reported five per page on a phone and listed ten, and a reader with a remembered size of twenty was shown ten under a label saying twenty. Reloading afterwards would have raced the load already in flight, which no caller guards against, so the table takes over the first load instead. It tells PrimeNG not to fire it, works out the page size, and requests the first page itself. That keeps it to a single request, made with the size the reader ends up seeing. The request goes out without touching storage, since a size nobody chose should not become the remembered one. Co-Authored-By: Claude <noreply@anthropic.com>
Cathy0123456789
left a comment
There was a problem hiding this comment.
Tested locally, maybe we can adapt the number of cards per row?
# Conflicts: # src/main/webapp/app/job/job-overview/job-card-list/job-card-list.component.ts
The cards wrap into rows of up to six, so twelve filled two rows exactly. Ten left four cards stranded on a second row, and the shared sizes offered nothing that divided evenly. The overview keeps its own sizes of six, twelve, eighteen and twenty-four and opens on twelve again. The shared sizes stay as they are, since a table has no row to fill, and the size dropdown already takes per-view sizes, as the dependency list does. Small screens now start on the shortest size a view offers rather than a fixed five, so the overview starts on six there instead of falling back to a size it does not offer. A phone shows one card per row either way. Co-Authored-By: Claude <noreply@anthropic.com>
|
There hasn't been any activity on this pull request recently. Therefore, this pull request has been automatically marked as stale and will be closed if no further activity occurs within seven days. Thank you for your contributions. |
|
There hasn't been any activity on this pull request recently. Therefore, this pull request has been automatically marked as stale and will be closed if no further activity occurs within seven days. Thank you for your contributions. |
Checklist
General
Client
Motivation and Context
Closes #840. Pagination across the app was fixed at the server-default page size, so anyone scanning a long list paid for repeated round-trips with no way to change the page. The size dropdown is added to the shared
dynamic-table, so every paginated view inherits it, and the job overview moves onto that shared component.Description
Choosing a page size
dynamic-tablegains arowsPerPageOptionsinput, defaulting to[5, 10, 15, 20], which surfaces the PrimeNG size dropdown next to the paginator. Nothing bound that input before, so no view had a size dropdown at all until now.[6, 12, 18, 24]and still opens on 12. Its cards are not a grid but aflex-wraprow ofmin-w-[16.5rem]items in amax-w-[104rem]container, so up to six fit on a row and fewer as the window narrows. Twelve fills two full rows at the widest; ten stranded four cards on a second row. No single number divides evenly at every width — 12 and 24 divide by 1, 2, 3, 4 and 6, while 18 leaves a short last row at four per row — but the default is exact and the rest are close.[25, 50, 100]: it runs to hundreds of entries and starts at 25, which the shared sizes do not offer, so its dropdown had nothing selected.[5, 10, 15, 20]for the tables, which have no row to fill.Remembering it
storageKeyinput. When set, the size the reader picks is written on every change and applied on the next visit. Only the job overview opts in so far.LocalStorageServiceexposesloadPageSize(key, fallback, allowed?)andsavePageSize(key, size). The loader checks the stored value is numeric, positive and one of the sizes on offer, so a stale or tampered key falls back rather than showing a size that is not in the dropdown.Smaller screens
alwaysUseMobileRows: its cards are tall, so a full page is a long scroll whatever size was last picked on a wider screen, and it opens short on a phone every time. This means a size picked on a phone lasts for that visit only.Who fetches the first page
rowsinput straight to a field and only reloads on init, paging, sorting and filtering, so a size applied from our side never reached the server: the overview reported five per page on a phone and listed ten, and a reader with a remembered size of twenty was shown ten under a label saying twenty. Reloading after the fact would have raced the load already in flight, which no caller guards against.Also
Steps for Testing
Prerequisites:
Steps:
jobsPerPagefromlocalStorageand reload. The size falls back to the default.jobsPerPageto a size that is not on offer, say10, and reload. It is ignored rather than shown.jobsPerPage, and reload. The overview opens on 6 cards, and six is selected in the dropdown.Review Progress
Code Review
Manual Tests
Screenshots
To be added.