Roadmap #3: Calendar home screen #104

Closed
opened 2026-07-11 07:15:53 +00:00 by coding-agent-marvin8 · 1 comment
coding-agent-marvin8 commented 2026-07-11 07:15:53 +00:00 (Migrated from codeberg.org)

The home screen at /days currently shows a flat chronological list of dates with footage. This is hard to scan at a glance — it gives no visual sense of which days have a lot of activity vs quiet days, or where today falls in the retention window. A calendar grid view would make it much easier to get a quick overview of NVR coverage and motion activity.

The home screen at /days currently shows a flat chronological list of dates with footage. This is hard to scan at a glance — it gives no visual sense of which days have a lot of activity vs quiet days, or where today falls in the retention window. A calendar grid view would make it much easier to get a quick overview of NVR coverage and motion activity.
coding-agent-marvin8 commented 2026-07-11 07:16:17 +00:00 (Migrated from codeberg.org)

Plan of attack

Rewrote the GET /days route to render a two-month calendar grid instead of a flat list. The view defaults to the current month and accepts ?month=YYYY-MM for navigation. ◀/▶ links shift one month at a time.

Key files:

  • src/cang/db.py — new list_motion_snapshots_for_range query returning motion-flagged snapshots for a date range, used to compute accurate per-day event counts via the existing group_into_events grouper
  • src/cang/web/routes/clips.py — rewrote days_list; added calendar helper functions (_parse_month, _build_calendar_month, _prev_month, _next_month)
  • src/cang/web/templates/days.html — complete rewrite to a two-column (desktop) / one-column (mobile) CSS grid of month tables; each day cell shows motion event count and snapshot count on separate lines and links to /days/YYYY-MM-DD
  • src/cang/web/templates/base.html — calendar CSS added
**Plan of attack** Rewrote the `GET /days` route to render a two-month calendar grid instead of a flat list. The view defaults to the current month and accepts `?month=YYYY-MM` for navigation. ◀/▶ links shift one month at a time. Key files: - `src/cang/db.py` — new `list_motion_snapshots_for_range` query returning motion-flagged snapshots for a date range, used to compute accurate per-day event counts via the existing `group_into_events` grouper - `src/cang/web/routes/clips.py` — rewrote `days_list`; added calendar helper functions (`_parse_month`, `_build_calendar_month`, `_prev_month`, `_next_month`) - `src/cang/web/templates/days.html` — complete rewrite to a two-column (desktop) / one-column (mobile) CSS grid of month tables; each day cell shows motion event count and snapshot count on separate lines and links to `/days/YYYY-MM-DD` - `src/cang/web/templates/base.html` — calendar CSS added
Sign in to join this conversation.
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
marvin8/cang#104
No description provided.