Skip to content

refactor(web): share charts, pagination, and progress views - #144

Merged
reneklacan merged 1 commit into
mainfrom
review-code-simplificatio
Sep 6, 2026
Merged

refactor(web): share charts, pagination, and progress views#144
reneklacan merged 1 commit into
mainfrom
review-code-simplificatio

Conversation

@reneklacan

@reneklacan reneklacan commented Sep 5, 2026

Copy link
Copy Markdown
Member

The dashboard repeats chart rendering, pagination assembly, and progress parsing across several pages. Share these implementations within oxana-web while preserving the public Rust API, routes, and displayed behavior. This removes 400 lines overall.

  • Extract shared chart styles, line and stacked-bar renderers, and tooltip handling while retaining each page's formatting and series ordering.
  • Use one private pagination model for queue, scheduled, dead, and retry lists, preserving the 50-job page size and lookahead behavior.
  • Parse and format progress once per rendered component, preserving notes, ETA, escaping, and fallback state display.

Validation:

  • cargo fmt --all -- --check
  • cargo clippy --all-features --workspace --all-targets -- -D warnings
  • cargo test -p oxana-web --lib --quiet: 67 tests passed, including new pagination and progress regressions.
  • Temporary verification harnesses: 108 old/new chart scenarios matched and 34 HTTP checks passed against isolated Redis data. The harnesses are outside the repository; they add no project dependencies.

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 single job_progress filter that returns an optional ProgressView. Templates branch on Some(progress) and _job_progress.html reads 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 through global_jobs or JobPage::new instead of duplicating truncate/offset logic; list templates use page.jobs, page.number, and page.has_next.

Charts move uPlot assets, tooltip styling, line charts, and stacked bar rendering into _chart_head.html and _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.

@reneklacan
reneklacan merged commit 96b8a0b into main Sep 6, 2026
2 checks passed
@reneklacan
reneklacan deleted the review-code-simplificatio branch September 6, 2026 07:18
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