🐛 fix: sub-step readability, erase_all workaround, error state

Fix 1 — SubStepFrame readability:
- FONT_BODY (12pt) instead of FONT_SMALL dots/labels
- Number-circle colored dots (CIRCLE_PENDING/RUNNING/COMPLETE/ERROR)
- Accent-colored labels matching StepHeader (ACCENT_*)
- Percentage label next to running phase name

Fix 2 — erase_all full-chip erase:
- Creates temp zero-filled file of flash capacity (from flash_model)
- Uses -erase_only with dummy file instead of failing -erase_all flag
- Supports s25fl256s1 (32MB) which lacks density info for -erase_all
- _flash_capacity() maps model name→bytes

Fix 3 — Error state:
- set_phase('error') shows ✗ red on all sub-steps
- Only shows 'done' (green ●) on actual success

Fix 4 — Style consistency:
- Sub-step colors match StepHeader: CIRCLE_*/ACCENT_*/SUCCESS/DANGER
This commit is contained in:
Jeremy Shen
2026-06-10 13:51:41 +08:00
parent 95c04d94ae
commit e3e3763dc4
4 changed files with 159 additions and 76 deletions
+5 -2
View File
@@ -1055,9 +1055,12 @@ class MainWindow(ctk.CTk):
elapsed = time.time() - t_step_start
self._log_message(f" ⏱ Step {i+1} completed in {elapsed:.0f}s")
# Step 2: mark all sub-steps done
# Step 2: mark sub-steps based on result
if i == 1 and hasattr(self, '_sub_step_frame'):
self._sub_step_frame.set_phase("done")
if success:
self._sub_step_frame.set_phase("done")
else:
self._sub_step_frame.set_phase("error")
except Exception as e:
results.append(False)
self._set_step_status(i, "error")