{{template "shellTop" "trace"}}
<h1>Rule Trace</h1>
<div class="hint mb-4">{{.Now | ago}} — winner: <strong>{{if .Winner}}{{.Winner}}{{else}}nothing fired{{end}}</strong></div>
<div class=scroll><table class=mono>
<tr><th>rule<th>sev<th>predicate<th>gate<th>blocked by<th>detail<th>selected<th>lost to</tr>
{{range .Rules}}<tr>
<td>{{.RuleName}}</td>
<td>{{.Severity}}</td>
<td class={{if .PredicateResult}}green{{else}}gray{{end}}>{{.PredicateResult}}</td>
<td class={{if .GateResult}}green{{else if .GateBlockedBy}}red{{else}}gray{{end}}>{{.GateResult}}</td>
<td>{{.GateBlockedBy}}</td>
<td><details><summary>gate</summary>
<span class=hint>snooze_until:</span> {{.GateDetail.SnoozeUntil | fmtTime}}<br>
<span class=hint>cooldown_until:</span> {{.GateDetail.CooldownUntil | fmtTime}}<br>
<span class=hint>quiet_hours:</span> {{.GateDetail.QuietHours}}<br>
<span class=hint>calendar_busy:</span> {{.GateDetail.CalendarBusy}}<br>
<span class=hint>presence:</span> {{.GateDetail.Presence}}<br>
<span class=hint>inert_keys_missing:</span> {{if .GateDetail.InertKeysMissing}}{{join .GateDetail.InertKeysMissing ", "}}{{else}}—{{end}}
</details></td>
<td class={{if .WasSelected}}green{{end}}>{{.WasSelected}}</td>
<td>{{.LostTo}}</td>
</tr>{{end}}
</table></div>
{{template "shellBottom"}}
</html>
