Skip to content

fix(scenarios): hide agentic options when 'Agentic scenario' is unchecked - #47

Merged
SushantGautam merged 1 commit into
mainfrom
agents/see-https-github-com-simulamet-simpleauditstudio-87af98a6
Oct 13, 2026
Merged

SushantGautam merged 1 commit into
mainfrom
agents/see-https-github-com-simulamet-simpleauditstudio-87af98a6

Conversation

@SushantGautam

Copy link
Copy Markdown
Collaborator

Summary

Fixes #45 (Need better UI in agentic scenario edit).

On /scenarios/?set=XX, each scenario's inline edit form (and the add-scenario form) showed the full set of ~30 agentic options regardless of whether the scenario was actually agentic — visual noise for non-agentic scenarios.

This change hides those options when Agentic scenario is unchecked, and shows/hides them live as you toggle it.

What changed

All in templates/scenarios.html:

  • Wrapped the Agentic metadata JSON editor + the agentic_controls.html include in a <div data-agentic-section> that starts hidden when the revision has no metadata.agentic (edit form) or always (add form).
  • Added JS toggleAgenticSection(form) + a change listener on every agentic_scenario checkbox so the section shows/hides instantly.

This matches existing backend behavior — infra/ui.py already strips all agentic metadata on save when the box is off — so the UI now reflects what actually gets stored.

Verification

  • Rendered the page via Django test client: agentic scenarios → section visible; a non-agentic scenario → section renders display:none with an unchecked box.
  • Verified live in the browser (/scenarios/?set=5): checked → block, uncheck → none, re-check → block; add-form default → none.
  • uv run ruff check . — clean.
  • pytest infra/tests/test_scenarios.py, test_agentic_integration.py, test_seed_agentic_scenarios.py, test_scenario_import_export.py — all passing.

No migrations or config changes; purely template/client-side.

…cked

On the scenario edit/add forms, wrap the agentic metadata JSON editor and
the structured agentic controls in a section that starts hidden unless the
scenario is agentic, and show/hide it live as the checkbox toggles. This
matches the backend, which already strips agentic metadata on save when the
box is off, so the UI no longer shows ~30 irrelevant fields for non-agentic
scenarios.

Fixes #45

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@SushantGautam
SushantGautam merged commit a7cd353 into main Oct 13, 2026
1 check passed
@SushantGautam
SushantGautam deleted the agents/see-https-github-com-simulamet-simpleauditstudio-87af98a6 branch October 13, 2026 22:11
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.

Need better UI in agentic scenario edit

1 participant