From cbc48af2469e9b6e71020ba1497cf9821c8ae64b Mon Sep 17 00:00:00 2001 From: seonghobae <8172694+seonghobae@users.noreply.github.com> Date: Mon, 10 Aug 2026 19:32:44 +0000 Subject: [PATCH] Fix empty state tag in HTML validation reports to improve accessibility Change the empty state wrapper in `fast_mlsirm/scoring/essay/validation_report_html.py` from `

` to `

`. This change ensures that ARIA live regions (`role="status"`) are correctly applied using a generic container (`
`), rather than overriding the implicit native role of a semantic element (`

` has an implicit role of `paragraph`), which can cause issues with screen readers or trigger warnings in strict accessibility testing tools. Updated corresponding test assertions to match. --- .../scoring/essay/validation_report_html.py | 4 ++-- .../test_scoring_essay_validation_report_html.py | 15 ++++++--------- 2 files changed, 8 insertions(+), 11 deletions(-) diff --git a/python/fast_mlsirm/scoring/essay/validation_report_html.py b/python/fast_mlsirm/scoring/essay/validation_report_html.py index a2e58b26b..0f46c8688 100644 --- a/python/fast_mlsirm/scoring/essay/validation_report_html.py +++ b/python/fast_mlsirm/scoring/essay/validation_report_html.py @@ -108,8 +108,8 @@ def _identifier_list( """Render identifier evidence as a list or explicit atomic status region.""" if not identifiers: return ( - '

' - f"{escape(empty_message)}

" + '
' + f"{escape(empty_message)}
" ) items = "".join( f"
  • {escape(identifier)}
  • " for identifier in identifiers diff --git a/tests/test_scoring_essay_validation_report_html.py b/tests/test_scoring_essay_validation_report_html.py index 3f58a1df6..d939e48cd 100644 --- a/tests/test_scoring_essay_validation_report_html.py +++ b/tests/test_scoring_essay_validation_report_html.py @@ -97,15 +97,12 @@ def test_custom_title_and_identifiers_are_escaped(tmp_path: Path) -> None: def test_empty_identifier_list_renders_explicit_state() -> None: """An empty evidence list keeps paragraph spacing and atomic status semantics.""" - assert ( - validation_report_html._identifier_list( - (), - empty_message="No boundary is available.", - ) - == ( - '

    ' - "No boundary is available.

    " - ) + assert validation_report_html._identifier_list( + (), + empty_message="No boundary is available.", + ) == ( + '
    ' + "No boundary is available.
    " )