Skip to content

fix(results): restore nested if blocks in trace panel template - #58

Merged
SushantGautam merged 1 commit into
mainfrom
seer/fix/result-rep-panel-stray-endif
Oct 16, 2026
Merged

SushantGautam merged 1 commit into
mainfrom
seer/fix/result-rep-panel-stray-endif

Conversation

@sentry

@sentry sentry Bot commented Oct 16, 2026

Copy link
Copy Markdown
Contributor

Fixes a TemplateSyntaxError: Invalid block tag on line 256: 'endif' that broke scenario result views (e.g. /runs/{run_id}/results/{result_id}/).

Root Cause

In commit 163f058, refactoring the target-trace section into a <details> element merged the outer {% if rep.trace %} and inner {% if rep.trace.spans %} checks into a single {% if rep.trace and rep.trace.spans %}. However, the inner block's {% else %} and {% endif %} were left in place alongside the outer {% endif %} and an extra closing </div>, leaving line 256's {% endif %} without a matching opening tag and causing Django's template compiler to fail immediately.

Changes

  • Split the condition back into an outer {% if rep.trace %} around the <details> wrapper and an inner {% if rep.trace.spans %} inside <div class="mt-3">.
  • Reconnected the existing {% else %} branch so the "target exported no spans" message can render as intended.
  • Removed the redundant closing </div> and extra {% endif %}.
  • Dropped the duplicate inline evidence-link expand script inside the trace block; the comprehensive version at the bottom of the partial already handles nested details expansion and hash changes.

Fixes SIMPLEAUDITSTUDIO-2Q

@sentry <feedback>: Autofix iterates on these changes
@sentry stop iterating: Autofix stops iterating on this run

Co-authored-by: sentry[bot] <39604003+sentry[bot]@users.noreply.github.com>
@SushantGautam
SushantGautam merged commit b6a4585 into main Oct 16, 2026
1 check failed
@SushantGautam
SushantGautam deleted the seer/fix/result-rep-panel-stray-endif branch October 16, 2026 21:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant