Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .Jules/palette.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,6 @@
## 2024-10-24 - CSS Bar Chart Animation
**Learning:** CSS animations can enhance static data visualizations without requiring JavaScript, providing visual polish and reducing perceived loading times for data.
**Action:** Use CSS keyframe animations for simple visual improvements in static reports.
## 2024-11-20 - Tabular Numbers for Data Reports
**Learning:** In data-heavy static HTML reports, numbers that aren't vertically aligned make scanning and comparing metrics difficult for users.
**Action:** Always include `font-variant-numeric: tabular-nums;` in body styles or data-heavy components within HTML reports to ensure numbers align properly vertically for improved readability.
1 change: 1 addition & 0 deletions python/fast_mlsirm/report.py
Original file line number Diff line number Diff line change
Expand Up @@ -467,6 +467,7 @@ def _css() -> str:
color: var(--text);
font-family: Arial, Helvetica, sans-serif;
line-height: 1.5;
font-variant-numeric: tabular-nums;
}

.skip-link {
Expand Down
10 changes: 10 additions & 0 deletions tests/test_report.py
Original file line number Diff line number Diff line change
Expand Up @@ -256,3 +256,13 @@ def test_render_table_region_has_keyboard_focus_style(tmp_path):
assert "tbody tr:hover" in html
assert '<div class="bar-chart" aria-hidden="true">' in html
assert '<div class="bar-track" aria-hidden="true">' in html

def test_render_report_has_tabular_nums_in_body(tmp_path):
source = tmp_path / "fit_diagnostics.json"
out = tmp_path / "report.html"
source.write_text(json.dumps({"model_fit": {}}), encoding="utf-8")

render_diagnostics_report(source, out)

html = out.read_text(encoding="utf-8")
assert "font-variant-numeric: tabular-nums;" in html
Loading