{% macro event_row(e, now, names=none, href=none, clock=false) %} {#- `names`: {actor -> display name} (Module.actor_names, merged in the page context as `actor_names`). A caller may pass its own; otherwise the page's is used. An actor with no name shows its raw id, as before. `href`: the record behind the row (the calendar's day sheet, #44), drawn as an "open →" link; none draws nothing. `clock`: the time of day instead of "3h ago" — on a page that is one day, "ago" makes you do arithmetic. -#} {% set names = names if names is not none else (actor_names or {}) %} {% set p = pl(e) %} {#- 🔴 words somebody else attached to a change in the running HIDDEN lock are theirs and stored verbatim — and would tell the pup the time they chose not to know. Shown after. -#} {#- hidden_session_id is '*' when the hidden lock could not be read: masked everywhere (fail closed) -#} {% set theirs_hidden = e.session_id and (hidden_session_id == '*' or e.session_id == hidden_session_id) and delegated(e.actor) %} {% set why = ('🔒 their words — hidden with your timer' if theirs_hidden else p.reason) if p.reason else '' %} {% set meta = kind_meta.get(e.kind) or act_meta.get(e.kind) or ('•', e.kind) %} {#- a hygiene window rides freeze/unfreeze (core/hygiene.py) — it reads as what it was -#} {% if p.hygiene and e.kind == 'freeze' %}{% set meta = kind_meta.get('hygiene_open') or meta %}{% endif %} {% if p.relocked and e.kind == 'unfreeze' %}{% set meta = kind_meta.get('relocked') or meta %}{% endif %}
  • {{ meta[0] }}
    {{ meta[1] }} {{ e.module }} {% if e.actor != 'user' %}{{ names.get(e.actor) or e.actor }}{% endif %} {#- the retroactive log wears its lateness: this row's ts is when it happened, the badge says it was told to us later (hover for exactly when). -#} {% if p.backdated %}↶ logged later{% endif %} {% if e.delta_seconds %}{{ e.delta_seconds|sdur }}{% endif %} {% if e.xp %}+{{ e.xp }} xp{% endif %}
    {#- a hidden lock printed its own sentence here and then announced that the timer was hidden -#} {%- if e.kind == 'lock' %}{% if p.hidden %}base hidden · hidden timer{% else %}base {{ p.base_seconds|dur }}{% endif %}{% if p.note %} · {{ p.note }}{% endif %} {%- elif e.kind == 'unlock' %}{{ 'early — emergency key' if p.early else 'clean run' }} · locked {{ p.elapsed|dur }} {%- elif e.kind == 'spin' %}{{ p.label }}{% if p.task_title %} → {{ p.task_title }}{% endif %} {%- elif e.kind in ('task_assigned', 'task_verified', 'task_failed') %}{{ p.title }}{% if p.reason %} · {{ p.reason }}{% endif %}{% if p.note %} · “{{ p.note }}”{% endif %} {%- elif (e.kind == 'freeze' and p.hygiene) or e.kind == 'hygiene_open' %}{{ '🛁 maintenance' if p.hygiene == 'scheduled' else '🚨 emergency' }} · {{ p.minutes }} min window, back by {{ p.until|local('%H:%M') }} {%- elif e.kind == 'maintenance_set' %}{{ p.slots or 'no slots — emergency only' }} · {{ p.minutes }} min window {%- elif e.kind == 'relocked' or (e.kind == 'unfreeze' and p.relocked) %}out {{ p.minutes_out }} min{% if p.overrun_seconds %} · {{ p.overrun_seconds|dur }} over{% endif %} {%- elif e.kind == 'freeze' %}{% if p.until %}until {{ p.until|local }}{% else %}indefinite{% endif %}{% if why %} · {{ why }}{% endif %} {%- elif e.kind == 'note' %}{{ p.text }} {%- elif e.kind == 'photo' %}{{ p.caption or 'check-in' }} {%- elif e.kind in ('reflection', 'checkin', 'confession', 'catchup') %}{% if p.prompt %}{{ p.prompt }} · {% endif %}{{ p.excerpt }}{% if p.chars and p.chars > 140 %}…{% endif %} {%- elif e.kind in ('mantra', 'affirmation') %}{{ p.prompt }} {%- elif e.kind == 'meditation' %}{{ p.duration_seconds|dur }}{% if p.prompt %} · {{ p.prompt[:60] }}{% endif %} {%- elif e.kind == 'challenge' %}show {{ p.word }} in frame · {{ p.minutes }} min to answer {%- elif e.kind == 'challenge_met' %}{{ p.word }} · answered in {{ p.seconds|dur }} {%- elif e.kind == 'challenge_missed' %}{{ p.word }} · {{ 'you said you couldn’t' if p.reason == 'declined' else 'ran out' }}{% if p.withheld %} · no penalty — {{ {'paused': 'paused', 'hygiene': 'out for hygiene'}.get(p.withheld, 'held back') }}{% elif not p.applied %} · not locked, no penalty{% endif %} {%- elif e.kind == 'reflection_missed' %}no reflection on {{ p.day }}{% if not p.applied %} · not locked, no penalty{% endif %} {%- elif e.kind in ('habit_streak', 'habit_slack') %}{{ p.line }}{% if p.withheld %} · clock left alone — recovery day{% elif p.no_lock %} · not locked, so no clock{% endif %} {%- elif e.module == 'activity' %}{% if p.duration_seconds %}{{ p.duration_seconds|dur }}{% endif %}{% if p.source and p.source != 'manual' %}{{ ' · ' if p.duration_seconds }}from {{ 'a calendar feed' if p.source == 'ical' else 'a calendar file' if p.source == 'file' else 'the timer' if p.source == 'timer' else p.source }}{% endif %} {%- elif e.kind == 'mark' %}{{ p.label }}{% if p.withheld %} · held back — {{ 'paused' if p.because == 'paused' else 'go gently day' }}{% elif p.capped and not p.weight %} · over the day's cap{% else %} · +{{ p.weight }}{% if p.capped %} (capped){% endif %}{% endif %} {%- elif e.kind == 'pause' %}everything you granted is suspended{% if p.reason == 'restored' %} · restored from a backup{% endif %} {%- elif e.kind == 'resume' %}what you granted works again {%- elif e.kind == 'act_refused' %}{{ names.get(p.by) or p.by }} · {{ p.capability }} · {{ p.code }} {%- elif e.kind == 'prompt_added' %}a {{ p.kind }} prompt for {{ p.for_day }} {%- elif e.kind == 'undo' %}{{ p.target_kind }} #{{ p.target_event_id }}{% if p.reverted_delta %} · {{ p.reverted_delta|sdur }} back{% endif %}{% if p.reason %} · {{ p.reason }}{% endif %} {%- elif why %}{{ why }}{% endif %}
    {# old task_verified payloads carry no media_kind, so Undefined falls to the else branch and renders exactly as before #} {% if p.media_id %}{% if p.media_kind == 'voice' %} {% else %}{{ 'photo' if e.kind == 'photo' else 'verification' }}{% endif %}{% endif %} {% if href %}open →{% endif %}
  • {% endmacro %}