Calendar: a day's links drop the kinds filter, so \"and N more\" opens a different set of events #452

Closed
opened 2026-10-01 10:46:48 +00:00 by tiagoagueda · 0 comments
Owner

Found on 2026-09-29 in a read-only review of postulo at 95348908d, following every link the calendar page builds.

Related to #238.

Checked again on 2026-10-01 against main at 0a5cad587: still present. The code is now at applications/agenda.py:413-415 (Day.url), :459-473 (month_grid), :476-482 (week_days) and :503 (url_for's docstring), and the links are drawn at templates/applications/calendar.html:237 (day number), :256 (and N more) and :290 (week view heading).

Every link on a narrowed calendar keeps its ?kinds= except the ones that open a single day. The day number in a month cell, the cell's and N more link and the day headings of the week view all lead to the unfiltered day, so a calendar narrowed to deadlines widens without the person asking.

  • Where: applications/agenda.py:352-354, Day.url: return url_for("day", self.date), with no kinds. Day has no kinds field, and month_grid (:387-400) and week_days (:403-409) do not pass the page's. The links are drawn at templates/applications/calendar.html:139 (day number), :151 (and N more) and :174 (week view heading). url_for's docstring (:430) says "The kinds travel with it, so Earlier does not quietly widen a narrowed calendar", and the switcher, the legend, Earlier, Later and Today all pass kinds.
  • What happens: somebody opens ?month=2026-09&kinds=deadline. A cell reads and 2 more, counted over deadlines only. Following it opens that day with every interview, reminder, closing date and answer due as well, and the legend shows all five kinds switched back on. The day holds more than the cell promised.
  • Why it matters: the filter is meant to be a page somebody can keep (wiki, Tracking applications, "a calendar narrowed to deadlines is a page you can keep"); it undoes itself on the most natural click.
  • Fix: give Day a kinds field, set by month_grid and week_days from the kinds build already holds, and return url_for("day", self.date, self.kinds) from Day.url.

Done when

  • A test in tests/test_calendar.py renders ?month=...&kinds=deadline with a day holding three deadlines and asserts that the day link and the and 1 more link carry kinds=deadline; it fails today. The same for a week view's day heading.
Found on 2026-09-29 in a read-only review of postulo at 95348908d, following every link the calendar page builds. Related to #238. Checked again on 2026-10-01 against `main` at `0a5cad587`: still present. The code is now at `applications/agenda.py:413-415` (`Day.url`), `:459-473` (`month_grid`), `:476-482` (`week_days`) and `:503` (`url_for`'s docstring), and the links are drawn at `templates/applications/calendar.html:237` (day number), `:256` (*and N more*) and `:290` (week view heading). Every link on a narrowed calendar keeps its `?kinds=` except the ones that open a single day. The day number in a month cell, the cell's *and N more* link and the day headings of the week view all lead to the unfiltered day, so a calendar narrowed to deadlines widens without the person asking. - **Where:** `applications/agenda.py:352-354`, `Day.url`: `return url_for("day", self.date)`, with no kinds. `Day` has no kinds field, and `month_grid` (`:387-400`) and `week_days` (`:403-409`) do not pass the page's. The links are drawn at `templates/applications/calendar.html:139` (day number), `:151` (*and N more*) and `:174` (week view heading). `url_for`'s docstring (`:430`) says "The kinds travel with it, so *Earlier* does not quietly widen a narrowed calendar", and the switcher, the legend, *Earlier*, *Later* and *Today* all pass `kinds`. - **What happens:** somebody opens `?month=2026-09&kinds=deadline`. A cell reads *and 2 more*, counted over deadlines only. Following it opens that day with every interview, reminder, closing date and answer due as well, and the legend shows all five kinds switched back on. The day holds more than the cell promised. - **Why it matters:** the filter is meant to be a page somebody can keep (wiki, *Tracking applications*, "a calendar narrowed to deadlines is a page you can keep"); it undoes itself on the most natural click. - **Fix:** give `Day` a `kinds` field, set by `month_grid` and `week_days` from the kinds `build` already holds, and return `url_for("day", self.date, self.kinds)` from `Day.url`. ## Done when - A test in `tests/test_calendar.py` renders `?month=...&kinds=deadline` with a day holding three deadlines and asserts that the day link and the *and 1 more* link carry `kinds=deadline`; it fails today. The same for a week view's day heading.
tiagoagueda added this to the 0.6.0 milestone 2026-10-01 10:46:48 +00:00
Sign in to join this conversation.
No milestone
No project
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
Postulo/postulo#452
No description provided.