feat: implement pagination in Web UI (Fixes #86) - #325
Open
Diyoncrz18 wants to merge 3 commits into
Open
Conversation
- Added Count method to JobRepository and Offset to SelectParams - Updated sqlite implementation to support offset and count calculations - Added ListJobs function to Service, keeping All intact for API backward compatibility - Updated getJobs to parse ?page query param and return JobRowsData - Updated HTML templates to support HTMX outerHTML replacements with out-of-band updates
…osom#86) - index.html: initial tbody uses hx-trigger='load' only (fires once) - job_rows.html: returned tbody uses hx-trigger='every 10s' only (no load) This eliminates the outerHTML reload loop where the inserted element immediately fires 'load' again before the 10s timer. - Remove pr_body.md and results.csv (local artifacts, not part of gosom#86) - Add TestGetJobsHTMXTriggerIsPollingOnly to assert the fix is permanent - Service.All remains unchanged for existing callers
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
This PR resolves Issue #86 by adding proper pagination to the Web UI jobs list.
Implementation Details
JobRepositorynow supportsCount, andSelectParamsincludes anOffset.Servicehas a newListJobsmethod, whileAllremains untouched to maintain backward compatibility for external API consumers./jobspage was updated to parse the?page=query parameter. The HTML templates were adjusted to return HTMX<tbody id="job-tbody" hx-swap="outerHTML">bundled with out-of-band updates<div id="pagination-container" hx-swap-oob="true">for seamless pagination controls.Validation
?page=0or invalid pages correctly default to page 1.go test ./...yields success.