Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions webapp/app/templates/partials/section_card.html
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
{% if oob and not (s.sections | selectattr("status", "in", ["pending", "generating"]) | list) %}
<div id="status-bar" hx-swap-oob="innerHTML"></div>
<div id="step3-actions" hx-swap-oob="innerHTML">
{% with status_oob=false %}
{% include "partials/step3_actions.html" %}
{% endwith %}
</div>
{% endif %}
{% if sec.status in ('pending', 'generating') %}
Expand Down
4 changes: 4 additions & 0 deletions webapp/app/templates/partials/step3_actions.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
{% set drafting = s.sections | rejectattr('status', 'equalto', 'done') | list %}
{% set status_oob = status_oob|default(true) %}
{% if not drafting and status_oob %}
<div id="status-bar" hx-swap-oob="innerHTML"></div>
{% endif %}
Comment thread
cursor[bot] marked this conversation as resolved.
<div class="action-bar bar-3">
<div class="bar-left">
<a href="/sessions/{{ s.id }}/back/clarify" role="button" class="secondary outline">← Back</a>
Expand Down
15 changes: 15 additions & 0 deletions webapp/tests/test_routes.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,21 @@ def test_last_section_poll_clears_stale_status_bar():
body = resp.body.decode()

assert 'id="status-bar" hx-swap-oob="innerHTML"' in body
assert body.count('id="status-bar"') == 1
assert 'id="step3-actions" hx-swap-oob="innerHTML"' in body
assert "Party review" in body
assert "Finish" in body


def test_step3_actions_clears_status_when_buttons_appear():
"""The job_done-triggered button refresh should clear the first-paint
model-loading fallback even if no section-card poll runs afterward."""
s = state.create()
s.sections = [Section(id="overview", title="Overview", instruction="", content="Done", status="done")]

resp = asyncio.run(main.step3_actions(_FakeRequest(), s.id))
body = resp.body.decode()

assert 'id="status-bar" hx-swap-oob="innerHTML"' in body
assert "Party review" in body
assert "Finish" in body
Loading