Skip to content
Open
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
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ All notable changes to this project will be documented in this file.
## Unreleased

### Added
- Weather impact summaries now appear in the current conditions and forecast sections. You'll see plain-language guidance for three areas: outdoor comfort and activity, driving caution (visibility, ice, wind, precipitation), and allergy risk (pollen level, primary allergen, wind dispersion, air quality). All rules are transparent and documented — no opaque AI decisions. Screen readers announce concise, labelled lines such as "Impact: Outdoor: Comfortable - good conditions for outdoor activities."
- Implemented Nationwide weather discussions feature, including:
- "Show Nationwide location" setting and dynamic filtering of the Nationwide location.
- Main window integration for displaying discussion summaries.
Expand Down
11 changes: 11 additions & 0 deletions src/accessiweather/display/presentation/current_conditions.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import logging
from collections.abc import Iterable

from ...impact_summary import build_impact_summary
from ...models import (
AppSettings,
CurrentConditions,
Expand Down Expand Up @@ -508,6 +509,15 @@ def build_current_conditions(
metrics.extend(_build_environmental_metrics(environmental, air_quality))
metrics.extend(_build_trend_metrics(trends, current, hourly_forecast, show_pressure_trend))

# Build impact summary
impact = build_impact_summary(current, environmental)
if impact.outdoor:
metrics.append(Metric("Impact: Outdoor", impact.outdoor))
if impact.driving:
metrics.append(Metric("Impact: Driving", impact.driving))
if impact.allergy:
metrics.append(Metric("Impact: Allergy", impact.allergy))

# Build fallback text
# Use metric.label for all metrics — after priority reordering, metrics[0]
# may no longer be the Temperature metric (e.g. Visibility moves first during fog alerts)
Expand All @@ -530,6 +540,7 @@ def build_current_conditions(
metrics=metrics,
fallback_text=fallback_text,
trends=trend_lines,
impact_summary=impact if impact.has_content() else None,
)


Expand Down
8 changes: 8 additions & 0 deletions src/accessiweather/display/presentation/forecast.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
from datetime import datetime, tzinfo

from ...forecast_confidence import ForecastConfidence
from ...impact_summary import build_forecast_impact_summary
from ...models import AppSettings, Forecast, ForecastPeriod, HourlyForecast, Location
from ...utils import TemperatureUnit, calculate_dewpoint
from ..weather_presenter import (
Expand Down Expand Up @@ -264,6 +265,10 @@ def build_forecast(
fallback_sections.append(hourly_section_text)
fallback_text = "\n\n".join(section for section in fallback_sections if section).rstrip()

# Build impact summary from the first daily period when available
first_period = forecast.periods[0] if forecast.periods else None
forecast_impact = build_forecast_impact_summary(first_period) if first_period else None

return ForecastPresentation(
title=title,
periods=periods,
Expand All @@ -275,6 +280,9 @@ def build_forecast(
hourly_section_text=hourly_section_text,
confidence_label=confidence_label,
summary=summary_line,
impact_summary=forecast_impact
if forecast_impact and forecast_impact.has_content()
else None,
)


Expand Down
3 changes: 3 additions & 0 deletions src/accessiweather/display/weather_presenter.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@

from ..forecast_confidence import ForecastConfidence

from ..impact_summary import ImpactSummary
from ..models import (
AppSettings,
AviationData,
Expand Down Expand Up @@ -86,6 +87,7 @@ class CurrentConditionsPresentation:
metrics: list[Metric] = field(default_factory=list)
fallback_text: str = ""
trends: list[str] = field(default_factory=list)
impact_summary: ImpactSummary | None = None

@property
def trend_summary(self) -> list[str]: # pragma: no cover - backward compatibility
Expand All @@ -107,6 +109,7 @@ class ForecastPresentation:
hourly_section_text: str = ""
confidence_label: str | None = None
summary: str | None = None
impact_summary: ImpactSummary | None = None


@dataclass(slots=True)
Expand Down
Loading
Loading