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 @@ -23,3 +23,6 @@
## 2026-08-04 - Status Semantics and Numeric Alignment for Reports
**Learning:** Explicit status semantics can make conditionally rendered empty states easier to discover with assistive technology, while tabular numerals improve visual comparison of metric columns. Focus-reveal behavior must not depend only on `:focus-visible`, and hover styling must not reduce the contrast of unrelated rows.
**Action:** Use `role="status"` for genuine conditionally rendered status messages, apply `font-variant-numeric: tabular-nums` to numeric report tables, reveal skip links on `:focus`, retain a visible `:focus-visible` indicator, and avoid opacity-based dimming of non-hovered content.
## 2025-05-18 - Prevent Mouse Focus Rings on Summary Elements
**Learning:** Native `<summary>` elements receive focus when clicked, causing browsers to display default focus rings that can be visually jarring for mouse users.
**Action:** Apply `outline: none` to the `:focus` state of `<summary>` elements while retaining custom, high-visibility outlines on their `:focus-visible` state to ensure both mouse and keyboard users receive appropriate feedback.
21 changes: 9 additions & 12 deletions python/fast_mlsirm/report.py
Original file line number Diff line number Diff line change
Expand Up @@ -217,9 +217,7 @@ def _render_dimensionality_report(payload: dict[str, Any]) -> list[str]:
def _metric_section(heading: str, metrics: dict[str, Any]) -> str | None:
"""Render a labelled metric-card grid, or ``None`` when there are no metrics."""
if len(metrics) > MAX_REPORT_METRICS:
raise ValueError(
f"report metrics exceed the {MAX_REPORT_METRICS}-entry limit"
)
raise ValueError(f"report metrics exceed the {MAX_REPORT_METRICS}-entry limit")

cards = []
for key, value in metrics.items():
Expand Down Expand Up @@ -443,13 +441,9 @@ def _rows_from_columnar(section: Any) -> list[dict[str, Any]]:
if row_count == 0:
return []
if row_count > MAX_REPORT_ROWS:
raise ValueError(
f"report table rows exceed the {MAX_REPORT_ROWS}-row limit"
)
raise ValueError(f"report table rows exceed the {MAX_REPORT_ROWS}-row limit")
if row_count * len(columns) > MAX_REPORT_CELLS:
raise ValueError(
f"report table cells exceed the {MAX_REPORT_CELLS}-cell limit"
)
raise ValueError(f"report table cells exceed the {MAX_REPORT_CELLS}-cell limit")

rows = []
for index in range(row_count):
Expand All @@ -463,9 +457,7 @@ def _rows_from_columnar(section: Any) -> list[dict[str, Any]]:
def _validate_report_rows(rows: list[dict[str, Any]]) -> None:
"""Reject row-oriented diagnostics that exceed report rendering budgets."""
if len(rows) > MAX_REPORT_ROWS:
raise ValueError(
f"report table rows exceed the {MAX_REPORT_ROWS}-row limit"
)
raise ValueError(f"report table rows exceed the {MAX_REPORT_ROWS}-row limit")

columns: set[str] = set()
cell_count = 0
Expand Down Expand Up @@ -925,6 +917,11 @@ def _css() -> str:
color: var(--teal);
}

.exact-values > summary:focus,
.export-block > summary:focus {
outline: none;
}

.exact-values > summary:focus-visible,
.export-block > summary:focus-visible {
outline: 3px solid var(--teal);
Expand Down
Loading