Summary
Add include_change_dashboard_url: bool = False to ContentOptions. When enabled, appends a direct link to the change diff view in the dashboard — lets recipients click through without hunting for the watch.
Context
Follows from #88 (notification content options Phase 1). No schema migration needed — JSONB column already in place.
Scope
Pipeline (src/workers/pipeline.py):
- Add
"change_id": str(change.id) to change_metadata dict (line ~298, after session.flush())
Worker (src/workers/tasks.py):
- No changes needed —
change_id flows through change_metadata into event metadata automatically
Content builder (src/core/notifications/content.py):
- Add
include_change_dashboard_url: bool = False to ContentOptions
- Add
_build_change_url_section(watch_id, metadata) — constructs {APP_URL}/watches/{watch_id}/changes/{change_id}
- Only renders when
change_id is present in metadata (i.e., change_detected events only)
APP_URL sourced from env var or config (already used in dispatcher.py via AppriseAsset.app_url)
Dashboard (src/dashboard/templates/partials/notification_content_options.html):
- Add checkbox: "Dashboard link (change URL)"
Notes
- Only meaningful for
change_detected events; silently omitted for others (no change_id in metadata)
app_url is already defined as "https://watcher.exe.xyz" in dispatcher.py — extract to a shared constant or config value rather than duplicating
Summary
Add
include_change_dashboard_url: bool = FalsetoContentOptions. When enabled, appends a direct link to the change diff view in the dashboard — lets recipients click through without hunting for the watch.Context
Follows from #88 (notification content options Phase 1). No schema migration needed — JSONB column already in place.
Scope
Pipeline (
src/workers/pipeline.py):"change_id": str(change.id)tochange_metadatadict (line ~298, aftersession.flush())Worker (
src/workers/tasks.py):change_idflows throughchange_metadatainto event metadata automaticallyContent builder (
src/core/notifications/content.py):include_change_dashboard_url: bool = FalsetoContentOptions_build_change_url_section(watch_id, metadata)— constructs{APP_URL}/watches/{watch_id}/changes/{change_id}change_idis present in metadata (i.e.,change_detectedevents only)APP_URLsourced from env var or config (already used indispatcher.pyviaAppriseAsset.app_url)Dashboard (
src/dashboard/templates/partials/notification_content_options.html):Notes
change_detectedevents; silently omitted for others (nochange_idin metadata)app_urlis already defined as"https://watcher.exe.xyz"indispatcher.py— extract to a shared constant or config value rather than duplicating