From 9df4c685a49d9bbc653f5ae14ddad2c53a47e8fa Mon Sep 17 00:00:00 2001 From: "Troll (Hermes Agent)" Date: Tue, 11 Aug 2026 20:18:19 +0000 Subject: [PATCH] Fix stepper checkmarks, error recovery, radio button spacing MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 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 --- app.py | 3 +++ templates/admin/request.html | 13 ++++++++----- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/app.py b/app.py index ab7533d..4cc688f 100644 --- a/app.py +++ b/app.py @@ -1214,6 +1214,7 @@ def admin_request(rid): elif action == 'generate_stems': # 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() if not api_key: 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'): flash('A stems extraction is already in progress.', 'error') 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. selected = request.form.get('stems_source', '').strip() if selected == 'a': diff --git a/templates/admin/request.html b/templates/admin/request.html index c63ec84..771d228 100644 --- a/templates/admin/request.html +++ b/templates/admin/request.html @@ -111,7 +111,8 @@ margin:.6rem 0; padding:.4rem 0; } - .song-row input[type="checkbox"]{ + .song-row input[type="checkbox"], + .song-row input[type="radio"]{ width:auto; margin:.2rem 0 0 0; flex-shrink:0; @@ -256,8 +257,9 @@
    {% for i in range(steps|length) %} {% set key, label = steps[i] %} - {% set is_completed = i < current_step %} - {% set is_current = i == current_step %} + {% set is_last = i == steps|length - 1 %} + {% set is_completed = i < current_step or (is_last and current_step == i) %} + {% set is_current = i == current_step and not is_last %}
  1. {% if is_completed %}✓{% else %}{{ i + 1 }}{% endif %} @@ -282,10 +284,11 @@ {% if mg_steps[j][0] == current_mg %}{% set ns.mg_index = j %}{% endif %} {% endfor %} {% 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) %} {% set mg_key, mg_label = mg_steps[j] %} - {% set mg_completed = j < ns.mg_index %} - {% set mg_current = j == ns.mg_index %} + {% set mg_completed = j < ns.mg_index or mg_completed_step %} + {% set mg_current = j == ns.mg_index and not mg_completed_step %}
  2. {% if mg_completed %}✓{% else %}{{ j + 1 }}{% endif %}