Fix stepper checkmarks, error recovery, radio button spacing

- Both steppers now show green checkmark on final step when completed
  instead of leaving it highlighted as 'current' (blue)
- Stems error is cleared at the start of every generate_stems attempt,
  not just on success — no stale error messages after retry
- Radio buttons in stems section use same compact spacing as checkboxes
This commit is contained in:
Troll (Hermes Agent) 2026-08-11 20:18:19 +00:00
parent 24838c73ac
commit 9df4c685a4
2 changed files with 11 additions and 5 deletions

3
app.py
View file

@ -1214,6 +1214,7 @@ def admin_request(rid):
elif action == 'generate_stems': elif action == 'generate_stems':
# Queue a stem extraction job for the selected MP3 (Version A or B). # Queue a stem extraction job for the selected MP3 (Version A or B).
# Clear any previous error at the start of every attempt.
api_key = get_musicgpt_api_key() api_key = get_musicgpt_api_key()
if not api_key: if not api_key:
flash('MusicGPT API key is not configured.', 'error') flash('MusicGPT API key is not configured.', 'error')
@ -1221,6 +1222,8 @@ def admin_request(rid):
if req.get('stems_status') in ('IN_QUEUE', 'IN_PROGRESS'): if req.get('stems_status') in ('IN_QUEUE', 'IN_PROGRESS'):
flash('A stems extraction is already in progress.', 'error') flash('A stems extraction is already in progress.', 'error')
return redirect(url_for('admin_request', rid=rid)) return redirect(url_for('admin_request', rid=rid))
# Clear prior error so the operator doesn't see a stale message after retry.
update_request(rid, stems_error=None)
# Operator selects which version (A or B) to extract stems from. # Operator selects which version (A or B) to extract stems from.
selected = request.form.get('stems_source', '').strip() selected = request.form.get('stems_source', '').strip()
if selected == 'a': if selected == 'a':

View file

@ -111,7 +111,8 @@
margin:.6rem 0; margin:.6rem 0;
padding:.4rem 0; padding:.4rem 0;
} }
.song-row input[type="checkbox"]{ .song-row input[type="checkbox"],
.song-row input[type="radio"]{
width:auto; width:auto;
margin:.2rem 0 0 0; margin:.2rem 0 0 0;
flex-shrink:0; flex-shrink:0;
@ -256,8 +257,9 @@
<ol class="steps" aria-label="Request progress"> <ol class="steps" aria-label="Request progress">
{% for i in range(steps|length) %} {% for i in range(steps|length) %}
{% set key, label = steps[i] %} {% set key, label = steps[i] %}
{% set is_completed = i < current_step %} {% set is_last = i == steps|length - 1 %}
{% set is_current = i == current_step %} {% set is_completed = i < current_step or (is_last and current_step == i) %}
{% set is_current = i == current_step and not is_last %}
<li class="step-item {% if is_completed %}completed{% elif is_current %}current{% else %}upcoming{% endif %}" {% if is_current %}aria-current="step"{% endif %}> <li class="step-item {% if is_completed %}completed{% elif is_current %}current{% else %}upcoming{% endif %}" {% if is_current %}aria-current="step"{% endif %}>
<div class="step-indicator"> <div class="step-indicator">
{% if is_completed %}✓{% else %}{{ i + 1 }}{% endif %} {% if is_completed %}✓{% else %}{{ i + 1 }}{% endif %}
@ -282,10 +284,11 @@
{% if mg_steps[j][0] == current_mg %}{% set ns.mg_index = j %}{% endif %} {% if mg_steps[j][0] == current_mg %}{% set ns.mg_index = j %}{% endif %}
{% endfor %} {% endfor %}
{% if current_mg in ('FAILED', 'ERROR', 'CANCELLED') %}{% set ns.mg_index = -2 %}{% endif %} {% if current_mg in ('FAILED', 'ERROR', 'CANCELLED') %}{% set ns.mg_index = -2 %}{% endif %}
{% set mg_completed_step = req.musicgpt_status in ('COMPLETED', 'FINISHED') %}
{% for j in range(mg_steps|length) %} {% for j in range(mg_steps|length) %}
{% set mg_key, mg_label = mg_steps[j] %} {% set mg_key, mg_label = mg_steps[j] %}
{% set mg_completed = j < ns.mg_index %} {% set mg_completed = j < ns.mg_index or mg_completed_step %}
{% set mg_current = j == ns.mg_index %} {% set mg_current = j == ns.mg_index and not mg_completed_step %}
<li class="step-item {% if mg_completed %}completed{% elif mg_current %}current{% else %}upcoming{% endif %} {% if ns.mg_index == -2 and not mg_completed and not mg_current %}upcoming{% endif %}" {% if mg_current %}aria-current="step"{% endif %}> <li class="step-item {% if mg_completed %}completed{% elif mg_current %}current{% else %}upcoming{% endif %} {% if ns.mg_index == -2 and not mg_completed and not mg_current %}upcoming{% endif %}" {% if mg_current %}aria-current="step"{% endif %}>
<div class="step-indicator"> <div class="step-indicator">
{% if mg_completed %}✓{% else %}{{ j + 1 }}{% endif %} {% if mg_completed %}✓{% else %}{{ j + 1 }}{% endif %}