Skip to content

Fix direct-open browser summary reports - #388

Merged
uriahf merged 9 commits into
mainfrom
fix/browser-summary-report-offline
Aug 24, 2026
Merged

uriahf merged 9 commits into
mainfrom
fix/browser-summary-report-offline

Conversation

@uriahf

@uriahf uriahf commented Aug 24, 2026 •

Copy link
Copy Markdown
Owner

Summary

Fix the direct-open offline browser summary report introduced in #387 without changing statistics, ReportSpec, component identity semantics, or rtichoke_viz itself.

Reproduction and root cause

Using the real public call and real production PerformanceTable + ROC-v2 + calibration-v2 producers, the pre-fix artifact contained a valid canonical ReportSpec and rendered correctly when the same directory was served over localhost HTTP.

Direct file:// opening failed in headless Chrome with the report container left empty and this console error:

Access to script at 'file:///.../rtichoke-viz.js' from origin 'null' has been blocked by CORS policy: Cross origin requests are only supported for protocol schemes: chrome, chrome-extension, chrome-untrusted, data, http, https, isolated-app.

Pre-fix executable regression result: 1 failed, 250 passed; the only failure was direct file://, while localhost passed.

This establishes the defect as the external ES-module loading strategy, not ReportSpec, renderReport(), CSS, or the canonical component producers.

Fix

RtichokeBrowserReport.write_html() now embeds the exact vendored immutable v0.5.0 rtichoke-viz.js bundle inside the generated module script and still delegates report composition to the shared renderReport(spec) implementation. It retains the existing sibling JS/CSS output files for output compatibility.

No renderer logic is reimplemented in Python, no component dispatcher is added, and no vendored rtichoke_viz bytes are modified. A new rtichoke_viz release is not required because the existing compiled v0.5.0 bundle is self-contained and works when loaded inline.

Regression proof

The new browser test crosses the boundary #387 missed:

  1. calls real public create_summary_report(..., renderer="browser");
  2. opens the generated HTML directly via file:// in headless Chrome;
  3. fails on browser console errors;
  4. asserts #rtichoke-report contains rendered output;
  5. asserts PerformanceTable title + <table>;
  6. asserts ROC and Calibration titles plus rendered SVG charts;
  7. separately serves the same directory over localhost and verifies it too.

Post-fix tests/test_summary_report_browser.py: all 6 tests pass inside the full suite.

Compatibility

  • default renderer="r": unchanged
  • historical R backend / Quarto: unchanged
  • Plotly / Matplotlib / tables / standalone browser charts: untouched
  • output path/return behavior: unchanged
  • sibling rtichoke-viz.js and rtichoke-viz.css: still written
  • component IDs / series IDs / component-local evaluation IDs: unchanged

Checks

Final Python-package CI matrix is green on Python 3.12, 3.13, and 3.14:

  • Ruff lint: pass
  • Ruff format check: pass
  • ty: pass
  • package build: pass
  • vendored browser assets in wheel: pass
  • full pytest: 251 passed (3.12 shown; matrix jobs all green)

Documentation preview is tracked by the normal PR workflow.

@github-actions

github-actions Bot commented Aug 24, 2026 •

Copy link
Copy Markdown
Contributor
PR Preview Action v1.8.1
Preview removed because the pull request was closed.
2026-08-24 17:04 UTC

@uriahf
uriahf marked this pull request as ready for review August 24, 2026 15:51
@uriahf
uriahf merged commit d3ecbd0 into main Aug 24, 2026
6 checks passed
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.

1 participant