Skip to content
Draft
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
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,10 @@ Releases are tagged in the [GitHub repository](https://github.com/Community-Acce

## [Unreleased]

### Fixed

- **Web Fix: default ACB runs no longer get mislabeled as custom due to heading detection.** `web/src/acb_large_print_web/customization_warning.py` now treats `detect_headings=True` with `heading_accuracy=balanced` as the default behavior and only flags heading detection when it is disabled or switched to a non-default accuracy mode. Added regression coverage in `web/tests/test_customization_warning.py` for both default behavior and disabled heading detection.

## [7.6.0] - 2026-05-19

### Added
Expand Down
11 changes: 8 additions & 3 deletions web/src/acb_large_print_web/customization_warning.py
Original file line number Diff line number Diff line change
Expand Up @@ -169,14 +169,19 @@ def detect_fix_customizations(form_data) -> tuple[bool, list[str]]:
if _get_bool(form_data, "preserve_heading_alignment"):
customizations.append("Heading alignment preservation enabled")

if _get_bool(form_data, "detect_headings"):
detect_headings = (
_get_bool(form_data, "detect_headings")
if "detect_headings" in form_data
else True
)
if not detect_headings:
customizations.append("Heading detection disabled")
else:
heading_accuracy = form_data.get("heading_accuracy", "balanced")
if heading_accuracy != "balanced":
customizations.append(
f"Heading detection enabled ({heading_accuracy} accuracy)"
)
else:
customizations.append("Heading detection enabled")

# Check suppressed rules via the rule_policy if available
suppressed_ids: list[str] = []
Expand Down
17 changes: 15 additions & 2 deletions web/tests/test_customization_warning.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@ def test_detect_fix_customizations_ignores_default_fix_options():
"para_indent_in": 0.0,
"first_line_indent_in": 0.0,
"preserve_heading_alignment": False,
"detect_headings": False,
"detect_headings": True,
"heading_accuracy": "balanced",
"suppress_link_text": False,
"suppress_missing_alt_text": False,
"suppress_faux_heading": False,
Expand All @@ -36,6 +37,18 @@ def test_detect_fix_customizations_flags_non_default_list_indent():
assert reasons == ['Document formatting customizations: List indent changed to 0.5"']


def test_detect_fix_customizations_flags_heading_detection_disabled():
has_customizations, reasons = detect_fix_customizations(
{
"mode": "full",
"detect_headings": False,
}
)

assert has_customizations is True
assert reasons == ["Document formatting customizations: Heading detection disabled"]


def test_generate_customization_warning_uses_plain_paragraphs_without_hard_wraps():
warning = generate_customization_warning(
['Document formatting customizations: List indent changed to 0.5"']
Expand All @@ -44,4 +57,4 @@ def test_generate_customization_warning_uses_plain_paragraphs_without_hard_wraps
assert "<br" not in warning
assert "specification). Your customizations may result" in warning
assert "The ACB Large Print Guidelines define specific requirements for typography" in warning
assert "• Document formatting customizations: List indent changed to 0.5\"" in warning
assert "• Document formatting customizations: List indent changed to 0.5\"" in warning