feat: add category filter to TSCM report exports

Users can now choose which risk categories to include in generated
reports — High Interest, Needs Review, and Informational — via three
checkboxes that appear after a sweep completes. Applies to the HTML
report, PDF, JSON annex, and CSV annex. Defaults to High Interest +
Needs Review (Informational excluded) to keep reports concise.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
James Smith
2026-07-05 13:34:09 +01:00
parent 1c9bd34a28
commit 8b2879c71f
5 changed files with 153 additions and 76 deletions
+5 -4
View File
@@ -113,9 +113,9 @@ class TestMatchSignals:
def test_multi_range_signal_matched_by_any_range(self):
from utils.signal_db import match_signals
# POCSAG has ranges in 138-175 MHz and 450-470 MHz
# 162 MHz is in the first range (maritime VHF area, but also POCSAG territory)
results_vhf = match_signals(frequency_mhz=155.0)
results_uhf = match_signals(frequency_mhz=455.0)
# Use a high limit so the expanded DB doesn't push it out of the window
results_vhf = match_signals(frequency_mhz=155.0, limit=20)
results_uhf = match_signals(frequency_mhz=455.0, limit=20)
vhf_names = [r["name"] for r in results_vhf]
uhf_names = [r["name"] for r in results_uhf]
assert "POCSAG Pager" in vhf_names
@@ -124,7 +124,8 @@ class TestMatchSignals:
def test_region_mismatch_does_not_exclude_signal(self):
from utils.signal_db import match_signals
# PMR446 is EU/UK only; should still appear with US region but may score lower
results = match_signals(frequency_mhz=446.09375, region="US")
# Use a high limit since the expanded DB has more signals at 446 MHz
results = match_signals(frequency_mhz=446.09375, region="US", limit=20)
names = [r["name"] for r in results]
assert "PMR446 (Licence-Free UHF)" in names