refactor(web): share charts, pagination, and progress views - #144
Merged
Conversation
robertvanhoesel
approved these changes
Sep 6, 2026
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.
The dashboard repeats chart rendering, pagination assembly, and progress parsing across several pages. Share these implementations within
oxana-webwhile preserving the public Rust API, routes, and displayed behavior. This removes 400 lines overall.Validation:
cargo fmt --all -- --checkcargo clippy --all-features --workspace --all-targets -- -D warningscargo test -p oxana-web --lib --quiet: 67 tests passed, including new pagination and progress regressions.Visual browser verification was unavailable because this host has no attached browser panes.
Note
Low Risk
Refactor-only changes to templates and private web helpers with regression tests; no auth, storage API, or routing changes beyond equivalent pagination assembly.
Overview
Consolidates repeated oxana-web dashboard logic so charting, job list paging, and in-job progress UI share one implementation while keeping routes and on-screen behavior the same.
Job progress replaces several Askama filters (
show_job_progress, percent/summary/note/ETA) with a singlejob_progressfilter that returns an optionalProgressView. Templates branch onSome(progress)and_job_progress.htmlreads preformatted fields, with new unit tests for tuple/object states, percent clamping, and HTML escaping of notes.Pagination introduces
JobPage(list_opts, 50-item pages + one lookahead row,has_next, range labels). Scheduled, dead, retry, and queue detail handlers route throughglobal_jobsorJobPage::newinstead of duplicating truncate/offset logic; list templates usepage.jobs,page.number, andpage.has_next.Charts move uPlot assets, tooltip styling, line charts, and stacked bar rendering into
_chart_head.htmland_charts.html(oxanaCharts). Metrics, metric detail, and queues pages keep their formatters and series but drop large inline script blocks in favor of thin page-specific init code.Reviewed by Cursor Bugbot for commit 326c311. Bugbot is set up for automated code reviews on this repo. Configure here.