feat: color ai outfit detail statuses

This commit is contained in:
2026-07-04 17:59:25 +08:00
parent 8522032b06
commit 4d4347e50e
3 changed files with 59 additions and 2 deletions
+19
View File
@@ -91,6 +91,25 @@ class TestAiOutfitPanelDefaults(unittest.TestCase):
self.assertLessEqual(panel._table.columnWidth(3), 90)
self.assertLessEqual(panel._table.columnWidth(5), 130)
def test_detail_status_column_uses_semantic_colors(self):
from core.models import OutfitTask
panel = self._panel()
task = OutfitTask(row_index=2, title="标题", product_id="SKU", garment_path="a.png")
panel._populate_table([task])
expected = {
"待处理": "#666666",
"生成中": "#0078d4",
"完成": "#107c10",
"失败": "#c42b1c",
"跳过": "#8a8a8a",
"停止": "#8a8a8a",
}
for status, color in expected.items():
panel._set_cell(0, 4, status)
self.assertEqual(panel._table.item(0, 4).foreground().color().name(), color)
def test_title_group_present_no_dropdown_preview_removed(self):
"""标题生成组存在;无标题模型下拉(配置定名 §17.3);预览块已移除。"""
from PySide6.QtWidgets import QLabel