Skip to content

feat: content option — include dashboard link to change (include_change_dashboard_url) #92

@gregoryfoster

Description

@gregoryfoster

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions