比较提交
5 提交
codex/ui-n
...
main
| 作者 | SHA1 | 提交日期 | |
|---|---|---|---|
| ad6e21de88 | |||
| 70821748bc | |||
| 0abc656000 | |||
| 26960a98f5 | |||
| 044f2b7822 |
共有 40 个文件被更改,包括 1786 次插入 和 201 次删除
|
|
@ -1,3 +1,7 @@
|
||||||
|
## 1.0.66
|
||||||
|
|
||||||
|
- Complete P0-P2 style-profile hardening: decouple age and anatomy evidence, enforce review consistency caps, gate core traits by cross-context evidence, re-audit semantic rewrites, deduplicate scale capsules, use neutral validation scenes, add layered rendering review, improve score trust display, and block automatic adoption of regressed candidates.
|
||||||
|
|
||||||
## 1.0.65
|
## 1.0.65
|
||||||
|
|
||||||
- Improve style transfer with adaptive face and eye proportions, opaque pearlescent hair-highlight constraints, high-frequency representative-image guidance, and representative reference validation enabled by default with safe pure-text fallback.
|
- Improve style transfer with adaptive face and eye proportions, opaque pearlescent hair-highlight constraints, high-frequency representative-image guidance, and representative reference validation enabled by default with safe pure-text fallback.
|
||||||
|
|
|
||||||
|
|
@ -228,7 +228,7 @@ _LITERAL_SHAPE_NEGATIVE_GUARDS: tuple[str, ...] = (
|
||||||
# recomputed on the server from a stable set of dimensions. This keeps scores
|
# recomputed on the server from a stable set of dimensions. This keeps scores
|
||||||
# comparable across providers and prevents a visually attractive image from
|
# comparable across providers and prevents a visually attractive image from
|
||||||
# receiving a high score while missing the actual line, face or shading grammar.
|
# receiving a high score while missing the actual line, face or shading grammar.
|
||||||
STYLE_REVIEW_SCHEMA_VERSION = 2
|
STYLE_REVIEW_SCHEMA_VERSION = 3
|
||||||
STYLE_REVIEW_DIMENSIONS: tuple[str, ...] = (
|
STYLE_REVIEW_DIMENSIONS: tuple[str, ...] = (
|
||||||
"face_structure",
|
"face_structure",
|
||||||
"eye_design",
|
"eye_design",
|
||||||
|
|
@ -277,7 +277,7 @@ DEFAULT_VALIDATION_CASES: tuple[dict[str, Any], ...] = (
|
||||||
{
|
{
|
||||||
"case_key": "portrait",
|
"case_key": "portrait",
|
||||||
"content_prompt": (
|
"content_prompt": (
|
||||||
"a new fictional heroine with short silver hair and teal eyes wearing a simple navy jacket, "
|
"an adult fictional heroine with short silver hair and teal eyes wearing a simple navy jacket, "
|
||||||
"head-and-shoulders portrait against a neutral matte studio background with even diffuse lighting, "
|
"head-and-shoulders portrait against a neutral matte studio background with even diffuse lighting, "
|
||||||
"with a distinct identity and wardrobe; keep subject age band neutral unless the user instruction specifies it"
|
"with a distinct identity and wardrobe; keep subject age band neutral unless the user instruction specifies it"
|
||||||
),
|
),
|
||||||
|
|
@ -295,7 +295,7 @@ DEFAULT_VALIDATION_CASES: tuple[dict[str, Any], ...] = (
|
||||||
{
|
{
|
||||||
"case_key": "novel_scene",
|
"case_key": "novel_scene",
|
||||||
"content_prompt": (
|
"content_prompt": (
|
||||||
"the same new fictional heroine with short silver hair, teal eyes and navy jacket walking through an ordinary town square "
|
"the same adult fictional heroine with short silver hair, teal eyes and navy jacket walking through an ordinary town square "
|
||||||
"during overcast daytime, wide environmental view with diffuse light, clear depth and a scene unrelated to the source samples"
|
"during overcast daytime, wide environmental view with diffuse light, clear depth and a scene unrelated to the source samples"
|
||||||
),
|
),
|
||||||
"aspect_ratio": "16:9",
|
"aspect_ratio": "16:9",
|
||||||
|
|
@ -1734,6 +1734,7 @@ class AdvancedStyleSetService:
|
||||||
structures,
|
structures,
|
||||||
),
|
),
|
||||||
"feature_evidence": _list(provider_result.get("feature_evidence")),
|
"feature_evidence": _list(provider_result.get("feature_evidence")),
|
||||||
|
"color_hierarchy": _normalize_color_hierarchy(provider_result.get("color_hierarchy")),
|
||||||
"prompt_priority_groups": _object(provider_result.get("prompt_priority_groups")),
|
"prompt_priority_groups": _object(provider_result.get("prompt_priority_groups")),
|
||||||
"scale_capsules": _object(provider_result.get("scale_capsules")),
|
"scale_capsules": _object(provider_result.get("scale_capsules")),
|
||||||
"semantic_risk_audit": _list(provider_result.get("semantic_risk_audit")),
|
"semantic_risk_audit": _list(provider_result.get("semantic_risk_audit")),
|
||||||
|
|
@ -2326,6 +2327,7 @@ class AdvancedStyleSetService:
|
||||||
else {}
|
else {}
|
||||||
)
|
)
|
||||||
semantic_risks = _normalize_semantic_risks(payload.get("semantic_risks"))
|
semantic_risks = _normalize_semantic_risks(payload.get("semantic_risks"))
|
||||||
|
layer_scores = _normalize_rendering_layer_scores(payload.get("rendering_layers"))
|
||||||
score, score_meta = _weighted_style_fidelity_score(
|
score, score_meta = _weighted_style_fidelity_score(
|
||||||
case.case_key,
|
case.case_key,
|
||||||
dimension_scores,
|
dimension_scores,
|
||||||
|
|
@ -2349,6 +2351,7 @@ class AdvancedStyleSetService:
|
||||||
"style_deltas": style_deltas,
|
"style_deltas": style_deltas,
|
||||||
"prompt_patch": prompt_patch,
|
"prompt_patch": prompt_patch,
|
||||||
"semantic_risks": semantic_risks,
|
"semantic_risks": semantic_risks,
|
||||||
|
"rendering_layers": layer_scores,
|
||||||
"content_leakage": _string_list(payload.get("content_leakage")),
|
"content_leakage": _string_list(payload.get("content_leakage")),
|
||||||
"correction_prompt": _optional_text(payload.get("correction_prompt")) or recognition.prompt,
|
"correction_prompt": _optional_text(payload.get("correction_prompt")) or recognition.prompt,
|
||||||
"negative_correction_prompt": _optional_text(payload.get("negative_correction_prompt")) or recognition.negative_prompt,
|
"negative_correction_prompt": _optional_text(payload.get("negative_correction_prompt")) or recognition.negative_prompt,
|
||||||
|
|
@ -2478,7 +2481,7 @@ def _consensus_instruction(
|
||||||
"surface/shape/placement descriptions over metaphors or object-like shorthand. consensus_style; "
|
"surface/shape/placement descriptions over metaphors or object-like shorthand. consensus_style; "
|
||||||
"variable_style_features; source_content_features; content_leakage_exclusions; outlier_source_ids; "
|
"variable_style_features; source_content_features; content_leakage_exclusions; outlier_source_ids; "
|
||||||
"representative_source_ids (1-3); artist_signature containing 4-8 high-specificity, source-supported painterly traits that distinguish this artist from generic anime. Balance the signature across available dimensions: face_structure, eye_design, hair_rendering, linework, shading, palette, highlights, texture and anatomy. Each signature item must include dimension, phrase, supporting_source_ids, support_ratio and confidence. Prefer concrete observable shape, edge, color and placement relationships over labels such as anime, beautiful or high quality; do not spend all signature slots on one dimension; consensus_confidence; feature_evidence where each item has trait, "
|
"representative_source_ids (1-3); artist_signature containing 4-8 high-specificity, source-supported painterly traits that distinguish this artist from generic anime. Balance the signature across available dimensions: face_structure, eye_design, hair_rendering, linework, shading, palette, highlights, texture and anatomy. Each signature item must include dimension, phrase, supporting_source_ids, support_ratio and confidence. Prefer concrete observable shape, edge, color and placement relationships over labels such as anime, beautiful or high quality; do not spend all signature slots on one dimension; consensus_confidence; feature_evidence where each item has trait, "
|
||||||
"supporting_source_ids, support_ratio and confidence; and validation_cases with exactly portrait, fullbody and "
|
"supporting_source_ids, support_ratio and confidence; and validation review rendering_layers with character_linework, character_coloring, background_linework, background_color, style_unity and optical_effect_interference; validation_cases with exactly portrait, fullbody and "
|
||||||
"novel_scene. Every validation content_prompt must describe a character, clothing, pose, camera and scene "
|
"novel_scene. Every validation content_prompt must describe a character, clothing, pose, camera and scene "
|
||||||
"semantically different from all source samples but remain in a comparable illustration domain. Use neutral matte studio "
|
"semantically different from all source samples but remain in a comparable illustration domain. Use neutral matte studio "
|
||||||
"lighting for portrait, neutral daylight for fullbody and ordinary overcast daytime for novel_scene; do not introduce dawn, "
|
"lighting for portrait, neutral daylight for fullbody and ordinary overcast daytime for novel_scene; do not introduce dawn, "
|
||||||
|
|
@ -3283,6 +3286,7 @@ def _weighted_style_fidelity_score(
|
||||||
|
|
||||||
mismatch_items = _string_list(mismatches)
|
mismatch_items = _string_list(mismatches)
|
||||||
delta_items = [item for item in _list(deltas) if isinstance(item, dict)]
|
delta_items = [item for item in _list(deltas) if isinstance(item, dict)]
|
||||||
|
reported_scores = dict(scores)
|
||||||
patch = prompt_patch if isinstance(prompt_patch, dict) else {}
|
patch = prompt_patch if isinstance(prompt_patch, dict) else {}
|
||||||
risk_items = [item for item in _list(semantic_risks) if isinstance(item, dict)]
|
risk_items = [item for item in _list(semantic_risks) if isinstance(item, dict)]
|
||||||
patch_count = (
|
patch_count = (
|
||||||
|
|
@ -3295,6 +3299,22 @@ def _weighted_style_fidelity_score(
|
||||||
if isinstance(item, dict)
|
if isinstance(item, dict)
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
capped_scores = _cap_inconsistent_dimension_scores(
|
||||||
|
scores,
|
||||||
|
mismatches=mismatch_items,
|
||||||
|
deltas=delta_items,
|
||||||
|
prompt_patch=patch,
|
||||||
|
semantic_risks=risk_items,
|
||||||
|
)
|
||||||
|
dimension_consistency_capped = capped_scores != scores
|
||||||
|
if dimension_consistency_capped:
|
||||||
|
scores = capped_scores
|
||||||
|
available_weight = sum(weights.get(key, 0.0) for key in scores)
|
||||||
|
if available_weight > 0:
|
||||||
|
computed = sum(scores[key] * weights.get(key, 0.0) for key in scores) / available_weight
|
||||||
|
score = computed if provider_score is None or available_weight >= 0.75 else (
|
||||||
|
computed * available_weight + provider_score * (1.0 - available_weight)
|
||||||
|
)
|
||||||
mismatch_penalty = min(0.12, 0.025 * len(mismatch_items))
|
mismatch_penalty = min(0.12, 0.025 * len(mismatch_items))
|
||||||
delta_penalty = min(
|
delta_penalty = min(
|
||||||
0.16,
|
0.16,
|
||||||
|
|
@ -3303,7 +3323,7 @@ def _weighted_style_fidelity_score(
|
||||||
patch_penalty = min(0.10, 0.02 * patch_count)
|
patch_penalty = min(0.10, 0.02 * patch_count)
|
||||||
semantic_risk_penalty = min(0.12, 0.03 * len(risk_items))
|
semantic_risk_penalty = min(0.12, 0.03 * len(risk_items))
|
||||||
has_correction_text = bool(mismatch_items or delta_items or patch_count or risk_items)
|
has_correction_text = bool(mismatch_items or delta_items or patch_count or risk_items)
|
||||||
all_reported_perfect = bool(scores) and all(value >= 0.98 for value in scores.values())
|
all_reported_perfect = bool(reported_scores) and all(value >= 0.98 for value in reported_scores.values())
|
||||||
review_inconsistent = all_reported_perfect and has_correction_text
|
review_inconsistent = all_reported_perfect and has_correction_text
|
||||||
inconsistency_penalty = 0.08 if review_inconsistent else 0.0
|
inconsistency_penalty = 0.08 if review_inconsistent else 0.0
|
||||||
consistency_penalty = (
|
consistency_penalty = (
|
||||||
|
|
@ -3328,6 +3348,7 @@ def _weighted_style_fidelity_score(
|
||||||
"provider_score": provider_score,
|
"provider_score": provider_score,
|
||||||
"missing_dimensions": [key for key in STYLE_REVIEW_DIMENSIONS if key not in scores and weights.get(key, 0.0) > 0],
|
"missing_dimensions": [key for key in STYLE_REVIEW_DIMENSIONS if key not in scores and weights.get(key, 0.0) > 0],
|
||||||
"review_inconsistent": review_inconsistent,
|
"review_inconsistent": review_inconsistent,
|
||||||
|
"dimension_consistency_capped": dimension_consistency_capped,
|
||||||
"consistency_penalty": round(consistency_penalty, 4),
|
"consistency_penalty": round(consistency_penalty, 4),
|
||||||
"penalty_breakdown": {
|
"penalty_breakdown": {
|
||||||
"mismatches": round(mismatch_penalty, 4),
|
"mismatches": round(mismatch_penalty, 4),
|
||||||
|
|
@ -3340,6 +3361,38 @@ def _weighted_style_fidelity_score(
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
|
def _cap_inconsistent_dimension_scores(
|
||||||
|
scores: dict[str, float],
|
||||||
|
*,
|
||||||
|
mismatches: list[str],
|
||||||
|
deltas: list[dict[str, Any]],
|
||||||
|
prompt_patch: dict[str, Any],
|
||||||
|
semantic_risks: list[dict[str, Any]],
|
||||||
|
) -> dict[str, float]:
|
||||||
|
if not scores:
|
||||||
|
return scores
|
||||||
|
affected: set[str] = set()
|
||||||
|
for item in deltas:
|
||||||
|
dimension = _canonical_style_dimension(item.get("dimension"))
|
||||||
|
if dimension:
|
||||||
|
affected.add(dimension)
|
||||||
|
patch_text = " ".join(
|
||||||
|
[*_prompt_parts(prompt_patch.get("positive_additions")), *_prompt_parts(prompt_patch.get("negative_additions"))]
|
||||||
|
)
|
||||||
|
for dimension in STYLE_REVIEW_DIMENSIONS:
|
||||||
|
if _prompt_traits_overlap(patch_text, dimension.replace("_", " ")):
|
||||||
|
affected.add(dimension)
|
||||||
|
if semantic_risks:
|
||||||
|
affected.update({"hair_rendering", "highlights"})
|
||||||
|
if mismatches and not affected:
|
||||||
|
affected.update(scores)
|
||||||
|
capped = dict(scores)
|
||||||
|
for dimension in affected:
|
||||||
|
if dimension in capped and capped[dimension] >= 0.98:
|
||||||
|
capped[dimension] = 0.95
|
||||||
|
return capped
|
||||||
|
|
||||||
|
|
||||||
def _normalize_style_deltas(value: Any, *, case_key: Any) -> list[dict[str, Any]]:
|
def _normalize_style_deltas(value: Any, *, case_key: Any) -> list[dict[str, Any]]:
|
||||||
if not isinstance(value, list):
|
if not isinstance(value, list):
|
||||||
return []
|
return []
|
||||||
|
|
@ -3414,6 +3467,47 @@ def _normalize_style_prompt_patch(
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
def _normalize_color_hierarchy(value: Any) -> dict[str, str]:
|
||||||
|
if not isinstance(value, dict):
|
||||||
|
return {}
|
||||||
|
aliases = {
|
||||||
|
"global_value_range": ("global_value_range", "value_range", "global_values"),
|
||||||
|
"global_saturation_range": ("global_saturation_range", "saturation_range", "global_saturation"),
|
||||||
|
"local_color_separation": ("local_color_separation", "color_separation", "local_contrast"),
|
||||||
|
"shadow_hue_relationship": ("shadow_hue_relationship", "shadow_hue", "shadow_color_relationship"),
|
||||||
|
"highlight_temperature": ("highlight_temperature", "highlight_hue", "highlight_color_temperature"),
|
||||||
|
"character_background_contrast": ("character_background_contrast", "figure_background_contrast"),
|
||||||
|
}
|
||||||
|
result: dict[str, str] = {}
|
||||||
|
for canonical, names in aliases.items():
|
||||||
|
for name in names:
|
||||||
|
text = _optional_text(value.get(name))
|
||||||
|
if text:
|
||||||
|
result[canonical] = text
|
||||||
|
break
|
||||||
|
return result
|
||||||
|
|
||||||
|
|
||||||
|
def _normalize_rendering_layer_scores(value: Any) -> dict[str, float]:
|
||||||
|
aliases = {
|
||||||
|
"character_linework": ("character_linework", "figure_linework", "person_linework"),
|
||||||
|
"character_coloring": ("character_coloring", "figure_coloring", "person_coloring"),
|
||||||
|
"background_linework": ("background_linework", "environment_linework"),
|
||||||
|
"background_color": ("background_color", "environment_color", "background_palette"),
|
||||||
|
"style_unity": ("style_unity", "figure_background_unity", "style_consistency"),
|
||||||
|
"optical_effect_interference": ("optical_effect_interference", "effect_interference", "light_obscures_style"),
|
||||||
|
}
|
||||||
|
if not isinstance(value, dict):
|
||||||
|
return {}
|
||||||
|
normalized: dict[str, float] = {}
|
||||||
|
for canonical, names in aliases.items():
|
||||||
|
values = [_score(value.get(name)) for name in names if value.get(name) is not None]
|
||||||
|
values = [item for item in values if item is not None]
|
||||||
|
if values:
|
||||||
|
normalized[canonical] = round(sum(values) / len(values), 4)
|
||||||
|
return normalized
|
||||||
|
|
||||||
|
|
||||||
def _normalize_semantic_risks(value: Any) -> list[dict[str, Any]]:
|
def _normalize_semantic_risks(value: Any) -> list[dict[str, Any]]:
|
||||||
if not isinstance(value, list):
|
if not isinstance(value, list):
|
||||||
return []
|
return []
|
||||||
|
|
@ -3424,17 +3518,35 @@ def _normalize_semantic_risks(value: Any) -> list[dict[str, Any]]:
|
||||||
original = _optional_text(item.get("original_phrase"))
|
original = _optional_text(item.get("original_phrase"))
|
||||||
rewrite = _optional_text(item.get("safe_rewrite"))
|
rewrite = _optional_text(item.get("safe_rewrite"))
|
||||||
if original or rewrite:
|
if original or rewrite:
|
||||||
|
safe_rewrite, generated_guard = _sanitize_semantic_rewrite(rewrite)
|
||||||
result.append(
|
result.append(
|
||||||
{
|
{
|
||||||
"original_phrase": original,
|
"original_phrase": original,
|
||||||
"risk": _optional_text(item.get("risk")),
|
"risk": _optional_text(item.get("risk")),
|
||||||
"safe_rewrite": rewrite,
|
"safe_rewrite": safe_rewrite,
|
||||||
"negative_guard": _optional_text(item.get("negative_guard")),
|
"negative_guard": _join_prompt(_optional_text(item.get("negative_guard")), generated_guard),
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
return result
|
return result
|
||||||
|
|
||||||
|
|
||||||
|
def _sanitize_semantic_rewrite(value: Any) -> tuple[str | None, str | None]:
|
||||||
|
text = _clean_prompt_text(str(value or "").strip())
|
||||||
|
if not text:
|
||||||
|
return None, None
|
||||||
|
if _HAIR_HIGHLIGHT_PATTERNS.search(text) and _semantic_phrase_is_object_risky(text):
|
||||||
|
text = _HAIR_HIGHLIGHT_SAFE_REWRITE
|
||||||
|
if _semantic_phrase_is_object_risky(text):
|
||||||
|
text = re.sub(
|
||||||
|
r"\b(ring|halo|band|bar|stripe|crown|orb|ribbon|frame|glow\s+line)\b",
|
||||||
|
"surface-bound painted accent",
|
||||||
|
text,
|
||||||
|
flags=re.IGNORECASE,
|
||||||
|
)
|
||||||
|
guard = ", ".join(_LITERAL_SHAPE_NEGATIVE_GUARDS) if _semantic_phrase_is_object_risky(value) else None
|
||||||
|
return text, guard
|
||||||
|
|
||||||
|
|
||||||
def _aggregate_style_review_feedback(cases: list[Any]) -> dict[str, Any]:
|
def _aggregate_style_review_feedback(cases: list[Any]) -> dict[str, Any]:
|
||||||
reviewed = []
|
reviewed = []
|
||||||
dimension_values: dict[str, list[float]] = {}
|
dimension_values: dict[str, list[float]] = {}
|
||||||
|
|
@ -3479,6 +3591,7 @@ def _aggregate_style_review_feedback(cases: list[Any]) -> dict[str, Any]:
|
||||||
"style_deltas": deltas,
|
"style_deltas": deltas,
|
||||||
"prompt_patches": prompt_patches,
|
"prompt_patches": prompt_patches,
|
||||||
"semantic_risks": semantic_risks,
|
"semantic_risks": semantic_risks,
|
||||||
|
"rendering_layer_averages": _average_layer_scores(cases),
|
||||||
"correction_policy": {
|
"correction_policy": {
|
||||||
"common_style": "apply only findings repeated across at least two scenarios or explicitly marked global",
|
"common_style": "apply only findings repeated across at least two scenarios or explicitly marked global",
|
||||||
"scale_specific": "keep isolated findings inside the matching portrait/fullbody/novel_scene capsule",
|
"scale_specific": "keep isolated findings inside the matching portrait/fullbody/novel_scene capsule",
|
||||||
|
|
@ -3488,6 +3601,15 @@ def _aggregate_style_review_feedback(cases: list[Any]) -> dict[str, Any]:
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
def _average_layer_scores(cases: list[Any]) -> dict[str, float]:
|
||||||
|
values: dict[str, list[float]] = {}
|
||||||
|
for case in cases:
|
||||||
|
review = case.style_review if isinstance(getattr(case, "style_review", None), dict) else {}
|
||||||
|
for key, score in _normalize_rendering_layer_scores(review.get("rendering_layers")).items():
|
||||||
|
values.setdefault(key, []).append(score)
|
||||||
|
return {key: round(sum(items) / len(items), 4) for key, items in values.items() if items}
|
||||||
|
|
||||||
|
|
||||||
def _style_attempt_comparison(
|
def _style_attempt_comparison(
|
||||||
*,
|
*,
|
||||||
current_attempt: Any,
|
current_attempt: Any,
|
||||||
|
|
@ -3498,14 +3620,6 @@ def _style_attempt_comparison(
|
||||||
current_score = _score(getattr(current_attempt, "fidelity_score", None))
|
current_score = _score(getattr(current_attempt, "fidelity_score", None))
|
||||||
previous_score = _score(getattr(previous_attempt, "fidelity_score", None)) if previous_attempt is not None else None
|
previous_score = _score(getattr(previous_attempt, "fidelity_score", None)) if previous_attempt is not None else None
|
||||||
delta = current_score - previous_score if current_score is not None and previous_score is not None else None
|
delta = current_score - previous_score if current_score is not None and previous_score is not None else None
|
||||||
if delta is None:
|
|
||||||
recommendation = "baseline"
|
|
||||||
elif delta >= 0.02:
|
|
||||||
recommendation = "adopt_candidate"
|
|
||||||
elif delta <= -0.02:
|
|
||||||
recommendation = "keep_previous_candidate"
|
|
||||||
else:
|
|
||||||
recommendation = "equivalent_requires_human_review"
|
|
||||||
current_by_key = {str(item.case_key): _score(item.fidelity_score) for item in current_cases}
|
current_by_key = {str(item.case_key): _score(item.fidelity_score) for item in current_cases}
|
||||||
previous_by_key = {str(item.case_key): _score(item.fidelity_score) for item in previous_cases}
|
previous_by_key = {str(item.case_key): _score(item.fidelity_score) for item in previous_cases}
|
||||||
scenario_deltas = {
|
scenario_deltas = {
|
||||||
|
|
@ -3513,6 +3627,21 @@ def _style_attempt_comparison(
|
||||||
for key in current_by_key.keys() & previous_by_key.keys()
|
for key in current_by_key.keys() & previous_by_key.keys()
|
||||||
if current_by_key[key] is not None and previous_by_key[key] is not None
|
if current_by_key[key] is not None and previous_by_key[key] is not None
|
||||||
}
|
}
|
||||||
|
current_feedback = _aggregate_style_review_feedback(current_cases)
|
||||||
|
current_risks = current_feedback.get("semantic_risks") or []
|
||||||
|
scenario_regressions = {key: value for key, value in scenario_deltas.items() if value <= -0.05}
|
||||||
|
if delta is None:
|
||||||
|
recommendation = "baseline"
|
||||||
|
elif current_risks:
|
||||||
|
recommendation = "keep_previous_candidate"
|
||||||
|
elif scenario_regressions:
|
||||||
|
recommendation = "keep_previous_candidate"
|
||||||
|
elif delta >= 0.02:
|
||||||
|
recommendation = "adopt_candidate"
|
||||||
|
elif delta <= -0.02:
|
||||||
|
recommendation = "keep_previous_candidate"
|
||||||
|
else:
|
||||||
|
recommendation = "equivalent_requires_human_review"
|
||||||
return {
|
return {
|
||||||
"schema_version": 1,
|
"schema_version": 1,
|
||||||
"current_attempt_id": str(current_attempt.attempt_id),
|
"current_attempt_id": str(current_attempt.attempt_id),
|
||||||
|
|
@ -3523,6 +3652,10 @@ def _style_attempt_comparison(
|
||||||
"scenario_deltas": scenario_deltas,
|
"scenario_deltas": scenario_deltas,
|
||||||
"recommendation": recommendation,
|
"recommendation": recommendation,
|
||||||
"regression_threshold": 0.02,
|
"regression_threshold": 0.02,
|
||||||
|
"scenario_regression_threshold": 0.05,
|
||||||
|
"scenario_regressions": scenario_regressions,
|
||||||
|
"new_semantic_risk_count": len(current_risks),
|
||||||
|
"automatic_adoption_blocked": recommendation == "keep_previous_candidate" and (bool(current_risks) or bool(scenario_regressions)),
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -3540,17 +3673,34 @@ def _normalized_feature_evidence(value: Any) -> list[dict[str, Any]]:
|
||||||
"trait": trait,
|
"trait": trait,
|
||||||
"support_ratio": support,
|
"support_ratio": support,
|
||||||
"confidence": confidence,
|
"confidence": confidence,
|
||||||
|
"cross_context_supported": _evidence_cross_context_support(item),
|
||||||
"supported": bool(
|
"supported": bool(
|
||||||
support is not None
|
support is not None
|
||||||
and confidence is not None
|
and confidence is not None
|
||||||
and support >= STYLE_EVIDENCE_MIN_SUPPORT
|
and support >= STYLE_EVIDENCE_MIN_SUPPORT
|
||||||
and confidence >= STYLE_EVIDENCE_MIN_CONFIDENCE
|
and confidence >= STYLE_EVIDENCE_MIN_CONFIDENCE
|
||||||
|
and _evidence_cross_context_support(item)
|
||||||
),
|
),
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
return result
|
return result
|
||||||
|
|
||||||
|
|
||||||
|
def _evidence_cross_context_support(item: dict[str, Any]) -> bool:
|
||||||
|
checks: list[bool] = []
|
||||||
|
for key in ("cross_role_support", "cross_scene_support", "cross_palette_support", "cross_context_support"):
|
||||||
|
if key in item:
|
||||||
|
checks.append(bool(item.get(key)))
|
||||||
|
for key in ("supporting_roles", "supporting_scenes", "supporting_contexts", "supporting_palette_families"):
|
||||||
|
if key in item:
|
||||||
|
values = item.get(key)
|
||||||
|
checks.append(
|
||||||
|
isinstance(values, list)
|
||||||
|
and len({str(value).strip().casefold() for value in values if str(value).strip()}) >= 2
|
||||||
|
)
|
||||||
|
return all(checks) if checks else True
|
||||||
|
|
||||||
|
|
||||||
def _style_trait_is_supported(
|
def _style_trait_is_supported(
|
||||||
value: Any,
|
value: Any,
|
||||||
evidence: list[dict[str, Any]],
|
evidence: list[dict[str, Any]],
|
||||||
|
|
@ -3564,7 +3714,10 @@ def _style_trait_is_supported(
|
||||||
return False
|
return False
|
||||||
matching = [item for item in evidence if _prompt_traits_overlap(text, item.get("trait"))]
|
matching = [item for item in evidence if _prompt_traits_overlap(text, item.get("trait"))]
|
||||||
if matching:
|
if matching:
|
||||||
return any(bool(item.get("supported")) for item in matching)
|
return any(
|
||||||
|
bool(item.get("supported")) and bool(item.get("cross_context_supported", True))
|
||||||
|
for item in matching
|
||||||
|
)
|
||||||
return not required
|
return not required
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -3900,13 +4053,15 @@ def _detailed_style_prompt(result: Any, fallback: Any) -> str:
|
||||||
profile = payload.get("normalized_asset_profile") if isinstance(payload.get("normalized_asset_profile"), dict) else {}
|
profile = payload.get("normalized_asset_profile") if isinstance(payload.get("normalized_asset_profile"), dict) else {}
|
||||||
must_preserve = _unique_prompt_parts([*must_preserve, *_prompt_parts(profile.get("must_preserve"))])
|
must_preserve = _unique_prompt_parts([*must_preserve, *_prompt_parts(profile.get("must_preserve"))])
|
||||||
priorities = payload.get("prompt_priority_groups") if isinstance(payload.get("prompt_priority_groups"), dict) else {}
|
priorities = payload.get("prompt_priority_groups") if isinstance(payload.get("prompt_priority_groups"), dict) else {}
|
||||||
priority_parts = [
|
|
||||||
*_prompt_parts(priorities.get("core")),
|
|
||||||
*_prompt_parts(priorities.get("structural")),
|
|
||||||
*_prompt_parts(priorities.get("rendering")),
|
|
||||||
]
|
|
||||||
evidence = _normalized_feature_evidence(payload.get("feature_evidence"))
|
evidence = _normalized_feature_evidence(payload.get("feature_evidence"))
|
||||||
strict_evidence = bool(evidence)
|
strict_evidence = bool(evidence)
|
||||||
|
priority_parts = [
|
||||||
|
(item, True) for item in _prompt_parts(priorities.get("core"))
|
||||||
|
] + [
|
||||||
|
(item, False) for item in _prompt_parts(priorities.get("structural"))
|
||||||
|
] + [
|
||||||
|
(item, False) for item in _prompt_parts(priorities.get("rendering"))
|
||||||
|
]
|
||||||
gated_must_preserve = [
|
gated_must_preserve = [
|
||||||
item for item in must_preserve
|
item for item in must_preserve
|
||||||
if _style_trait_is_supported(item, evidence, required=strict_evidence)
|
if _style_trait_is_supported(item, evidence, required=strict_evidence)
|
||||||
|
|
@ -3914,11 +4069,11 @@ def _detailed_style_prompt(result: Any, fallback: Any) -> str:
|
||||||
# Preserve compact provider-derived style priorities, but still gate literal
|
# Preserve compact provider-derived style priorities, but still gate literal
|
||||||
# scene/optical effects that lack cross-image evidence.
|
# scene/optical effects that lack cross-image evidence.
|
||||||
gated_priorities = [
|
gated_priorities = [
|
||||||
item for item in priority_parts
|
item for item, is_core in priority_parts
|
||||||
if _style_trait_is_supported(
|
if _style_trait_is_supported(
|
||||||
item,
|
item,
|
||||||
evidence,
|
evidence,
|
||||||
required=bool(_VARIABLE_CONTENT_PATTERNS.search(item)),
|
required=is_core or bool(_VARIABLE_CONTENT_PATTERNS.search(item)),
|
||||||
)
|
)
|
||||||
]
|
]
|
||||||
capsule_parts = [
|
capsule_parts = [
|
||||||
|
|
@ -3930,8 +4085,10 @@ def _detailed_style_prompt(result: Any, fallback: Any) -> str:
|
||||||
)
|
)
|
||||||
]
|
]
|
||||||
signature_parts = _artist_signature_prompt_parts(payload)
|
signature_parts = _artist_signature_prompt_parts(payload)
|
||||||
|
color_hierarchy = payload.get("color_hierarchy") if isinstance(payload.get("color_hierarchy"), dict) else {}
|
||||||
|
color_parts = [f"{key.replace('_', ' ')}: {value}" for key, value in color_hierarchy.items()]
|
||||||
# Priority groups are the compact style kernel; signatures and capsules are supplementary evidence.
|
# Priority groups are the compact style kernel; signatures and capsules are supplementary evidence.
|
||||||
supplemental_parts = [*gated_must_preserve, *capsule_parts, *signature_parts]
|
supplemental_parts = [*gated_must_preserve, *capsule_parts, *signature_parts, *color_parts]
|
||||||
# Structural age stylization / body-ratio cues are not optional traits; keep them even when
|
# Structural age stylization / body-ratio cues are not optional traits; keep them even when
|
||||||
# feature_evidence only covers linework/eyes. Chronological age attributes stay excluded.
|
# feature_evidence only covers linework/eyes. Chronological age attributes stay excluded.
|
||||||
for key, raw in (profile.get("attributes") or {}).items() if isinstance(profile.get("attributes"), dict) else []:
|
for key, raw in (profile.get("attributes") or {}).items() if isinstance(profile.get("attributes"), dict) else []:
|
||||||
|
|
@ -4022,6 +4179,10 @@ def _scale_specific_style_prompt(result: Any, case_key: str, common_prompt: Any
|
||||||
clauses = []
|
clauses = []
|
||||||
for part in parts:
|
for part in parts:
|
||||||
clauses.extend(_split_prompt_clauses(part))
|
clauses.extend(_split_prompt_clauses(part))
|
||||||
|
if common_prompt is None:
|
||||||
|
capsules = payload.get("generation_capsules") if isinstance(payload.get("generation_capsules"), dict) else {}
|
||||||
|
detailed = capsules.get("detailed") if isinstance(capsules.get("detailed"), dict) else {}
|
||||||
|
common_prompt = _join_prompt(*_prompt_parts(detailed.get("prompt_parts")), *_prompt_parts(detailed.get("must_preserve")))
|
||||||
common_clauses = _split_prompt_clauses(common_prompt)
|
common_clauses = _split_prompt_clauses(common_prompt)
|
||||||
scale_only = [
|
scale_only = [
|
||||||
item for item in clauses
|
item for item in clauses
|
||||||
|
|
@ -4072,9 +4233,8 @@ def _apply_semantic_risk_rewrites(value: str, risks: list[dict[str, Any]]) -> st
|
||||||
rewrite = _optional_text(item.get("safe_rewrite"))
|
rewrite = _optional_text(item.get("safe_rewrite"))
|
||||||
if original and rewrite:
|
if original and rewrite:
|
||||||
result = re.sub(re.escape(original), rewrite, result, flags=re.IGNORECASE)
|
result = re.sub(re.escape(original), rewrite, result, flags=re.IGNORECASE)
|
||||||
if _semantic_phrase_is_object_risky(result) and _HAIR_HIGHLIGHT_PATTERNS.search(result):
|
safe, _guard = _sanitize_semantic_rewrite(result)
|
||||||
return _HAIR_HIGHLIGHT_SAFE_REWRITE
|
return safe or result
|
||||||
return result
|
|
||||||
|
|
||||||
|
|
||||||
def _compact_style_prompt_parts(values: list[str], *, limit: int) -> list[str]:
|
def _compact_style_prompt_parts(values: list[str], *, limit: int) -> list[str]:
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
plugin:
|
plugin:
|
||||||
name: astrbot_plugin_imagestudio
|
name: astrbot_plugin_imagestudio
|
||||||
display_name: ImageStudio
|
display_name: ImageStudio
|
||||||
version: 1.0.65
|
version: 1.0.66
|
||||||
|
|
||||||
features:
|
features:
|
||||||
quick_profile: true
|
quick_profile: true
|
||||||
|
|
|
||||||
|
|
@ -10,7 +10,7 @@ from core.runtime_paths import resolve_config_path
|
||||||
from database.db_helper import load_config_payload
|
from database.db_helper import load_config_payload
|
||||||
|
|
||||||
|
|
||||||
PLUGIN_VERSION = "1.0.65"
|
PLUGIN_VERSION = "1.0.66"
|
||||||
|
|
||||||
|
|
||||||
@dataclass(frozen=True)
|
@dataclass(frozen=True)
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,83 @@
|
||||||
|
# ImageStudio 前端 UI 审计
|
||||||
|
|
||||||
|
日期:2026-07-21
|
||||||
|
范围:`frontend/standalone-web` 工作台、共享 API 类型、导航与 Gallery 页面
|
||||||
|
方法:Impeccable `audit` 技术检查、源码静态审计、基线 typecheck/build/contract tests
|
||||||
|
|
||||||
|
## 项目盘点
|
||||||
|
|
||||||
|
### 技术栈与入口
|
||||||
|
|
||||||
|
- Vue 3 Composition API + TypeScript + Vite 6。
|
||||||
|
- 独立 Web 入口:`frontend/standalone-web/src/main.ts` → `App.vue`。
|
||||||
|
- AstrBot 插件页入口:`frontend/plugin-page/src/main.ts`,通过 `astrbot-page-bridge` 注入后复用 `standalone-web/src/App.vue`。
|
||||||
|
- API 统一入口:`frontend/shared/api/client.ts`;路径常量集中在 `frontend/shared/api/endpoints.ts`,基础路径为 `/api/v1/plugins/extensions/astrbot_plugin_imagestudio`。
|
||||||
|
- 当前无 Vue Router;页面切换由 `activeNav` + URL 查询参数 `view` / `module` / `materialView` / `profile` 维护,并使用 `history.replaceState`。
|
||||||
|
|
||||||
|
### 页面与主要组件
|
||||||
|
|
||||||
|
- 工作台页面:overview、generate、queue、performance、gallery、profiles、materials、settings、logs。
|
||||||
|
- 主要页面组件:`GalleryPage.vue`、`ProfilesPage.vue`、`AdvancedMaterialImportPage.vue`、`SettingsPage.vue`、`BackupPage.vue`、`LogsPage.vue`。
|
||||||
|
- 主要复用组件:`AppNavigationRail.vue`、`StateCard.vue`、`EmptyState.vue`、`MetricCardGrid.vue`、多个 Dialog/Drawer 组件。
|
||||||
|
- 复杂业务子域:workflow、profiles、materials;多数页面仍由 `App.vue` 组合和持有状态。
|
||||||
|
|
||||||
|
### 不能改变的契约
|
||||||
|
|
||||||
|
- 不改变导航 key、module 映射、URL 查询参数语义及插件页/独立 Web 双入口。
|
||||||
|
- 不改变 `frontend/shared/api/endpoints.ts` 中的 endpoint 名称、HTTP 方法、请求体字段和响应类型。
|
||||||
|
- 不改变 `frontend/shared/types/**` 的数据结构,尤其是 image、job、workflow、profile、material、settings、storage 相关类型。
|
||||||
|
- 不改变生成、队列、图库批量操作、工作流轮次/分支、角色卡、素材识别、设置备份与日志的现有交互语义。
|
||||||
|
- 不删除 AstrBot plugin page bridge、媒体签名/载荷流程、后端连接状态与错误恢复路径。
|
||||||
|
|
||||||
|
## Audit Health Score
|
||||||
|
|
||||||
|
| 维度 | 分数 | 关键发现 |
|
||||||
|
|---|---:|---|
|
||||||
|
| Accessibility | 2/4 | 已有语义按钮、`aria-current`、`aria-pressed`、状态 live region;但部分表单控件缺少显式 label,图片预览/弹层焦点管理与键盘闭环需要统一验证。 |
|
||||||
|
| Performance | 2/4 | 生产构建可用;`App.vue` 单文件约 22k 行、Web JS gzip 约 211.5 kB,且存在 `transition: width`、`transition: max-height` 等布局属性动画。 |
|
||||||
|
| Theming | 2/4 | 有 dark/light 变量和主色持久化;但 tokens 集中在 `App.vue`,大量页面级颜色/阴影/渐变仍混杂,主题边界难以复用。 |
|
||||||
|
| Responsive Design | 2/4 | Gallery 等页面有 1180/900/560 断点;工作台整体仍依赖 244px rail、宽 topbar 与多列面板,窄桌面窗口存在拥挤/溢出风险。 |
|
||||||
|
| Anti-Patterns | 2/4 | 本地 detector 命中布局属性动画、圆角元素厚边、侧边/顶部强调条、占位图片检测;背景网格、玻璃模糊和多层渐变也提高了视觉噪声。 |
|
||||||
|
| **Total** | **10/20** | **Acceptable:功能基础稳定,但需要有边界的结构化 UI 重构。** |
|
||||||
|
|
||||||
|
## Anti-Patterns Verdict
|
||||||
|
|
||||||
|
**部分通过,仍有明显 AI/模板化痕迹。** 具体包括:工作台背景的装饰性网格、多个 surface 的渐变与 blur、状态卡片的顶部强调条、导航 active 状态的侧边强调、圆角 + 宽阴影组合,以及大单体 App 文件导致的重复视觉词汇难以治理。它们不是功能阻塞,但会让工具界面显得“装饰先于任务”。
|
||||||
|
|
||||||
|
## 问题清单与优先级
|
||||||
|
|
||||||
|
### P0 Blocking
|
||||||
|
|
||||||
|
- 当前没有确认到会阻塞主要任务完成的 P0 UI 问题。基线功能检查全部通过。
|
||||||
|
|
||||||
|
### P1 Major
|
||||||
|
|
||||||
|
- **P1-01:工作台壳层与业务页面耦合过重**:`frontend/standalone-web/src/App.vue` 约 22k 行,同时承载导航、数据加载、弹层、生成器、队列、图库、素材与设置。影响:任何视觉调整都容易触碰业务状态,回归面大。
|
||||||
|
- **P1-02:桌面窄窗口的结构风险**:导航 rail、sticky topbar、双栏工作区和多个固定最小宽度并存,约 1024–1280px 宽度下容易造成操作区压缩、横向滚动或首屏信息层级失衡。
|
||||||
|
- **P1-03:主题 token 没有形成可复用层**:核心变量主要位于 `App.vue` 的全局 style,页面组件继续直接组合 `var(--panel)`、`var(--border)`、颜色混合和阴影。影响:dark/light 与未来页面统一成本高。
|
||||||
|
- **P1-04:交互状态覆盖不均**:部分按钮有 disabled/hover/focus,弹层、批量操作、加载、空态、错误态的状态表达不完全统一;需要以组件级状态矩阵补齐。
|
||||||
|
- **P1-05:可访问性需专项修复**:`GalleryPage.vue` 搜索框和批量 checkbox 等控件依赖邻近文本,部分复杂弹层/预览需要确认 focus return、Escape、焦点陷阱与可读名称;不能只依赖视觉状态。
|
||||||
|
- **P1-06:性能边界**:`App.vue` 产生单一大 JS/CSS 包,构建已给出超过 500 kB 的 chunk 警告;本轮不改业务加载策略,但应避免新增全局样式和重型运行时依赖。
|
||||||
|
|
||||||
|
### P2 Minor
|
||||||
|
|
||||||
|
- **P2-01:视觉节奏不一致**:8/10/12/14/16/18/22/24 等间距和 7/8/10/12 等圆角并存,需抽取有限的 spacing/radius scale。
|
||||||
|
- **P2-02:装饰噪声偏高**:背景网格、渐变、backdrop-filter 在多个层级重复,降低任务区域的对比度和层级清晰度。
|
||||||
|
- **P2-03:状态色与表面色混用**:good/warn/bad/idle 的 border、背景、顶部条规则分散在多个选择器,需集中到语义状态 tokens。
|
||||||
|
- **P2-04:图库卡片信息密度不稳定**:grid/list/inspector 三种模式的操作按钮、选中态和媒体占比不完全一致,批量操作区在窄桌面易成为第二工具栏。
|
||||||
|
- **P2-05:部分过渡动画直接改变布局属性**:检测命中 `transition: width` 与 `transition: max-height`;应优先改为 transform/opacity 或 grid 行过渡。
|
||||||
|
- **P2-06:图片替代文本规则不统一**:多数业务图片有 alt,但预览/通知缩略图存在空 alt 或依赖上下文的情况,需要区分装饰图与内容图。
|
||||||
|
|
||||||
|
## 正向发现
|
||||||
|
|
||||||
|
- 业务 API 与类型文件集中,页面重构可以保持数据契约不变。
|
||||||
|
- 导航、状态卡、空态、预览对话框已有复用组件,不需要推倒重来。
|
||||||
|
- Gallery 已具备搜索、筛选、grid/list、批量操作、预览、错误和 loading 路径,适合作为第一批页面。
|
||||||
|
- 基线 `npm.cmd run typecheck`、`npm.cmd run build:web`、`npm.cmd run test:contracts` 均通过。
|
||||||
|
|
||||||
|
## 来源与边界
|
||||||
|
|
||||||
|
- 本地源码:`frontend/standalone-web/src/App.vue`、`frontend/standalone-web/src/features/gallery/GalleryPage.vue`、`frontend/standalone-web/src/components/AppNavigationRail.vue`、`frontend/shared/api/client.ts`、`frontend/shared/api/endpoints.ts`、`frontend/shared/types/**`。
|
||||||
|
- 本地配置:`frontend/package.json`、`frontend/standalone-web/vite.config.ts`、`frontend/plugin-page/vite.config.ts`。
|
||||||
|
- Impeccable 本地 detector:命中 5 项静态提示,未替代人工审计。
|
||||||
|
- 未使用外部网络资料;本次目标是对现有仓库实现做代码级审计。
|
||||||
|
|
@ -0,0 +1,164 @@
|
||||||
|
# ImageStudio UI 重构后续开发队列
|
||||||
|
|
||||||
|
日期:2026-07-21
|
||||||
|
基线分支:`codex/ui-redesign-gallery`
|
||||||
|
范围:仅覆盖本轮 UI 重构尚未完成的事项;不包含后端功能新增。
|
||||||
|
|
||||||
|
## 当前结论
|
||||||
|
|
||||||
|
- 已完成:共享视觉 token、工作台壳层、主要页面统一 surface/间距/圆角/状态/focus、Gallery 首批重构、桌面横向溢出修复、静态 detector 检查。
|
||||||
|
- 尚未完成:真实 AstrBot 后端数据验收、逐页深度视觉精修、完整键盘/焦点审计、多个桌面尺寸验证、性能拆包、提交与发布收口。
|
||||||
|
- 当前分支仍有未提交源码和文档改动;主支未修改。
|
||||||
|
|
||||||
|
## P0:交付阻断项
|
||||||
|
|
||||||
|
### Q0-01 真实 AstrBot 后端联调
|
||||||
|
|
||||||
|
**目标**:在真实 plugin-page bridge 和后端 API 下验证 UI,不再只依赖 preview mode。
|
||||||
|
**涉及**:`frontend/plugin-page/src/main.ts`、`frontend/shared/api/client.ts`、所有主要页面。
|
||||||
|
**验收**:
|
||||||
|
|
||||||
|
- plugin-page 能加载真实 bootstrap、dashboard、profiles、images、jobs、settings、logs。
|
||||||
|
- 后端未连接、401、超时、空数据、部分数据错误状态均有可读反馈。
|
||||||
|
- 真实媒体签名、预览、刷新和批量操作不出现空白或死状态。
|
||||||
|
|
||||||
|
### Q0-02 保护当前未提交改动并完成分支交付
|
||||||
|
|
||||||
|
**目标**:确认 `GalleryPage.vue` 原有改动与本轮改动的归属,完成 diff review、提交和 PR。
|
||||||
|
**验收**:
|
||||||
|
|
||||||
|
- `git diff --check` 通过。
|
||||||
|
- 无构建产物污染 `web/` 或 `pages/imagestudio/`。
|
||||||
|
- 用户确认后创建 commit/PR;未确认前不合并主支。
|
||||||
|
|
||||||
|
## P1:发布前必须完成
|
||||||
|
|
||||||
|
### Q1-01 逐页深度视觉精修
|
||||||
|
|
||||||
|
当前统一主要通过共享 CSS 层完成,以下页面还需要逐页检查内容层级、密度和操作优先级:
|
||||||
|
|
||||||
|
- Overview:指标条、监控摘要、队列摘要、最近图片之间的层级和密度。
|
||||||
|
- Generate:预览区、提示词输入、模型选择、生成操作和结果信息的空间分配。
|
||||||
|
- Queue:过滤、任务状态、进度、详情和批量操作的优先级。
|
||||||
|
- Performance:指标、趋势/明细、空态和失败态。
|
||||||
|
- Profiles:master/detail/wardrobe 三栏在有数据、无数据和 sealed 状态下的层级。
|
||||||
|
- Materials:导入、识别、确认、筛选、详情和空态。
|
||||||
|
- Settings:section 导航、配置编辑、保存/校验/回滚状态。
|
||||||
|
- Logs:筛选、日志列表、错误状态和长文本换行。
|
||||||
|
- Workflow:节点流、轮次、分支、候选图、审查 dialog、素材 drawer。
|
||||||
|
|
||||||
|
**验收**:每页保留现有功能,并有明确的主操作、次操作、危险操作和恢复路径。
|
||||||
|
|
||||||
|
### Q1-02 完整可访问性审计
|
||||||
|
|
||||||
|
**涉及**:所有 `*.vue` 页面和 Dialog/Drawer 组件。
|
||||||
|
**任务**:
|
||||||
|
|
||||||
|
- 为搜索、筛选、checkbox、select、textarea、icon-only button 补齐稳定 label。
|
||||||
|
- 验证 Tab 顺序、Enter/Space、Escape、焦点回收和 dialog focus trap。
|
||||||
|
- 检查 heading 层级、landmark、`aria-current`、`aria-expanded`、`aria-selected`、`aria-live`。
|
||||||
|
- 检查真实图片 alt、装饰图空 alt、加载/失败图片的替代内容。
|
||||||
|
- 使用键盘完成 Gallery 批量操作、Profiles 选择、Workflow 节点操作和 Settings 保存。
|
||||||
|
|
||||||
|
**验收**:关键路径不依赖鼠标;焦点在 dark/light 两主题下可见。
|
||||||
|
|
||||||
|
### Q1-03 多尺寸响应式验收
|
||||||
|
|
||||||
|
**必须验证尺寸**:
|
||||||
|
|
||||||
|
- 1024×768:窄桌面,检查 rail、topbar、双栏/三栏区域。
|
||||||
|
- 1280×800:常见桌面工作区。
|
||||||
|
- 1440×900:宽桌面,检查内容是否过度拉伸。
|
||||||
|
- 1600×900:超宽窗口,检查 max-width 和阅读线长。
|
||||||
|
|
||||||
|
**验收**:无横向溢出;sticky topbar/rail 不遮挡内容;批量工具栏和 dialog 不被裁切。
|
||||||
|
|
||||||
|
### Q1-04 状态矩阵补齐
|
||||||
|
|
||||||
|
为每个主要页面记录并验证:default、hover、focus、active/selected、disabled、loading、empty、error、success、backend disconnected。
|
||||||
|
重点组件:按钮、tabs、filters、cards、dialogs、drawers、图片预览、表单保存栏。
|
||||||
|
|
||||||
|
## P2:质量和维护性
|
||||||
|
|
||||||
|
### Q2-01 视觉回归测试
|
||||||
|
|
||||||
|
- 为 9 个主要 view 建立最小 Playwright/浏览器 smoke test。
|
||||||
|
- 固定至少一组 dark/light 截图或 DOM 断言。
|
||||||
|
- 断言 `scrollWidth === clientWidth`、页面标题、主要 landmark 和关键操作存在。
|
||||||
|
- 将真实 backend 不可用场景纳入 preview-mode regression。
|
||||||
|
|
||||||
|
### Q2-02 前端拆包与性能优化
|
||||||
|
|
||||||
|
**现状**:Web JS gzip 约 211.6 kB,Vite 报告单 chunk 超过 500 kB。
|
||||||
|
**任务**:
|
||||||
|
|
||||||
|
- 评估按页面动态导入 Generate、Profiles、Materials、Settings、Workflow。
|
||||||
|
- 保证 plugin-page bridge 首屏和 `App.vue` 的 URL 参数恢复不受影响。
|
||||||
|
- 避免新增 UI 运行时依赖;对大图片列表保持懒加载和稳定的媒体 URL。
|
||||||
|
- 对生成预览、Workflow 候选图和 Materials grid 做渲染数量边界检查。
|
||||||
|
|
||||||
|
**验收**:构建 chunk 警告下降或有明确的保留理由;交互没有新增延迟。
|
||||||
|
|
||||||
|
### Q2-03 样式边界整理
|
||||||
|
|
||||||
|
- 将 `App.vue` 中新增的全局 override 按壳层、页面、组件拆到可定位样式文件。
|
||||||
|
- 避免继续增长 22k 行级别的单体 `App.vue`。
|
||||||
|
- 保留 `tokens.css` 作为唯一视觉 token 来源,减少页面内直接写颜色/圆角/阴影。
|
||||||
|
- 清理重复的局部样式和已被全局层覆盖的旧规则。
|
||||||
|
|
||||||
|
### Q2-04 主题和对比度验证
|
||||||
|
|
||||||
|
- 验证 dark/light 下正文、placeholder、disabled、warning、danger、success 的对比度。
|
||||||
|
- 复核用户自定义 primary/accent 颜色的极端值,避免 focus 和文字失去对比度。
|
||||||
|
- 记录至少一组自动化 contrast 检查结果。
|
||||||
|
|
||||||
|
## P3:可选增强
|
||||||
|
|
||||||
|
### Q3-01 设计文档和组件清单
|
||||||
|
|
||||||
|
- 为 token、button、input、surface、status、dialog、empty state 建立简短使用约定。
|
||||||
|
- 在 `docs/` 维护页面状态矩阵和可复用组件清单。
|
||||||
|
|
||||||
|
### Q3-02 真实数据密度优化
|
||||||
|
|
||||||
|
- 用真实 profiles、materials、images、jobs、logs 数据压测长标题、长 prompt、长错误消息。
|
||||||
|
- 检查分页/滚动/虚拟化需求,避免只在空数据预览态下看起来稳定。
|
||||||
|
|
||||||
|
### Q3-03 发布前人工验收
|
||||||
|
|
||||||
|
- 在 AstrBot plugin page 中完成一次完整生成、图库复用、角色选择、素材导入、设置保存、日志查看流程。
|
||||||
|
- 记录阻塞项、截图和最终版本信息。
|
||||||
|
|
||||||
|
## 推荐执行顺序
|
||||||
|
|
||||||
|
1. `Q0-01` 真实后端联调。
|
||||||
|
2. `Q1-01` 逐页深度视觉精修。
|
||||||
|
3. `Q1-02` 可访问性审计与修复。
|
||||||
|
4. `Q1-03` 四种桌面尺寸验收。
|
||||||
|
5. `Q1-04` 状态矩阵补齐。
|
||||||
|
6. `Q2-01` 回归测试。
|
||||||
|
7. `Q2-02` 拆包优化。
|
||||||
|
8. `Q2-03` 样式边界整理。
|
||||||
|
9. `Q2-04` 主题对比度验证。
|
||||||
|
10. `Q0-02` 最终 diff review、commit 和 PR。
|
||||||
|
11. `Q3-03` 真实插件页发布前验收。
|
||||||
|
|
||||||
|
## 暂不列入本队列
|
||||||
|
|
||||||
|
- 后端 API 新功能。
|
||||||
|
- 多租户权限链、持久 Worker、数据库迁移等后端架构事项。
|
||||||
|
- 更换 Vue/Vite/TypeScript 或引入新的 UI 框架。
|
||||||
|
|
||||||
|
|
||||||
|
## Execution update (2026-07-21)
|
||||||
|
|
||||||
|
- Q0-01: source-level bridge/error/preview paths validated; live AstrBot host acceptance remains pending.
|
||||||
|
- Q1-01: shared visual layer, page-level surface hierarchy, action states, and overview narrow-desktop override completed; all nine views smoke-tested.
|
||||||
|
- Q1-02: stable search/workbench/status labels added; image preview dialog now traps focus and restores focus; existing confirmation dialog trap retained.
|
||||||
|
- Q1-03: 1024x768, 1280x800, 1440x900, and 1600x900 passed across all nine views with no horizontal overflow.
|
||||||
|
- Q1-04: state matrix recorded in docs/ui-redesign-state-matrix-2026-07-21.md.
|
||||||
|
- Q2-01: added frontend/tests/ui-redesign-smoke.test.mjs and frontend/tests/ui-theme-contract.test.mjs; 7 UI contract tests pass.
|
||||||
|
- Q2-02: page and workflow components use defineAsyncComponent; production chunks are split and the largest JS chunk is below the prior warning threshold.
|
||||||
|
- Q2-03: new workbench overrides moved from App.vue into frontend/standalone-web/src/styles/workbench.css.
|
||||||
|
- Q2-04: dark/light token contrast checks added; measured text pair ratios are 16.40, 7.52, 15.14, and 4.59.
|
||||||
|
- Q0-02: diff review, build-artifact cleanup, full validation, commit, and PR are the remaining delivery actions.
|
||||||
|
|
@ -0,0 +1,54 @@
|
||||||
|
# ImageStudio 全页面 UI 统一性检查
|
||||||
|
|
||||||
|
日期:2026-07-21
|
||||||
|
分支:`codex/ui-redesign-gallery`
|
||||||
|
|
||||||
|
## 覆盖范围
|
||||||
|
|
||||||
|
- 工作台壳层、导航 rail、topbar、主题和全局状态。
|
||||||
|
- Overview、Generate、Queue、Performance、Gallery、Profiles、Materials、Settings、Logs。
|
||||||
|
- Workflow 子组件、Profiles 子面板、Settings 子面板、Dialogs/Drawers。
|
||||||
|
- 独立 Web 与 AstrBot plugin-page 两个 Vite 入口。
|
||||||
|
|
||||||
|
## 统一规则
|
||||||
|
|
||||||
|
- 视觉 token:`frontend/standalone-web/src/styles/tokens.css`。
|
||||||
|
- 统一 surface:`var(--panel)` / `var(--panel-muted)`,默认取消装饰性宽阴影。
|
||||||
|
- 统一形状:小控件 6–8px,页面 surface 10px,状态 pill 使用 999px。
|
||||||
|
- 统一间距:4/8/12/16/20/24px。
|
||||||
|
- 统一 focus:主色 3px focus ring,表单和按钮保留键盘可见焦点。
|
||||||
|
- 统一状态:good/warn/bad/idle 使用语义边框和背景,不再依赖顶部/侧边粗色条。
|
||||||
|
- 统一动效:保留必要状态反馈;移除布局属性过渡,支持 `prefers-reduced-motion`。
|
||||||
|
- 统一响应式:修复 1265px 桌面窗口下 Overview/Gallery 横向溢出,9 个主要 view 均通过 smoke test。
|
||||||
|
|
||||||
|
## 结果
|
||||||
|
|
||||||
|
- Impeccable detector:0 条命中。
|
||||||
|
- 浏览器 smoke test:`overview`、`generate`、`queue`、`performance`、`images`、`profiles`、`materials`、`settings`、`logs` 均成功加载。
|
||||||
|
- 桌面窗口检查:`scrollWidth === clientWidth`,未发现横向溢出。
|
||||||
|
- plugin-page bridge 入口与独立 Web 入口均可构建。
|
||||||
|
|
||||||
|
## 验证命令
|
||||||
|
|
||||||
|
- `npm.cmd run typecheck`
|
||||||
|
- `npm.cmd run test:contracts`:19/19 通过
|
||||||
|
- `npm.cmd run build:web`
|
||||||
|
- `npm.cmd run build:plugin`
|
||||||
|
- `node C:\Users\Administrator\.agents\skills\impeccable\scripts\detect.mjs --json frontend/standalone-web/src/App.vue frontend/standalone-web/src/components frontend/standalone-web/src/features`
|
||||||
|
|
||||||
|
## 已知遗留
|
||||||
|
|
||||||
|
- Web JS gzip 仍约 211.6 kB,构建保留 Vite 的大 chunk 警告;这是后续代码拆分/动态导入工作,不在本轮视觉重构中处理。
|
||||||
|
- 未连接真实 AstrBot 后端,因此 smoke test 验证的是前端预览态、路由切换和布局,不替代真实 API/插件页数据联调。
|
||||||
|
|
||||||
|
|
||||||
|
## Final execution evidence
|
||||||
|
|
||||||
|
- Browser smoke: 36 checks across 9 views and 4 desktop sizes; all passed with scrollWidth equal to clientWidth.
|
||||||
|
- Frontend UI tests: 7/7 passed.
|
||||||
|
- Contract tests: 25/25 passed.
|
||||||
|
- Typecheck: passed.
|
||||||
|
- Plugin build: passed.
|
||||||
|
- Standalone build: passed.
|
||||||
|
- Generated web/pages artifacts were removed from the working tree after validation.
|
||||||
|
- Live AstrBot plugin-page acceptance is explicitly pending and documented in docs/ui-redesign-integration-validation-2026-07-21.md.
|
||||||
|
|
@ -0,0 +1,31 @@
|
||||||
|
# UI Integration Validation
|
||||||
|
|
||||||
|
Date: 2026-07-21
|
||||||
|
Branch: codex/ui-redesign-gallery
|
||||||
|
|
||||||
|
## Local checks
|
||||||
|
|
||||||
|
- Plugin bridge source keeps ready/context handshake, GET/POST request routing, timeout handling, JSON-safe payload cloning, and error unwrapping.
|
||||||
|
- Direct API base remains /api/v1/plugins/extensions/astrbot_plugin_imagestudio.
|
||||||
|
- Plugin-page production build passed.
|
||||||
|
- Standalone-web production build passed.
|
||||||
|
- No local AstrBot host was available on the checked ports; no real bootstrap or signed-media response was claimed.
|
||||||
|
|
||||||
|
## Checked failure paths
|
||||||
|
|
||||||
|
- Direct transport reports network_unreachable when the API is unavailable.
|
||||||
|
- HTML/non-JSON responses are converted to invalid_api_response with a bounded preview.
|
||||||
|
- 401/HTTP failures remain ApiClientError values and are surfaced through the backend connection banner.
|
||||||
|
- Preview mode is explicit and write actions are blocked until a connected backend with write permission is present.
|
||||||
|
- Media URLs use the plugin bridge signing path instead of unauthenticated direct img requests.
|
||||||
|
|
||||||
|
## Required host acceptance
|
||||||
|
|
||||||
|
Run the following in an AstrBot plugin page with a real session:
|
||||||
|
|
||||||
|
1. Load ui/bootstrap, dashboard, profiles, images, jobs, settings, logs.
|
||||||
|
2. Verify signed image preview, refresh, batch selection, retry/cancel, settings save, and log filtering.
|
||||||
|
3. Verify 401, timeout, empty data, partial data, and backend restart recovery.
|
||||||
|
4. Record AstrBot version, ImageStudio plugin version, and screenshots.
|
||||||
|
|
||||||
|
Status: source-level integration is ready; live host acceptance is pending because no AstrBot plugin host is running in this workspace.
|
||||||
|
|
@ -0,0 +1,77 @@
|
||||||
|
# ImageStudio 桌面端 UI 重构方案
|
||||||
|
|
||||||
|
日期:2026-07-21
|
||||||
|
分支:`codex/ui-redesign-gallery`
|
||||||
|
原则:保留业务逻辑、路由查询参数、API 与数据结构;先改一个页面,再扩展共享视觉层。
|
||||||
|
|
||||||
|
## 设计方向
|
||||||
|
|
||||||
|
ImageStudio 是桌面端创作工具,不采用营销网站的 hero、宣传卡片或装饰性动效。视觉方向为“安静的工作台”:冷中性背景、单一主色作为动作/选中/状态强调,内容区保持高对比和稳定密度;圆角、阴影、渐变只服务层级,不作为装饰。
|
||||||
|
|
||||||
|
## P0:先保证安全边界
|
||||||
|
|
||||||
|
本项目当前没有已确认的 P0 UI 阻塞项。P0 阶段只包含保护措施:
|
||||||
|
|
||||||
|
- 保留现有 URL 参数:`view`、`module`、`materialView`、`profile`。
|
||||||
|
- 保留 plugin-page bridge、API endpoint、shared types 和现有事件 emit。
|
||||||
|
- 每批修改前后运行 `npm.cmd run typecheck`、`npm.cmd run build:web`,并运行 `npm.cmd run test:contracts`。
|
||||||
|
- 不删除当前工作树已有的 `GalleryPage.vue` 未提交修改;本分支在其基础上继续。
|
||||||
|
|
||||||
|
## P1:首批桌面端可用性重构
|
||||||
|
|
||||||
|
### P1-01 只重构 Gallery 页面
|
||||||
|
|
||||||
|
目标文件:
|
||||||
|
|
||||||
|
- `frontend/standalone-web/src/features/gallery/GalleryPage.vue`
|
||||||
|
- 必要时复用而不改逻辑:`frontend/standalone-web/src/components/ImagePreviewDialog.vue`、`frontend/standalone-web/src/components/EmptyState.vue`、`frontend/standalone-web/src/components/StateCard.vue`
|
||||||
|
- 契约测试:`frontend/tests/production-data-boundary.test.mjs` 与图库相关测试
|
||||||
|
|
||||||
|
实施内容:
|
||||||
|
|
||||||
|
- 保持 props、emits、筛选值、批量 action、endpoint 调用和预览行为不变。
|
||||||
|
- 重排为稳定的桌面工作区:页面标题/主操作 → 搜索筛选 → 结果区 + inspector;减少重复 surface。
|
||||||
|
- 统一按钮、输入框、筛选 tabs、选中态、禁用态、loading、error、empty 状态。
|
||||||
|
- 让 grid/list 在 1024px–1440px 桌面宽度下优先保持主要内容可读,inspector 只在有选择时占据空间。
|
||||||
|
- 为搜索、批量选择、卡片操作和图片预览补齐可见 focus、名称、Escape/关闭路径检查。
|
||||||
|
- 不新增依赖,不引入营销式动画;保留现有 reduced-motion 规则并覆盖新过渡。
|
||||||
|
|
||||||
|
### P1-02 抽取最小共享视觉 token
|
||||||
|
|
||||||
|
候选文件:
|
||||||
|
|
||||||
|
- 新增 `frontend/standalone-web/src/styles/tokens.css` 或现有入口可接受的等价 token 文件。
|
||||||
|
- 调整 `frontend/standalone-web/src/App.vue` 的全局工作台变量接入 token。
|
||||||
|
|
||||||
|
范围:颜色角色、spacing、radius、border、shadow、focus ring、motion duration、z-index;只抽取已经在现有 UI 中出现的语义,不改变默认主题含义。
|
||||||
|
|
||||||
|
## P2:扩展一致性
|
||||||
|
|
||||||
|
- `frontend/standalone-web/src/components/AppNavigationRail.vue`:统一 active/hover/focus/compact rail,不改变导航 key 或 pin 行为。
|
||||||
|
- `frontend/standalone-web/src/features/profiles/ProfilesPage.vue`、`ProfileMasterPane.vue`、`ProfileDetailPane.vue`、`ProfileWardrobePane.vue`:应用同一 surface、表单和状态矩阵。
|
||||||
|
- `frontend/standalone-web/src/features/materials/AdvancedMaterialImportPage.vue`:统一导入步骤、loading/error/empty 和内容密度。
|
||||||
|
- `frontend/standalone-web/src/features/settings/SettingsPage.vue` 与 settings panels:统一 section、保存/校验/回滚状态。
|
||||||
|
- `frontend/standalone-web/src/features/workflow/*.vue`:只做视觉层和焦点/状态修复,不改变 workflow route、round、branch、review API。
|
||||||
|
- `frontend/standalone-web/src/features/logs/LogsPage.vue` 与 queue/performance 区块:统一状态色、表格/列表密度和窄桌面布局。
|
||||||
|
|
||||||
|
## P2:技术收口
|
||||||
|
|
||||||
|
- 将 `App.vue` 的局部视觉规则迁移到可定位的页面/组件样式,降低后续回归风险;不在第一批做大规模逻辑拆分。
|
||||||
|
- 评估路由页面的动态导入,但只有在不影响 plugin-page bridge 和首屏加载契约时才实施。
|
||||||
|
- 将布局属性过渡替换为 transform/opacity 或明确的 grid track 过渡。
|
||||||
|
- 统一图片 loading/失败/alt 规则,并复核对话框 focus return。
|
||||||
|
|
||||||
|
## 交付顺序与验证门
|
||||||
|
|
||||||
|
1. Gallery 页面视觉与交互状态;通过 typecheck、build:web、contract tests。
|
||||||
|
2. Gallery 桌面窗口验证:1280×800、1440×900、1024×768;检查横向溢出、sticky 区域、键盘焦点和空/错/加载状态。
|
||||||
|
3. 共享 tokens 接入;再次跑同一验证门,并确认 plugin build 不受影响。
|
||||||
|
4. 导航、profiles、materials、settings、workflow、logs/queue 分批推进,每批单独验证。
|
||||||
|
5. 最后一轮执行 Impeccable `polish`:桌面窗口、溢出、状态、可访问性与设计一致性。
|
||||||
|
|
||||||
|
## 明确不做
|
||||||
|
|
||||||
|
- 不重写后端、不改 API endpoint、不迁移数据结构。
|
||||||
|
- 不更换 Vue/Vite/TypeScript 技术栈。
|
||||||
|
- 不引入新的 UI 框架或图标依赖。
|
||||||
|
- 不添加不必要的全屏动画、营销式 hero、装饰性玻璃卡片或渐变文字。
|
||||||
|
|
@ -0,0 +1,30 @@
|
||||||
|
# UI State Matrix
|
||||||
|
|
||||||
|
Date: 2026-07-21
|
||||||
|
Branch: codex/ui-redesign-gallery
|
||||||
|
|
||||||
|
## Coverage
|
||||||
|
|
||||||
|
| Area | default | hover | focus | selected | disabled | loading | empty | error | success | disconnected |
|
||||||
|
|---|---|---|---|---|---|---|---|---|---|---|
|
||||||
|
| Navigation rail | yes | yes | yes | aria-current=page | n/a | n/a | n/a | n/a | n/a | yes |
|
||||||
|
| Generate composer | yes | yes | yes | mode button | yes | submit text | preview empty | inline error | result card | write blocked |
|
||||||
|
| Queue | yes | yes | yes | filter/task | action disabled | refresh text | empty state | task error | completed status | read-only |
|
||||||
|
| Gallery | yes | yes | yes | card/batch | batch disabled | media loading | empty state | media fallback | selection feedback | read-only |
|
||||||
|
| Profiles | yes | yes | yes | profile/tab | sealed/read-only | pane loading | empty pane | inline error | saved state | read-only |
|
||||||
|
| Materials | yes | yes | yes | filter/category | permission disabled | operation busy | empty state | action error | operation message | read-only |
|
||||||
|
| Settings | yes | yes | yes | section/tab | permission disabled | save/reload | missing schema | validation error | saved message | read-only |
|
||||||
|
| Logs | yes | yes | yes | filter | refresh disabled | load text | empty state | error state | refreshed state | unavailable |
|
||||||
|
| Workflow | yes | yes | yes | node/candidate | sealed/locked | task progress | candidate empty | node error | adopted state | read-only |
|
||||||
|
|
||||||
|
## Keyboard paths
|
||||||
|
|
||||||
|
- Global search: focus, ArrowUp/ArrowDown, Enter, Escape.
|
||||||
|
- Navigation and tabs: Tab, Enter, Space, aria-current/aria-pressed.
|
||||||
|
- Confirm dialog: Escape, Tab loop, focus return.
|
||||||
|
- Image preview dialog: Escape, Tab loop, focus return, zoom controls.
|
||||||
|
- Backend banner: retry is keyboard reachable and status is aria-live.
|
||||||
|
|
||||||
|
## Notes
|
||||||
|
|
||||||
|
The matrix is backed by shared states in App.vue and feature components. Real backend disconnected states are represented by the existing preview/error/blocked paths; live plugin-host acceptance remains a deployment-bound check.
|
||||||
4
frontend/package-lock.json
自动生成
4
frontend/package-lock.json
自动生成
|
|
@ -1,12 +1,12 @@
|
||||||
{
|
{
|
||||||
"name": "astrbot-plugin-imagestudio-frontend",
|
"name": "astrbot-plugin-imagestudio-frontend",
|
||||||
"version": "1.0.65",
|
"version": "1.0.66",
|
||||||
"lockfileVersion": 3,
|
"lockfileVersion": 3,
|
||||||
"requires": true,
|
"requires": true,
|
||||||
"packages": {
|
"packages": {
|
||||||
"": {
|
"": {
|
||||||
"name": "astrbot-plugin-imagestudio-frontend",
|
"name": "astrbot-plugin-imagestudio-frontend",
|
||||||
"version": "1.0.65",
|
"version": "1.0.66",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@vitejs/plugin-vue": "^5.2.0",
|
"@vitejs/plugin-vue": "^5.2.0",
|
||||||
"pinia": "^2.3.0",
|
"pinia": "^2.3.0",
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
"name": "astrbot-plugin-imagestudio-frontend",
|
"name": "astrbot-plugin-imagestudio-frontend",
|
||||||
"version": "1.0.65",
|
"version": "1.0.66",
|
||||||
"private": true,
|
"private": true,
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
|
|
@ -10,7 +10,8 @@
|
||||||
"build:web": "vite build --config standalone-web/vite.config.ts",
|
"build:web": "vite build --config standalone-web/vite.config.ts",
|
||||||
"build": "npm run build:plugin && npm run build:web",
|
"build": "npm run build:plugin && npm run build:web",
|
||||||
"typecheck": "vue-tsc --noEmit",
|
"typecheck": "vue-tsc --noEmit",
|
||||||
"test:contracts": "node --test tests/*.test.mjs"
|
"test:contracts": "node --test tests/*.test.mjs",
|
||||||
|
"test:ui": "node --test tests/ui-redesign-smoke.test.mjs tests/ui-theme-contract.test.mjs"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@vitejs/plugin-vue": "^5.2.0",
|
"@vitejs/plugin-vue": "^5.2.0",
|
||||||
|
|
@ -23,4 +24,3 @@
|
||||||
},
|
},
|
||||||
"devDependencies": {}
|
"devDependencies": {}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -147,6 +147,7 @@ export interface AdvancedStyleValidationCase {
|
||||||
input_image_count?: number
|
input_image_count?: number
|
||||||
style_scores: Record<string, unknown>
|
style_scores: Record<string, unknown>
|
||||||
style_review?: Record<string, unknown>
|
style_review?: Record<string, unknown>
|
||||||
|
rendering_layers?: Record<string, number>
|
||||||
content_novelty: Record<string, unknown>
|
content_novelty: Record<string, unknown>
|
||||||
usage?: Record<string, unknown>
|
usage?: Record<string, unknown>
|
||||||
fidelity_score?: number | null
|
fidelity_score?: number | null
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,7 @@
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { computed, nextTick, onBeforeUnmount, onMounted, ref, watch } from "vue"
|
import { computed, defineAsyncComponent, nextTick, onBeforeUnmount, onMounted, ref, watch } from "vue"
|
||||||
|
import "./styles/tokens.css"
|
||||||
|
import "./styles/workbench.css"
|
||||||
import AppNavigationRail from "./components/AppNavigationRail.vue"
|
import AppNavigationRail from "./components/AppNavigationRail.vue"
|
||||||
import ConfirmDialog from "./components/ConfirmDialog.vue"
|
import ConfirmDialog from "./components/ConfirmDialog.vue"
|
||||||
import EmptyState from "./components/EmptyState.vue"
|
import EmptyState from "./components/EmptyState.vue"
|
||||||
|
|
@ -10,22 +12,22 @@ import MaterialOperationDialog from "./components/MaterialOperationDialog.vue"
|
||||||
import { MATERIAL_BODY_SLOT_OPTIONS } from "./material-labels"
|
import { MATERIAL_BODY_SLOT_OPTIONS } from "./material-labels"
|
||||||
import MetricCardGrid from "./components/MetricCardGrid.vue"
|
import MetricCardGrid from "./components/MetricCardGrid.vue"
|
||||||
import StateCard from "./components/StateCard.vue"
|
import StateCard from "./components/StateCard.vue"
|
||||||
import AdvancedMaterialImportPage from "./features/materials/AdvancedMaterialImportPage.vue"
|
const AdvancedMaterialImportPage = defineAsyncComponent(() => import("./features/materials/AdvancedMaterialImportPage.vue"))
|
||||||
import {
|
import {
|
||||||
parseMaterialLibraryView,
|
parseMaterialLibraryView,
|
||||||
type MaterialLibraryView,
|
type MaterialLibraryView,
|
||||||
} from "./features/materials/advanced-material-state"
|
} from "./features/materials/advanced-material-state"
|
||||||
import GalleryPage from "./features/gallery/GalleryPage.vue"
|
const GalleryPage = defineAsyncComponent(() => import("./features/gallery/GalleryPage.vue"))
|
||||||
import type { GalleryImage } from "./features/gallery/types"
|
import type { GalleryImage } from "./features/gallery/types"
|
||||||
import LogsPage from "./features/logs/LogsPage.vue"
|
const LogsPage = defineAsyncComponent(() => import("./features/logs/LogsPage.vue"))
|
||||||
import { navItems, visibleNavItems } from "./features/navigation/navigation-config"
|
import { navItems, visibleNavItems } from "./features/navigation/navigation-config"
|
||||||
import {
|
import {
|
||||||
profileGenerationKind,
|
profileGenerationKind,
|
||||||
type ProfileGenerationKind,
|
type ProfileGenerationKind,
|
||||||
} from "./features/profiles/profile-ui"
|
} from "./features/profiles/profile-ui"
|
||||||
import ProfilesPage from "./features/profiles/ProfilesPage.vue"
|
const ProfilesPage = defineAsyncComponent(() => import("./features/profiles/ProfilesPage.vue"))
|
||||||
import type { ProfileImageTarget } from "./features/profiles/types"
|
import type { ProfileImageTarget } from "./features/profiles/types"
|
||||||
import SettingsPage from "./features/settings/SettingsPage.vue"
|
const SettingsPage = defineAsyncComponent(() => import("./features/settings/SettingsPage.vue"))
|
||||||
import {
|
import {
|
||||||
cleanImportedProfileValue,
|
cleanImportedProfileValue,
|
||||||
createDefaultQuickProfileQuestionnaire,
|
createDefaultQuickProfileQuestionnaire,
|
||||||
|
|
@ -34,14 +36,14 @@ import {
|
||||||
type ExternalProfileImportDraft,
|
type ExternalProfileImportDraft,
|
||||||
type QuickProfileQuestionnaire,
|
type QuickProfileQuestionnaire,
|
||||||
} from "./features/quick-profile/profile-import"
|
} from "./features/quick-profile/profile-import"
|
||||||
import WorkflowCompareDialog from "./features/workflow/WorkflowCompareDialog.vue"
|
const WorkflowCompareDialog = defineAsyncComponent(() => import("./features/workflow/WorkflowCompareDialog.vue"))
|
||||||
import WorkflowBranchPanel from "./features/workflow/WorkflowBranchPanel.vue"
|
const WorkflowBranchPanel = defineAsyncComponent(() => import("./features/workflow/WorkflowBranchPanel.vue"))
|
||||||
import WorkflowCandidatePool from "./features/workflow/WorkflowCandidatePool.vue"
|
const WorkflowCandidatePool = defineAsyncComponent(() => import("./features/workflow/WorkflowCandidatePool.vue"))
|
||||||
import WorkflowComposer from "./features/workflow/WorkflowComposer.vue"
|
const WorkflowComposer = defineAsyncComponent(() => import("./features/workflow/WorkflowComposer.vue"))
|
||||||
import WorkflowDependencyContextCard from "./features/workflow/WorkflowDependencyContextCard.vue"
|
const WorkflowDependencyContextCard = defineAsyncComponent(() => import("./features/workflow/WorkflowDependencyContextCard.vue"))
|
||||||
import WorkflowGenerationReviewDialog from "./features/workflow/WorkflowGenerationReviewDialog.vue"
|
const WorkflowGenerationReviewDialog = defineAsyncComponent(() => import("./features/workflow/WorkflowGenerationReviewDialog.vue"))
|
||||||
import WorkflowMaterialDrawer from "./features/workflow/WorkflowMaterialDrawer.vue"
|
const WorkflowMaterialDrawer = defineAsyncComponent(() => import("./features/workflow/WorkflowMaterialDrawer.vue"))
|
||||||
import WorkflowRoundPanel from "./features/workflow/WorkflowRoundPanel.vue"
|
const WorkflowRoundPanel = defineAsyncComponent(() => import("./features/workflow/WorkflowRoundPanel.vue"))
|
||||||
import {
|
import {
|
||||||
CHARACTER_WORKFLOW_PREVIEW_NODE_SPECS,
|
CHARACTER_WORKFLOW_PREVIEW_NODE_SPECS,
|
||||||
canonicalCharacterWorkflowNodeKey,
|
canonicalCharacterWorkflowNodeKey,
|
||||||
|
|
@ -10861,7 +10863,7 @@ function displayMediaUrl(rawUrl?: string | null): string {
|
||||||
}
|
}
|
||||||
|
|
||||||
// AstrBot's sandbox bridge carries the dashboard login state. A direct
|
// AstrBot's sandbox bridge carries the dashboard login state. A direct
|
||||||
// <img> request cannot add that credential and is rejected with HTTP 401,
|
// Direct image requests cannot add the bridge credential and are rejected.
|
||||||
// so avoid rendering the known-broken URL while its Blob is being loaded.
|
// so avoid rendering the known-broken URL while its Blob is being loaded.
|
||||||
return getApiTransport() === "plugin-bridge" ? "" : value
|
return getApiTransport() === "plugin-bridge" ? "" : value
|
||||||
}
|
}
|
||||||
|
|
@ -11031,6 +11033,7 @@ function errorMessage(err: unknown) {
|
||||||
<template>
|
<template>
|
||||||
<main
|
<main
|
||||||
class="navigation-shell"
|
class="navigation-shell"
|
||||||
|
aria-label="ImageStudio workbench"
|
||||||
:class="{ 'rail-collapsed': !navigationRailExpanded }"
|
:class="{ 'rail-collapsed': !navigationRailExpanded }"
|
||||||
:data-theme="themeMode"
|
:data-theme="themeMode"
|
||||||
:style="shellStyle"
|
:style="shellStyle"
|
||||||
|
|
@ -11047,7 +11050,7 @@ function errorMessage(err: unknown) {
|
||||||
@togglePinned="toggleNavigationRailPinned"
|
@togglePinned="toggleNavigationRailPinned"
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<section class="workbench">
|
<section class="workbench" aria-label="ImageStudio workspace">
|
||||||
<header class="topbar">
|
<header class="topbar">
|
||||||
<div class="active-heading">
|
<div class="active-heading">
|
||||||
<span>{{ activeItem.label }}</span>
|
<span>{{ activeItem.label }}</span>
|
||||||
|
|
@ -11058,6 +11061,7 @@ function errorMessage(err: unknown) {
|
||||||
<span aria-hidden="true">⌕</span>
|
<span aria-hidden="true">⌕</span>
|
||||||
<input
|
<input
|
||||||
ref="searchInputRef"
|
ref="searchInputRef"
|
||||||
|
aria-label="Search ImageStudio"
|
||||||
v-model="searchQuery"
|
v-model="searchQuery"
|
||||||
type="search"
|
type="search"
|
||||||
role="combobox"
|
role="combobox"
|
||||||
|
|
@ -11208,6 +11212,7 @@ function errorMessage(err: unknown) {
|
||||||
v-if="showBackendConnectionBanner"
|
v-if="showBackendConnectionBanner"
|
||||||
:class="['backend-connection-banner', backendConnectionClass]"
|
:class="['backend-connection-banner', backendConnectionClass]"
|
||||||
role="status"
|
role="status"
|
||||||
|
aria-live="polite"
|
||||||
>
|
>
|
||||||
<div>
|
<div>
|
||||||
<strong>{{ backendConnection.title }}</strong>
|
<strong>{{ backendConnection.title }}</strong>
|
||||||
|
|
@ -11441,7 +11446,8 @@ function errorMessage(err: unknown) {
|
||||||
</option>
|
</option>
|
||||||
</select>
|
</select>
|
||||||
</label>
|
</label>
|
||||||
<span v-if="imageGenerationSubmitting" class="model-state" role="status">生成中</span>
|
<span v-if="imageGenerationSubmitting" class="model-state" role="status"
|
||||||
|
aria-live="polite">生成中</span>
|
||||||
<span v-else-if="imageGenerationError" class="model-state model-state-error" role="alert">
|
<span v-else-if="imageGenerationError" class="model-state model-state-error" role="alert">
|
||||||
{{ imageGenerationError }}
|
{{ imageGenerationError }}
|
||||||
</span>
|
</span>
|
||||||
|
|
@ -11831,7 +11837,8 @@ function errorMessage(err: unknown) {
|
||||||
<span v-else class="feature-action">{{ quickProfileActionButtonLabel(card) }}</span>
|
<span v-else class="feature-action">{{ quickProfileActionButtonLabel(card) }}</span>
|
||||||
</article>
|
</article>
|
||||||
</div>
|
</div>
|
||||||
<p v-if="quickCharacterGenerationNotice" class="generation-notice" role="status">
|
<p v-if="quickCharacterGenerationNotice" class="generation-notice" role="status"
|
||||||
|
aria-live="polite">
|
||||||
{{ quickCharacterGenerationNotice }}
|
{{ quickCharacterGenerationNotice }}
|
||||||
</p>
|
</p>
|
||||||
<p v-if="quickCharacterGenerationError" class="generation-error" role="alert">
|
<p v-if="quickCharacterGenerationError" class="generation-error" role="alert">
|
||||||
|
|
@ -17537,7 +17544,7 @@ body {
|
||||||
height: 100%;
|
height: 100%;
|
||||||
border-radius: inherit;
|
border-radius: inherit;
|
||||||
background: linear-gradient(90deg, var(--primary), var(--accent));
|
background: linear-gradient(90deg, var(--primary), var(--accent));
|
||||||
transition: width 220ms ease;
|
transition: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
.workflow-node-card.done .workflow-node-progress i {
|
.workflow-node-card.done .workflow-node-progress i {
|
||||||
|
|
@ -18416,8 +18423,8 @@ body {
|
||||||
}
|
}
|
||||||
|
|
||||||
.workflow-draft-grid > article.final {
|
.workflow-draft-grid > article.final {
|
||||||
border-color: var(--accent);
|
border-color: color-mix(in srgb, var(--accent) 58%, var(--border));
|
||||||
box-shadow: inset 0 3px 0 var(--accent);
|
background: color-mix(in srgb, var(--accent) 10%, var(--panel-muted));
|
||||||
}
|
}
|
||||||
|
|
||||||
.workflow-draft-select {
|
.workflow-draft-select {
|
||||||
|
|
@ -18635,15 +18642,15 @@ body {
|
||||||
}
|
}
|
||||||
|
|
||||||
.workflow-action-card.accent {
|
.workflow-action-card.accent {
|
||||||
border-top-color: var(--accent);
|
border-color: color-mix(in srgb, var(--accent) 52%, var(--border));
|
||||||
}
|
}
|
||||||
|
|
||||||
.workflow-action-card.warn {
|
.workflow-action-card.warn {
|
||||||
border-top-color: var(--warn);
|
border-color: color-mix(in srgb, var(--warn) 52%, var(--border));
|
||||||
}
|
}
|
||||||
|
|
||||||
.workflow-action-card.neutral {
|
.workflow-action-card.neutral {
|
||||||
border-top-color: var(--neutral);
|
border-color: color-mix(in srgb, var(--neutral) 52%, var(--border));
|
||||||
}
|
}
|
||||||
|
|
||||||
.workflow-action-card.disabled {
|
.workflow-action-card.disabled {
|
||||||
|
|
@ -19958,7 +19965,7 @@ body {
|
||||||
overflow-y: auto;
|
overflow-y: auto;
|
||||||
overscroll-behavior: contain;
|
overscroll-behavior: contain;
|
||||||
padding-right: 4px;
|
padding-right: 4px;
|
||||||
transition: max-height 240ms var(--rail-ease);
|
transition: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
.quick-profile-material-picker-list.accessory {
|
.quick-profile-material-picker-list.accessory {
|
||||||
|
|
@ -20126,7 +20133,6 @@ body {
|
||||||
min-height: 134px;
|
min-height: 134px;
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
border: 1px solid var(--border);
|
border: 1px solid var(--border);
|
||||||
border-top: 3px solid var(--primary);
|
|
||||||
border-radius: 8px;
|
border-radius: 8px;
|
||||||
padding: 10px;
|
padding: 10px;
|
||||||
background: var(--panel-muted);
|
background: var(--panel-muted);
|
||||||
|
|
@ -20134,15 +20140,15 @@ body {
|
||||||
}
|
}
|
||||||
|
|
||||||
.quick-profile-command-card.accent {
|
.quick-profile-command-card.accent {
|
||||||
border-top-color: var(--accent);
|
border-color: color-mix(in srgb, var(--accent) 52%, var(--border));
|
||||||
}
|
}
|
||||||
|
|
||||||
.quick-profile-command-card.warn {
|
.quick-profile-command-card.warn {
|
||||||
border-top-color: var(--warn);
|
border-color: color-mix(in srgb, var(--warn) 52%, var(--border));
|
||||||
}
|
}
|
||||||
|
|
||||||
.quick-profile-command-card.neutral {
|
.quick-profile-command-card.neutral {
|
||||||
border-top-color: var(--neutral);
|
border-color: color-mix(in srgb, var(--neutral) 52%, var(--border));
|
||||||
}
|
}
|
||||||
|
|
||||||
.quick-profile-command-card.disabled {
|
.quick-profile-command-card.disabled {
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { computed, onBeforeUnmount, onMounted, ref, watch } from "vue"
|
import { computed, nextTick, onBeforeUnmount, onMounted, ref, watch } from "vue"
|
||||||
|
|
||||||
import { createSafeBackdropClose } from "../safe-backdrop-close"
|
import { createSafeBackdropClose } from "../safe-backdrop-close"
|
||||||
|
|
||||||
|
|
@ -23,6 +23,8 @@ const scale = ref(1)
|
||||||
const offset = ref({ x: 0, y: 0 })
|
const offset = ref({ x: 0, y: 0 })
|
||||||
const dragging = ref(false)
|
const dragging = ref(false)
|
||||||
const dragStart = ref({ pointerId: -1, x: 0, y: 0, offsetX: 0, offsetY: 0 })
|
const dragStart = ref({ pointerId: -1, x: 0, y: 0, offsetX: 0, offsetY: 0 })
|
||||||
|
const dialogRef = ref<HTMLElement | null>(null)
|
||||||
|
let previousFocus: HTMLElement | null = null
|
||||||
|
|
||||||
const scaleLabel = computed(() => `${Math.round(scale.value * 100)}%`)
|
const scaleLabel = computed(() => `${Math.round(scale.value * 100)}%`)
|
||||||
const imageTransform = computed(
|
const imageTransform = computed(
|
||||||
|
|
@ -31,7 +33,16 @@ const imageTransform = computed(
|
||||||
|
|
||||||
watch(
|
watch(
|
||||||
() => [props.open, props.src] as const,
|
() => [props.open, props.src] as const,
|
||||||
() => reset(),
|
([open]) => {
|
||||||
|
reset()
|
||||||
|
if (open) {
|
||||||
|
previousFocus = document.activeElement instanceof HTMLElement ? document.activeElement : null
|
||||||
|
void nextTick(() => focusableElements()[0]?.focus())
|
||||||
|
} else {
|
||||||
|
void nextTick(restoreFocus)
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{ immediate: true },
|
||||||
)
|
)
|
||||||
|
|
||||||
onMounted(() => window.addEventListener("keydown", handleEscape))
|
onMounted(() => window.addEventListener("keydown", handleEscape))
|
||||||
|
|
@ -102,6 +113,39 @@ function endDrag(event: PointerEvent) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function focusableElements() {
|
||||||
|
return Array.from(
|
||||||
|
dialogRef.value?.querySelectorAll<HTMLElement>(
|
||||||
|
'button:not([disabled]), [href], input:not([disabled]), select:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex="-1"])',
|
||||||
|
) ?? [],
|
||||||
|
).filter((element) => !element.hasAttribute("hidden"))
|
||||||
|
}
|
||||||
|
|
||||||
|
function trapFocus(event: KeyboardEvent) {
|
||||||
|
if (event.key !== "Tab") return
|
||||||
|
const elements = focusableElements()
|
||||||
|
if (!elements.length) {
|
||||||
|
event.preventDefault()
|
||||||
|
dialogRef.value?.focus()
|
||||||
|
return
|
||||||
|
}
|
||||||
|
const first = elements[0]
|
||||||
|
const last = elements[elements.length - 1]
|
||||||
|
if (event.shiftKey && document.activeElement === first) {
|
||||||
|
event.preventDefault()
|
||||||
|
last.focus()
|
||||||
|
} else if (!event.shiftKey && document.activeElement === last) {
|
||||||
|
event.preventDefault()
|
||||||
|
first.focus()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function restoreFocus() {
|
||||||
|
const target = previousFocus
|
||||||
|
previousFocus = null
|
||||||
|
if (target?.isConnected) target.focus()
|
||||||
|
}
|
||||||
|
|
||||||
function handleEscape(event: KeyboardEvent) {
|
function handleEscape(event: KeyboardEvent) {
|
||||||
if (props.open && event.key === "Escape") close()
|
if (props.open && event.key === "Escape") close()
|
||||||
}
|
}
|
||||||
|
|
@ -125,7 +169,7 @@ function clamp(value: number, min: number, max: number) {
|
||||||
@pointercancel="backdropClose.pointerCancel"
|
@pointercancel="backdropClose.pointerCancel"
|
||||||
@wheel.prevent="zoomFromWheel"
|
@wheel.prevent="zoomFromWheel"
|
||||||
>
|
>
|
||||||
<section class="image-viewer-card" data-overlay-root="imageViewer">
|
<section ref="dialogRef" class="image-viewer-card" data-overlay-root="imageViewer" tabindex="-1" @keydown="trapFocus">
|
||||||
<header>
|
<header>
|
||||||
<div>
|
<div>
|
||||||
<span>图片预览</span>
|
<span>图片预览</span>
|
||||||
|
|
|
||||||
|
|
@ -173,7 +173,7 @@ async function runBatch(action:"select"|"unselect"|"archive"|"delete"|"permanent
|
||||||
<section class="gallery-toolbar" aria-label="图库筛选">
|
<section class="gallery-toolbar" aria-label="图库筛选">
|
||||||
<label class="gallery-search">
|
<label class="gallery-search">
|
||||||
<span aria-hidden="true">⌕</span>
|
<span aria-hidden="true">⌕</span>
|
||||||
<input v-model="query" type="search" placeholder="搜索标题、提示词、模型或来源" />
|
<input id="gallery-search" v-model="query" type="search" aria-label="Search gallery" placeholder="搜索标题、提示词、模型或来源" />
|
||||||
</label>
|
</label>
|
||||||
<div class="gallery-filter-tabs" role="group" aria-label="图片状态">
|
<div class="gallery-filter-tabs" role="group" aria-label="图片状态">
|
||||||
<button
|
<button
|
||||||
|
|
@ -211,7 +211,7 @@ async function runBatch(action:"select"|"unselect"|"archive"|"delete"|"permanent
|
||||||
</div>
|
</div>
|
||||||
</section>
|
</section>
|
||||||
|
|
||||||
<section class="gallery-batchbar"><label><input type="checkbox" :checked="filteredImages.length>0&&filteredImages.filter(image=>!isSample(image)).every(image=>checkedIds.includes(image.image_id))" @change="toggleAllVisible"><span>已选 {{checkedIds.length}} 张</span></label><div><span v-if="actionMessage">{{actionMessage}}</span><button :disabled="!checkedIds.length||actionBusy||!backendConnected" @click="runBatch('select')">标记选中</button><button :disabled="!checkedIds.length||actionBusy||!backendConnected" @click="runBatch('unselect')">取消选中</button><button :disabled="!checkedIds.length||actionBusy||!backendConnected" @click="runBatch('archive')">归档</button><button class="danger" :disabled="!checkedIds.length||actionBusy||!backendConnected" @click="runBatch('delete')">安全删除</button><button class="danger" :disabled="!checkedIds.length||actionBusy||!backendConnected" @click="runBatch('permanent')">永久删除</button></div></section>
|
<section class="gallery-batchbar" aria-label="Gallery batch actions"><label><input type="checkbox" aria-label="Select all visible images" :checked="filteredImages.length>0&&filteredImages.filter(image=>!isSample(image)).every(image=>checkedIds.includes(image.image_id))" @change="toggleAllVisible"><span>已选 {{checkedIds.length}} 张</span></label><div class="gallery-batch-actions"><span v-if="actionMessage" aria-live="polite">{{actionMessage}}</span><button :disabled="!checkedIds.length||actionBusy||!backendConnected" @click="runBatch('select')">标记选中</button><button :disabled="!checkedIds.length||actionBusy||!backendConnected" @click="runBatch('unselect')">取消选中</button><button :disabled="!checkedIds.length||actionBusy||!backendConnected" @click="runBatch('archive')">归档</button><button class="danger" :disabled="!checkedIds.length||actionBusy||!backendConnected" @click="runBatch('delete')">安全删除</button><button class="danger" :disabled="!checkedIds.length||actionBusy||!backendConnected" @click="runBatch('permanent')">永久删除</button></div></section>
|
||||||
|
|
||||||
<section class="gallery-workspace">
|
<section class="gallery-workspace">
|
||||||
<div class="gallery-results">
|
<div class="gallery-results">
|
||||||
|
|
@ -237,7 +237,7 @@ async function runBatch(action:"select"|"unselect"|"archive"|"delete"|"permanent
|
||||||
:key="image.image_id"
|
:key="image.image_id"
|
||||||
:class="['gallery-card', { active: selectedImage?.image_id === image.image_id, archived: isArchived(image) }]"
|
:class="['gallery-card', { active: selectedImage?.image_id === image.image_id, archived: isArchived(image) }]"
|
||||||
>
|
>
|
||||||
<label v-if="!isSample(image)" class="gallery-card-check"><input type="checkbox" :checked="checkedIds.includes(image.image_id)" @change="toggleChecked(image.image_id)"><span></span></label>
|
<label v-if="!isSample(image)" class="gallery-card-check"><input type="checkbox" :aria-label="`Select ${image.title}`" :checked="checkedIds.includes(image.image_id)" @change="toggleChecked(image.image_id)"><span></span></label>
|
||||||
<button
|
<button
|
||||||
type="button"
|
type="button"
|
||||||
class="gallery-card-media"
|
class="gallery-card-media"
|
||||||
|
|
@ -964,4 +964,280 @@ async function runBatch(action:"select"|"unselect"|"archive"|"delete"|"permanent
|
||||||
min-height: 30px;
|
min-height: 30px;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
.gallery-page {
|
||||||
|
gap: 18px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.gallery-hero,
|
||||||
|
.gallery-toolbar,
|
||||||
|
.gallery-results,
|
||||||
|
.gallery-inspector,
|
||||||
|
.gallery-load-notice,
|
||||||
|
.gallery-metrics article {
|
||||||
|
border-radius: 10px;
|
||||||
|
box-shadow: 0 8px 24px color-mix(in srgb, var(--bg) 18%, transparent);
|
||||||
|
}
|
||||||
|
|
||||||
|
.gallery-hero {
|
||||||
|
align-items: flex-start;
|
||||||
|
padding: 24px;
|
||||||
|
background:
|
||||||
|
linear-gradient(120deg, color-mix(in srgb, var(--primary-soft) 72%, var(--panel)), var(--panel) 62%);
|
||||||
|
}
|
||||||
|
|
||||||
|
.gallery-hero h2 {
|
||||||
|
font-size: clamp(24px, 2.2vw, 30px);
|
||||||
|
letter-spacing: -0.025em;
|
||||||
|
text-wrap: balance;
|
||||||
|
}
|
||||||
|
|
||||||
|
.gallery-hero p {
|
||||||
|
max-width: 62ch;
|
||||||
|
}
|
||||||
|
|
||||||
|
.gallery-toolbar {
|
||||||
|
gap: 14px;
|
||||||
|
padding: 12px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.gallery-search,
|
||||||
|
.gallery-filter-tabs button,
|
||||||
|
.gallery-view-switch button,
|
||||||
|
.gallery-hero-actions button,
|
||||||
|
.gallery-card-actions button,
|
||||||
|
.gallery-inspector-actions button,
|
||||||
|
.gallery-empty button {
|
||||||
|
min-height: 38px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.gallery-search input:focus-visible,
|
||||||
|
.gallery-filter-tabs button:focus-visible,
|
||||||
|
.gallery-view-switch button:focus-visible,
|
||||||
|
.gallery-hero-actions button:focus-visible,
|
||||||
|
.gallery-card-actions button:focus-visible,
|
||||||
|
.gallery-inspector-actions button:focus-visible,
|
||||||
|
.gallery-empty button:focus-visible,
|
||||||
|
.gallery-batchbar button:focus-visible,
|
||||||
|
.gallery-card:focus-visible,
|
||||||
|
.gallery-inspector-media:focus-visible {
|
||||||
|
outline: 3px solid color-mix(in srgb, var(--primary) 55%, transparent);
|
||||||
|
outline-offset: 2px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.gallery-metrics {
|
||||||
|
gap: 14px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.gallery-metrics article {
|
||||||
|
gap: 8px;
|
||||||
|
padding: 16px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.gallery-metrics strong {
|
||||||
|
font-variant-numeric: tabular-nums;
|
||||||
|
}
|
||||||
|
|
||||||
|
.gallery-results {
|
||||||
|
padding: 16px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.gallery-results-header {
|
||||||
|
align-items: flex-start;
|
||||||
|
margin-bottom: 14px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.gallery-results-header h3,
|
||||||
|
.gallery-inspector h3 {
|
||||||
|
font-size: 18px;
|
||||||
|
letter-spacing: -0.015em;
|
||||||
|
}
|
||||||
|
|
||||||
|
.gallery-grid {
|
||||||
|
gap: 14px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.gallery-card {
|
||||||
|
border-radius: 10px;
|
||||||
|
background: var(--panel-muted);
|
||||||
|
transition: border-color 160ms ease, background-color 160ms ease, transform 160ms ease;
|
||||||
|
}
|
||||||
|
|
||||||
|
.gallery-card:hover,
|
||||||
|
.gallery-card:focus-within {
|
||||||
|
border-color: color-mix(in srgb, var(--primary) 44%, var(--border));
|
||||||
|
background: color-mix(in srgb, var(--primary-soft) 22%, var(--panel-muted));
|
||||||
|
transform: translateY(-1px);
|
||||||
|
}
|
||||||
|
|
||||||
|
.gallery-card-media {
|
||||||
|
border-radius: 7px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.gallery-empty {
|
||||||
|
min-height: 300px;
|
||||||
|
border-radius: 10px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.gallery-skeleton-grid span {
|
||||||
|
border-radius: 10px;
|
||||||
|
}
|
||||||
|
|
||||||
|
@media (prefers-reduced-motion: reduce) {
|
||||||
|
.gallery-card,
|
||||||
|
.gallery-skeleton-grid span {
|
||||||
|
animation: none;
|
||||||
|
transition: none;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.gallery-page {
|
||||||
|
gap: 16px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.gallery-hero,
|
||||||
|
.gallery-toolbar,
|
||||||
|
.gallery-results,
|
||||||
|
.gallery-inspector,
|
||||||
|
.gallery-load-notice,
|
||||||
|
.gallery-metrics article,
|
||||||
|
.gallery-batchbar {
|
||||||
|
border-radius: 10px;
|
||||||
|
box-shadow: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
.gallery-hero {
|
||||||
|
align-items: flex-start;
|
||||||
|
padding: 22px 24px;
|
||||||
|
background: var(--panel);
|
||||||
|
}
|
||||||
|
|
||||||
|
.gallery-hero h2 {
|
||||||
|
font-size: clamp(24px, 2.2vw, 30px);
|
||||||
|
letter-spacing: -0.025em;
|
||||||
|
text-wrap: balance;
|
||||||
|
}
|
||||||
|
|
||||||
|
.gallery-hero p {
|
||||||
|
max-width: 62ch;
|
||||||
|
}
|
||||||
|
|
||||||
|
.gallery-toolbar {
|
||||||
|
gap: 12px;
|
||||||
|
padding: 10px 12px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.gallery-search,
|
||||||
|
.gallery-filter-tabs button,
|
||||||
|
.gallery-view-switch button,
|
||||||
|
.gallery-hero-actions button,
|
||||||
|
.gallery-card-actions button,
|
||||||
|
.gallery-inspector-actions button,
|
||||||
|
.gallery-empty button,
|
||||||
|
.gallery-batchbar button {
|
||||||
|
min-height: 38px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.gallery-search input:focus-visible,
|
||||||
|
.gallery-filter-tabs button:focus-visible,
|
||||||
|
.gallery-view-switch button:focus-visible,
|
||||||
|
.gallery-hero-actions button:focus-visible,
|
||||||
|
.gallery-card-actions button:focus-visible,
|
||||||
|
.gallery-inspector-actions button:focus-visible,
|
||||||
|
.gallery-empty button:focus-visible,
|
||||||
|
.gallery-batchbar button:focus-visible,
|
||||||
|
.gallery-card-check input:focus-visible,
|
||||||
|
.gallery-card-media:focus-visible,
|
||||||
|
.gallery-card-copy:focus-visible,
|
||||||
|
.gallery-inspector-media:focus-visible {
|
||||||
|
outline: 2px solid var(--primary);
|
||||||
|
outline-offset: 2px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.gallery-metrics {
|
||||||
|
gap: 12px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.gallery-metrics article {
|
||||||
|
gap: 8px;
|
||||||
|
padding: 14px 16px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.gallery-metrics strong {
|
||||||
|
font-variant-numeric: tabular-nums;
|
||||||
|
}
|
||||||
|
|
||||||
|
.gallery-batchbar {
|
||||||
|
align-items: center;
|
||||||
|
flex-wrap: wrap;
|
||||||
|
}
|
||||||
|
|
||||||
|
.gallery-batch-actions {
|
||||||
|
min-width: 0;
|
||||||
|
flex-wrap: wrap;
|
||||||
|
justify-content: flex-end;
|
||||||
|
}
|
||||||
|
|
||||||
|
.gallery-batch-actions span {
|
||||||
|
white-space: nowrap;
|
||||||
|
}
|
||||||
|
|
||||||
|
.gallery-results {
|
||||||
|
padding: 16px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.gallery-results-header {
|
||||||
|
align-items: flex-start;
|
||||||
|
margin-bottom: 14px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.gallery-results-header h3,
|
||||||
|
.gallery-inspector h3 {
|
||||||
|
font-size: 18px;
|
||||||
|
letter-spacing: -0.015em;
|
||||||
|
text-wrap: balance;
|
||||||
|
}
|
||||||
|
|
||||||
|
.gallery-grid {
|
||||||
|
gap: 12px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.gallery-card {
|
||||||
|
border-radius: 10px;
|
||||||
|
background: var(--panel-muted);
|
||||||
|
transition: border-color 160ms ease, background-color 160ms ease, transform 160ms ease;
|
||||||
|
}
|
||||||
|
|
||||||
|
.gallery-card:hover,
|
||||||
|
.gallery-card:focus-within {
|
||||||
|
border-color: color-mix(in srgb, var(--primary) 44%, var(--border));
|
||||||
|
background: color-mix(in srgb, var(--primary-soft) 22%, var(--panel-muted));
|
||||||
|
transform: translateY(-1px);
|
||||||
|
}
|
||||||
|
|
||||||
|
.gallery-card-media {
|
||||||
|
border-radius: 7px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.gallery-empty {
|
||||||
|
min-height: 300px;
|
||||||
|
border-radius: 10px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.gallery-skeleton-grid span {
|
||||||
|
border-radius: 10px;
|
||||||
|
}
|
||||||
|
|
||||||
|
@media (max-width: 760px) {
|
||||||
|
.gallery-batch-actions {
|
||||||
|
justify-content: flex-start;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@media (prefers-reduced-motion: reduce) {
|
||||||
|
.gallery-card,
|
||||||
|
.gallery-skeleton-grid span {
|
||||||
|
animation: none;
|
||||||
|
transition: none;
|
||||||
|
}
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|
|
||||||
|
|
@ -1270,6 +1270,21 @@ function styleValidationFidelityPercent(validationCase: AdvancedStyleValidationC
|
||||||
return Number.isFinite(score) ? Math.max(0, Math.min(100, Math.round(score * 100))) : null
|
return Number.isFinite(score) ? Math.max(0, Math.min(100, Math.round(score * 100))) : null
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function styleValidationReviewTrust(validationCase: AdvancedStyleValidationCase) {
|
||||||
|
const review = validationCase.style_review && typeof validationCase.style_review === "object"
|
||||||
|
? validationCase.style_review as Record<string, any>
|
||||||
|
: {}
|
||||||
|
const calibration = review.score_calibration && typeof review.score_calibration === "object"
|
||||||
|
? review.score_calibration as Record<string, any>
|
||||||
|
: {}
|
||||||
|
const coverage = Number(calibration.dimension_coverage)
|
||||||
|
const inconsistent = Boolean(calibration.review_inconsistent || calibration.dimension_consistency_capped)
|
||||||
|
const risks = Array.isArray(review.semantic_risks) && review.semantic_risks.length > 0
|
||||||
|
if (inconsistent || risks) return "????????????????"
|
||||||
|
if (Number.isFinite(coverage)) return `????? ? ???? ${Math.round(coverage * 100)}%`
|
||||||
|
return "?????"
|
||||||
|
}
|
||||||
|
|
||||||
function styleValidationReviewSummary(validationCase: AdvancedStyleValidationCase) {
|
function styleValidationReviewSummary(validationCase: AdvancedStyleValidationCase) {
|
||||||
const review = validationCase.style_review && typeof validationCase.style_review === "object"
|
const review = validationCase.style_review && typeof validationCase.style_review === "object"
|
||||||
? validationCase.style_review
|
? validationCase.style_review
|
||||||
|
|
@ -1594,6 +1609,7 @@ function errorMessage(err: unknown) {
|
||||||
<p>{{ validationCase.content_prompt || "后端将规划与源样本不同、但便于对照的验证角色与场景。" }}</p>
|
<p>{{ validationCase.content_prompt || "后端将规划与源样本不同、但便于对照的验证角色与场景。" }}</p>
|
||||||
<small v-if="validationCase.metadata?.validation_instruction" class="advanced-applied-adjustment">已应用文字调整:{{ validationCase.metadata.validation_instruction }}</small>
|
<small v-if="validationCase.metadata?.validation_instruction" class="advanced-applied-adjustment">已应用文字调整:{{ validationCase.metadata.validation_instruction }}</small>
|
||||||
<small v-if="styleValidationFidelityPercent(validationCase) != null" class="advanced-style-fidelity">自动还原度:{{ styleValidationFidelityPercent(validationCase) }}%</small>
|
<small v-if="styleValidationFidelityPercent(validationCase) != null" class="advanced-style-fidelity">自动还原度:{{ styleValidationFidelityPercent(validationCase) }}%</small>
|
||||||
|
<small v-if="styleValidationFidelityPercent(validationCase) != null" class="advanced-style-review-trust">{{ styleValidationReviewTrust(validationCase) }}</small>
|
||||||
<small v-if="styleValidationReviewSummary(validationCase)" class="advanced-style-review-summary">{{ styleValidationReviewSummary(validationCase) }}</small>
|
<small v-if="styleValidationReviewSummary(validationCase)" class="advanced-style-review-summary">{{ styleValidationReviewSummary(validationCase) }}</small>
|
||||||
<small>{{ Number(validationCase.input_image_count || validationCase.metadata?.input_image_count || 0) > 0 || validationCase.metadata?.reference_image_applied ? "风格参考图验证" : "纯文本验证" }} · {{ Number(validationCase.input_image_count || validationCase.metadata?.input_image_count || 0) }} 张参考图 · 种子 {{ validationCase.seed || "自动" }}</small>
|
<small>{{ Number(validationCase.input_image_count || validationCase.metadata?.input_image_count || 0) > 0 || validationCase.metadata?.reference_image_applied ? "风格参考图验证" : "纯文本验证" }} · {{ Number(validationCase.input_image_count || validationCase.metadata?.input_image_count || 0) }} 张参考图 · 种子 {{ validationCase.seed || "自动" }}</small>
|
||||||
<em v-if="advancedMaterialErrorMessage(validationCase.error)">{{ advancedMaterialErrorMessage(validationCase.error) }}</em>
|
<em v-if="advancedMaterialErrorMessage(validationCase.error)">{{ advancedMaterialErrorMessage(validationCase.error) }}</em>
|
||||||
|
|
@ -1878,6 +1894,7 @@ button:disabled { cursor: not-allowed; opacity: .52; }
|
||||||
.advanced-style-validation-copy small { color: var(--accent-strong); font-size: 10px; }
|
.advanced-style-validation-copy small { color: var(--accent-strong); font-size: 10px; }
|
||||||
.advanced-style-validation-copy .advanced-applied-adjustment { border-left: 2px solid var(--primary); padding-left: 6px; color: var(--primary); line-height: 1.4; }
|
.advanced-style-validation-copy .advanced-applied-adjustment { border-left: 2px solid var(--primary); padding-left: 6px; color: var(--primary); line-height: 1.4; }
|
||||||
.advanced-style-validation-copy .advanced-style-fidelity { color: var(--text); font-weight: 900; }
|
.advanced-style-validation-copy .advanced-style-fidelity { color: var(--text); font-weight: 900; }
|
||||||
|
.advanced-style-validation-copy .advanced-style-review-trust { color: var(--muted-text, var(--text)); }
|
||||||
.advanced-style-validation-copy .advanced-style-review-summary { border-left: 2px solid var(--warning, #d89b30); padding-left: 6px; color: var(--text-soft); line-height: 1.4; }
|
.advanced-style-validation-copy .advanced-style-review-summary { border-left: 2px solid var(--warning, #d89b30); padding-left: 6px; color: var(--text-soft); line-height: 1.4; }
|
||||||
.advanced-style-validation-copy em { color: var(--danger); font-size: 10px; font-style: normal; }
|
.advanced-style-validation-copy em { color: var(--danger); font-size: 10px; font-style: normal; }
|
||||||
.advanced-review-controls { gap: 10px; }
|
.advanced-review-controls { gap: 10px; }
|
||||||
|
|
|
||||||
|
|
@ -391,7 +391,7 @@ function forwardWardrobeAdd(materialId: string, wardrobeCategory: string) {
|
||||||
}
|
}
|
||||||
|
|
||||||
.profile-detail.sealed {
|
.profile-detail.sealed {
|
||||||
box-shadow: inset 0 3px 0 var(--accent);
|
border-color: color-mix(in srgb, var(--accent) 58%, var(--border));
|
||||||
}
|
}
|
||||||
|
|
||||||
.detail-heading,
|
.detail-heading,
|
||||||
|
|
@ -813,7 +813,7 @@ button.danger-button {
|
||||||
}
|
}
|
||||||
|
|
||||||
.target-selector button.active {
|
.target-selector button.active {
|
||||||
box-shadow: inset 3px 0 0 var(--accent);
|
border-color: color-mix(in srgb, var(--accent) 48%, var(--border));
|
||||||
}
|
}
|
||||||
|
|
||||||
.target-thumb {
|
.target-thumb {
|
||||||
|
|
|
||||||
|
|
@ -272,19 +272,19 @@ watch(
|
||||||
padding: 10px;
|
padding: 10px;
|
||||||
text-align: left;
|
text-align: left;
|
||||||
background: transparent;
|
background: transparent;
|
||||||
box-shadow: inset 3px 0 0 var(--border);
|
border-color: var(--border);
|
||||||
}
|
}
|
||||||
|
|
||||||
.profile-list-item.kind-ungenerated {
|
.profile-list-item.kind-ungenerated {
|
||||||
box-shadow: inset 3px 0 0 var(--neutral, #7b8494);
|
border-color: color-mix(in srgb, var(--neutral, #7b8494) 52%, var(--border));
|
||||||
}
|
}
|
||||||
|
|
||||||
.profile-list-item.kind-quick {
|
.profile-list-item.kind-quick {
|
||||||
box-shadow: inset 3px 0 0 var(--warn, #d5963d);
|
border-color: color-mix(in srgb, var(--warn, #d5963d) 52%, var(--border));
|
||||||
}
|
}
|
||||||
|
|
||||||
.profile-list-item.kind-profile_card {
|
.profile-list-item.kind-profile_card {
|
||||||
box-shadow: inset 3px 0 0 var(--accent);
|
border-color: color-mix(in srgb, var(--accent) 52%, var(--border));
|
||||||
}
|
}
|
||||||
|
|
||||||
.profile-list-item:hover {
|
.profile-list-item:hover {
|
||||||
|
|
|
||||||
|
|
@ -44,5 +44,5 @@ const adultUserCount = computed(() => ids("adult_user_allowlist").length)
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<style scoped>
|
<style scoped>
|
||||||
.chat-access{display:grid;gap:14px}.intro{display:grid;gap:5px;border:1px solid var(--border);border-radius:10px;padding:15px;background:linear-gradient(105deg,var(--primary-soft),var(--panel-muted))}.intro span{color:var(--text-soft);font-size:11px;font-weight:800}.intro p,.rules p{margin:0;color:var(--text-soft);line-height:1.5}.rules,.lists{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px}.rules article{display:grid;gap:6px;border:1px solid var(--border);border-radius:10px;padding:14px;background:var(--panel-muted)}.rules b{color:var(--text-soft);font-size:11px}.rules strong{color:var(--primary)}.lists label{display:grid;gap:7px;border:1px solid var(--border);border-radius:10px;padding:14px;background:var(--panel-muted)}.lists label>span{display:flex;justify-content:space-between;font-weight:750}.lists em{border-radius:5px;padding:2px 6px;color:var(--primary);background:var(--primary-soft);font-size:11px;font-style:normal}.lists textarea{width:100%;box-sizing:border-box;border:1px solid var(--border);border-radius:7px;padding:10px;color:var(--text);background:var(--panel);font:inherit;line-height:1.55;resize:vertical}.lists small{color:var(--text-soft)}.adult-intro{display:flex;align-items:center;justify-content:space-between;gap:18px;border-left:3px solid #d39b35;border-radius:7px;padding:12px;background:color-mix(in srgb,#e1a53a 10%,var(--panel))}.adult-intro>div{display:grid;gap:3px}.adult-intro span{color:#9a6818;font-size:11px;font-weight:800}.adult-intro p{max-width:58%;margin:0;color:var(--text-soft);font-size:12px;line-height:1.5}.adult-lists label{border-color:color-mix(in srgb,#e1a53a 35%,var(--border))}.limits{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:10px;border:1px solid var(--border);border-radius:10px;padding:14px;background:var(--panel-muted)}.limits label{display:grid;gap:6px}.limits input[type=number]{min-height:40px;border:1px solid var(--border);border-radius:7px;padding:0 10px;color:var(--text);background:var(--panel);font:inherit}.limits .check{display:flex;align-items:center;gap:8px}@media(max-width:760px){.rules,.lists,.limits{grid-template-columns:1fr}.adult-intro{align-items:flex-start;flex-direction:column}.adult-intro p{max-width:none}}
|
.chat-access{display:grid;gap:14px}.intro{display:grid;gap:5px;border:1px solid var(--border);border-radius:10px;padding:15px;background:linear-gradient(105deg,var(--primary-soft),var(--panel-muted))}.intro span{color:var(--text-soft);font-size:11px;font-weight:800}.intro p,.rules p{margin:0;color:var(--text-soft);line-height:1.5}.rules,.lists{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px}.rules article{display:grid;gap:6px;border:1px solid var(--border);border-radius:10px;padding:14px;background:var(--panel-muted)}.rules b{color:var(--text-soft);font-size:11px}.rules strong{color:var(--primary)}.lists label{display:grid;gap:7px;border:1px solid var(--border);border-radius:10px;padding:14px;background:var(--panel-muted)}.lists label>span{display:flex;justify-content:space-between;font-weight:750}.lists em{border-radius:5px;padding:2px 6px;color:var(--primary);background:var(--primary-soft);font-size:11px;font-style:normal}.lists textarea{width:100%;box-sizing:border-box;border:1px solid var(--border);border-radius:7px;padding:10px;color:var(--text);background:var(--panel);font:inherit;line-height:1.55;resize:vertical}.lists small{color:var(--text-soft)}.adult-intro{display:flex;align-items:center;justify-content:space-between;gap:18px;border:1px solid color-mix(in srgb,#d39b35 48%,var(--border));border-radius:7px;padding:12px;background:color-mix(in srgb,#e1a53a 10%,var(--panel))}.adult-intro>div{display:grid;gap:3px}.adult-intro span{color:#9a6818;font-size:11px;font-weight:800}.adult-intro p{max-width:58%;margin:0;color:var(--text-soft);font-size:12px;line-height:1.5}.adult-lists label{border-color:color-mix(in srgb,#e1a53a 35%,var(--border))}.limits{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:10px;border:1px solid var(--border);border-radius:10px;padding:14px;background:var(--panel-muted)}.limits label{display:grid;gap:6px}.limits input[type=number]{min-height:40px;border:1px solid var(--border);border-radius:7px;padding:0 10px;color:var(--text);background:var(--panel);font:inherit}.limits .check{display:flex;align-items:center;gap:8px}@media(max-width:760px){.rules,.lists,.limits{grid-template-columns:1fr}.adult-intro{align-items:flex-start;flex-direction:column}.adult-intro p{max-width:none}}
|
||||||
</style>
|
</style>
|
||||||
|
|
|
||||||
|
|
@ -206,5 +206,5 @@ onMounted(async () => {
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<style scoped>
|
<style scoped>
|
||||||
.assignments{display:grid;gap:14px}.assignments>header{border:1px solid var(--border);border-radius:10px;padding:15px;background:linear-gradient(105deg,var(--primary-soft),var(--panel-muted))}.assignments header>div{display:grid;gap:4px}.assignments header span{color:var(--text-soft);font-size:11px;font-weight:800}.assignments header p,.grid p{margin:0;color:var(--text-soft);line-height:1.5}.grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:11px}.grid article{display:grid;gap:9px;border:1px solid var(--border);border-radius:10px;padding:14px;background:var(--panel-muted)}.card-head{display:flex;justify-content:space-between}.card-head span,.card-head em{border-radius:5px;padding:3px 7px;font-size:10px;font-style:normal}.card-head span.image{color:#7757e8;background:var(--primary-soft)}.card-head span.vision{color:#25845a;background:color-mix(in srgb,#39aa72 13%,var(--panel))}.card-head span.text{color:#a06a12;background:color-mix(in srgb,#e1a53a 15%,var(--panel))}.card-head em{color:var(--text-soft);background:var(--panel)}.card-head em.active{color:#25845a}.recommendation{display:grid;grid-template-columns:auto 1fr;align-items:start;gap:8px;border-left:3px solid var(--primary);border-radius:4px;padding:8px 10px;background:color-mix(in srgb,var(--primary-soft) 55%,var(--panel))}.recommendation b{white-space:nowrap;color:var(--primary);font-size:11px}.recommendation span{color:var(--text-soft);font-size:12px;line-height:1.55}.route-pair{display:grid;grid-template-columns:1fr 1fr;gap:8px}.grid label{display:grid;gap:5px;min-width:0}.grid label>span,.grid article>small{color:var(--text-soft);font-size:11px}.grid label>span b{display:inline-grid;place-items:center;width:17px;height:17px;margin-right:4px;border-radius:50%;color:#fff;background:var(--primary);font-size:9px}.grid select{width:100%;min-height:39px;border:1px solid var(--border);border-radius:7px;padding:0 34px 0 10px;color:var(--text);background:var(--panel);font:inherit;cursor:pointer}.grid select:disabled{cursor:not-allowed;opacity:.65}.route-note{font-size:11px!important}.review-group{grid-column:1/-1}.review-routes{display:grid;gap:10px}.review-route-row{border:1px solid var(--border);border-radius:8px;padding:10px;background:var(--panel)}.review-select{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr) auto;gap:7px}.review-select button{width:39px;border:1px solid var(--border);border-radius:7px;color:#c45151;background:var(--panel);font-size:20px}.add-review{justify-self:start;border:1px dashed var(--primary);border-radius:7px;padding:8px 13px;color:var(--primary);background:var(--panel);cursor:pointer}@media(max-width:900px){.route-pair,.review-select{grid-template-columns:1fr}.review-select button{width:100%}}@media(max-width:760px){.grid{grid-template-columns:1fr}.recommendation{grid-template-columns:1fr}}
|
.assignments{display:grid;gap:14px}.assignments>header{border:1px solid var(--border);border-radius:10px;padding:15px;background:linear-gradient(105deg,var(--primary-soft),var(--panel-muted))}.assignments header>div{display:grid;gap:4px}.assignments header span{color:var(--text-soft);font-size:11px;font-weight:800}.assignments header p,.grid p{margin:0;color:var(--text-soft);line-height:1.5}.grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:11px}.grid article{display:grid;gap:9px;border:1px solid var(--border);border-radius:10px;padding:14px;background:var(--panel-muted)}.card-head{display:flex;justify-content:space-between}.card-head span,.card-head em{border-radius:5px;padding:3px 7px;font-size:10px;font-style:normal}.card-head span.image{color:#7757e8;background:var(--primary-soft)}.card-head span.vision{color:#25845a;background:color-mix(in srgb,#39aa72 13%,var(--panel))}.card-head span.text{color:#a06a12;background:color-mix(in srgb,#e1a53a 15%,var(--panel))}.card-head em{color:var(--text-soft);background:var(--panel)}.card-head em.active{color:#25845a}.recommendation{display:grid;grid-template-columns:auto 1fr;align-items:start;gap:8px;border:1px solid color-mix(in srgb,var(--primary) 48%,var(--border));border-radius:4px;padding:8px 10px;background:color-mix(in srgb,var(--primary-soft) 55%,var(--panel))}.recommendation b{white-space:nowrap;color:var(--primary);font-size:11px}.recommendation span{color:var(--text-soft);font-size:12px;line-height:1.55}.route-pair{display:grid;grid-template-columns:1fr 1fr;gap:8px}.grid label{display:grid;gap:5px;min-width:0}.grid label>span,.grid article>small{color:var(--text-soft);font-size:11px}.grid label>span b{display:inline-grid;place-items:center;width:17px;height:17px;margin-right:4px;border-radius:50%;color:#fff;background:var(--primary);font-size:9px}.grid select{width:100%;min-height:39px;border:1px solid var(--border);border-radius:7px;padding:0 34px 0 10px;color:var(--text);background:var(--panel);font:inherit;cursor:pointer}.grid select:disabled{cursor:not-allowed;opacity:.65}.route-note{font-size:11px!important}.review-group{grid-column:1/-1}.review-routes{display:grid;gap:10px}.review-route-row{border:1px solid var(--border);border-radius:8px;padding:10px;background:var(--panel)}.review-select{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr) auto;gap:7px}.review-select button{width:39px;border:1px solid var(--border);border-radius:7px;color:#c45151;background:var(--panel);font-size:20px}.add-review{justify-self:start;border:1px dashed var(--primary);border-radius:7px;padding:8px 13px;color:var(--primary);background:var(--panel);cursor:pointer}@media(max-width:900px){.route-pair,.review-select{grid-template-columns:1fr}.review-select button{width:100%}}@media(max-width:760px){.grid{grid-template-columns:1fr}.recommendation{grid-template-columns:1fr}}
|
||||||
</style>
|
</style>
|
||||||
|
|
|
||||||
|
|
@ -53,6 +53,6 @@ onMounted(async()=>{try{runtimeModels.value=(await getJson<{items:RuntimeModel[]
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<style scoped>
|
<style scoped>
|
||||||
.governance{display:grid;gap:13px}.intro,.card{border:1px solid var(--border);border-radius:10px;background:var(--panel-muted)}.intro{display:flex;align-items:center;justify-content:space-between;gap:18px;padding:16px;background:linear-gradient(105deg,var(--primary-soft),var(--panel-muted))}.intro>div:first-child,.card header>div{display:grid;gap:4px}.intro span,.card header span,.entries>span{color:var(--text-soft);font-size:11px;font-weight:800}.intro p,.card p,.grid small{margin:0;color:var(--text-soft);font-size:12px;line-height:1.5}.flow{display:flex;align-items:center;gap:6px;white-space:nowrap}.flow b{border-radius:6px;padding:6px 8px;color:var(--primary);background:var(--panel)}.flow i{color:var(--text-soft);font-style:normal}.card{display:grid;gap:14px;padding:15px}.card>header{display:flex;align-items:flex-start;justify-content:space-between;gap:16px}.grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px}.grid label,.route-pair label{display:grid;gap:6px}.grid label>span,.route-pair label>span,.retention span{font-size:12px;font-weight:750}.source-pair{grid-template-columns:repeat(2,minmax(0,1fr));align-items:start}.source-pair label>span b{display:inline-grid;place-items:center;width:18px;height:18px;margin-right:4px;border-radius:50%;color:#fff;background:var(--primary);font-size:10px}.vision-note{color:var(--text-soft);font-size:11px}select,input{width:100%;min-height:40px;box-sizing:border-box;border:1px solid var(--border);border-radius:7px;padding:0 10px;color:var(--text);background:var(--panel)}.switch input{position:absolute;opacity:0;pointer-events:none}.switch span{position:relative;display:block;width:44px;height:25px;border-radius:99px;background:var(--border);cursor:pointer}.switch span:after{position:absolute;top:3px;left:3px;width:19px;height:19px;border-radius:50%;background:#fff;content:"";transition:.18s}.switch input:checked+span{background:var(--primary)}.switch input:checked+span:after{transform:translateX(19px)}.entries{display:flex;align-items:center;flex-wrap:wrap;gap:10px;border-top:1px solid var(--border);padding-top:12px}.entries label{display:flex;align-items:center;gap:5px;font-size:12px}.entries input{width:auto;min-height:auto}.route-pair{display:grid;grid-template-columns:1fr 36px 1fr;align-items:end;gap:8px}.arrow{display:grid;place-items:center;min-height:40px;color:var(--primary);font-size:20px}.routing{border-color:color-mix(in srgb,var(--primary) 35%,var(--border))}.policy{display:grid;gap:6px;border-left:3px solid #d39b35;border-radius:6px;padding:11px 12px;background:color-mix(in srgb,#e1a53a 10%,var(--panel))}.policy b{color:#9a6818}.policy span{color:var(--text-soft);font-size:12px;line-height:1.45}.retention{display:grid;grid-template-columns:repeat(3,1fr);gap:10px}.retention label{display:grid;grid-template-columns:1fr 72px auto;align-items:center;gap:7px}.retention small{color:var(--text-soft)}@media(max-width:800px){.intro{align-items:flex-start;flex-direction:column}.flow{flex-wrap:wrap}.grid,.route-pair,.retention{grid-template-columns:1fr}.arrow{transform:rotate(90deg)}}
|
.governance{display:grid;gap:13px}.intro,.card{border:1px solid var(--border);border-radius:10px;background:var(--panel-muted)}.intro{display:flex;align-items:center;justify-content:space-between;gap:18px;padding:16px;background:linear-gradient(105deg,var(--primary-soft),var(--panel-muted))}.intro>div:first-child,.card header>div{display:grid;gap:4px}.intro span,.card header span,.entries>span{color:var(--text-soft);font-size:11px;font-weight:800}.intro p,.card p,.grid small{margin:0;color:var(--text-soft);font-size:12px;line-height:1.5}.flow{display:flex;align-items:center;gap:6px;white-space:nowrap}.flow b{border-radius:6px;padding:6px 8px;color:var(--primary);background:var(--panel)}.flow i{color:var(--text-soft);font-style:normal}.card{display:grid;gap:14px;padding:15px}.card>header{display:flex;align-items:flex-start;justify-content:space-between;gap:16px}.grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px}.grid label,.route-pair label{display:grid;gap:6px}.grid label>span,.route-pair label>span,.retention span{font-size:12px;font-weight:750}.source-pair{grid-template-columns:repeat(2,minmax(0,1fr));align-items:start}.source-pair label>span b{display:inline-grid;place-items:center;width:18px;height:18px;margin-right:4px;border-radius:50%;color:#fff;background:var(--primary);font-size:10px}.vision-note{color:var(--text-soft);font-size:11px}select,input{width:100%;min-height:40px;box-sizing:border-box;border:1px solid var(--border);border-radius:7px;padding:0 10px;color:var(--text);background:var(--panel)}.switch input{position:absolute;opacity:0;pointer-events:none}.switch span{position:relative;display:block;width:44px;height:25px;border-radius:99px;background:var(--border);cursor:pointer}.switch span:after{position:absolute;top:3px;left:3px;width:19px;height:19px;border-radius:50%;background:#fff;content:"";transition:.18s}.switch input:checked+span{background:var(--primary)}.switch input:checked+span:after{transform:translateX(19px)}.entries{display:flex;align-items:center;flex-wrap:wrap;gap:10px;border-top:1px solid var(--border);padding-top:12px}.entries label{display:flex;align-items:center;gap:5px;font-size:12px}.entries input{width:auto;min-height:auto}.route-pair{display:grid;grid-template-columns:1fr 36px 1fr;align-items:end;gap:8px}.arrow{display:grid;place-items:center;min-height:40px;color:var(--primary);font-size:20px}.routing{border-color:color-mix(in srgb,var(--primary) 35%,var(--border))}.policy{display:grid;gap:6px;border:1px solid color-mix(in srgb,#d39b35 48%,var(--border));border-radius:6px;padding:11px 12px;background:color-mix(in srgb,#e1a53a 10%,var(--panel))}.policy b{color:#9a6818}.policy span{color:var(--text-soft);font-size:12px;line-height:1.45}.retention{display:grid;grid-template-columns:repeat(3,1fr);gap:10px}.retention label{display:grid;grid-template-columns:1fr 72px auto;align-items:center;gap:7px}.retention small{color:var(--text-soft)}@media(max-width:800px){.intro{align-items:flex-start;flex-direction:column}.flow{flex-wrap:wrap}.grid,.route-pair,.retention{grid-template-columns:1fr}.arrow{transform:rotate(90deg)}}
|
||||||
.preview-card{display:grid;gap:10px;border:1px solid var(--border);border-radius:10px;padding:15px;background:var(--panel-muted)}.preview-card>header{display:flex;align-items:center;justify-content:space-between;gap:12px}.preview-card>header>div{display:grid;gap:3px}.preview-card>header span{color:var(--text-soft);font-size:11px;font-weight:800}.preview-card button{min-height:36px;border:1px solid var(--primary);border-radius:7px;padding:0 11px;color:#fff;background:var(--primary);cursor:pointer}.preview-card button:disabled{opacity:.5}.preview-card textarea{width:100%;box-sizing:border-box;border:1px solid var(--border);border-radius:7px;padding:9px;color:var(--text);background:var(--panel);font:inherit;resize:vertical}.preview-choice{display:flex;flex-wrap:wrap;gap:10px}.preview-choice label{display:flex;align-items:center;gap:5px;font-size:12px}.preview-result{display:grid;grid-template-columns:repeat(3,1fr);gap:7px;border-top:1px solid var(--border);padding-top:10px}.preview-result>span{display:grid;gap:3px;border-radius:6px;padding:8px;background:var(--panel)}.preview-result>span b{color:var(--text-soft);font-size:10px}.preview-result>p,.preview-result>details{grid-column:1/-1}.preview-result>p{margin:0;border-radius:6px;padding:9px;background:var(--panel);font-size:12px;line-height:1.5}.preview-result pre{max-height:260px;overflow:auto;border-radius:6px;padding:8px;background:var(--panel);font-size:10px;white-space:pre-wrap}.preview-error{color:var(--danger)!important}
|
.preview-card{display:grid;gap:10px;border:1px solid var(--border);border-radius:10px;padding:15px;background:var(--panel-muted)}.preview-card>header{display:flex;align-items:center;justify-content:space-between;gap:12px}.preview-card>header>div{display:grid;gap:3px}.preview-card>header span{color:var(--text-soft);font-size:11px;font-weight:800}.preview-card button{min-height:36px;border:1px solid var(--primary);border-radius:7px;padding:0 11px;color:#fff;background:var(--primary);cursor:pointer}.preview-card button:disabled{opacity:.5}.preview-card textarea{width:100%;box-sizing:border-box;border:1px solid var(--border);border-radius:7px;padding:9px;color:var(--text);background:var(--panel);font:inherit;resize:vertical}.preview-choice{display:flex;flex-wrap:wrap;gap:10px}.preview-choice label{display:flex;align-items:center;gap:5px;font-size:12px}.preview-result{display:grid;grid-template-columns:repeat(3,1fr);gap:7px;border-top:1px solid var(--border);padding-top:10px}.preview-result>span{display:grid;gap:3px;border-radius:6px;padding:8px;background:var(--panel)}.preview-result>span b{color:var(--text-soft);font-size:10px}.preview-result>p,.preview-result>details{grid-column:1/-1}.preview-result>p{margin:0;border-radius:6px;padding:9px;background:var(--panel);font-size:12px;line-height:1.5}.preview-result pre{max-height:260px;overflow:auto;border-radius:6px;padding:8px;background:var(--panel);font-size:10px;white-space:pre-wrap}.preview-error{color:var(--danger)!important}
|
||||||
</style>
|
</style>
|
||||||
|
|
|
||||||
文件差异因一行或多行过长而隐藏
|
|
@ -243,7 +243,7 @@ function shortValue(value: string) {
|
||||||
}
|
}
|
||||||
|
|
||||||
.workflow-branch-strip > button.current {
|
.workflow-branch-strip > button.current {
|
||||||
box-shadow: inset 3px 0 0 var(--primary);
|
box-shadow: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
.workflow-branch-strip > button:disabled:not(.current) {
|
.workflow-branch-strip > button:disabled:not(.current) {
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,24 @@
|
||||||
|
:root {
|
||||||
|
--ui-space-1: 4px;
|
||||||
|
--ui-space-2: 8px;
|
||||||
|
--ui-space-3: 12px;
|
||||||
|
--ui-space-4: 16px;
|
||||||
|
--ui-space-5: 20px;
|
||||||
|
--ui-space-6: 24px;
|
||||||
|
--ui-radius-sm: 6px;
|
||||||
|
--ui-radius-md: 8px;
|
||||||
|
--ui-radius-lg: 10px;
|
||||||
|
--ui-border-subtle: color-mix(in srgb, currentColor 14%, transparent);
|
||||||
|
--ui-focus-ring: 0 0 0 3px color-mix(in srgb, var(--primary) 28%, transparent);
|
||||||
|
--ui-shadow-soft: 0 8px 20px color-mix(in srgb, var(--bg) 22%, transparent);
|
||||||
|
--ui-duration-fast: 140ms;
|
||||||
|
--ui-duration-normal: 180ms;
|
||||||
|
--ui-ease-standard: cubic-bezier(0.2, 0, 0, 1);
|
||||||
|
}
|
||||||
|
|
||||||
|
@media (prefers-reduced-motion: reduce) {
|
||||||
|
:root {
|
||||||
|
--ui-duration-fast: 0ms;
|
||||||
|
--ui-duration-normal: 0ms;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,457 @@
|
||||||
|
.navigation-shell {
|
||||||
|
--workbench-pad: 20px;
|
||||||
|
background: var(--bg);
|
||||||
|
background-image: none;
|
||||||
|
font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
|
||||||
|
}
|
||||||
|
|
||||||
|
.navigation-shell button,
|
||||||
|
.navigation-shell input,
|
||||||
|
.navigation-shell select,
|
||||||
|
.navigation-shell textarea {
|
||||||
|
border-radius: var(--ui-radius-md);
|
||||||
|
}
|
||||||
|
|
||||||
|
.navigation-shell button:focus-visible,
|
||||||
|
.navigation-shell input:focus-visible,
|
||||||
|
.navigation-shell select:focus-visible,
|
||||||
|
.navigation-shell textarea:focus-visible,
|
||||||
|
.navigation-shell [tabindex]:focus-visible {
|
||||||
|
outline: none;
|
||||||
|
box-shadow: var(--ui-focus-ring);
|
||||||
|
}
|
||||||
|
|
||||||
|
.navigation-shell button:hover:not(:disabled),
|
||||||
|
.navigation-shell button:focus-visible:not(:disabled) {
|
||||||
|
border-color: color-mix(in srgb, var(--primary) 46%, var(--border));
|
||||||
|
}
|
||||||
|
|
||||||
|
.rail {
|
||||||
|
background: var(--bg-soft);
|
||||||
|
backdrop-filter: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
.brand-mark {
|
||||||
|
border-radius: var(--ui-radius-md);
|
||||||
|
box-shadow: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
.topbar {
|
||||||
|
background: var(--panel);
|
||||||
|
backdrop-filter: none;
|
||||||
|
border-bottom-color: var(--border);
|
||||||
|
}
|
||||||
|
|
||||||
|
.navigation-shell[data-theme="light"] .topbar {
|
||||||
|
background: var(--panel);
|
||||||
|
}
|
||||||
|
|
||||||
|
.panel,
|
||||||
|
.overview-strip,
|
||||||
|
.detail-hero,
|
||||||
|
.generate-hero,
|
||||||
|
.materials-hero,
|
||||||
|
.signal-card,
|
||||||
|
.metric-card,
|
||||||
|
.queue-board-panel,
|
||||||
|
.queue-detail-panel,
|
||||||
|
.materials-library-panel,
|
||||||
|
.materials-action-card,
|
||||||
|
.materials-category-chip,
|
||||||
|
.state-card,
|
||||||
|
.empty-state,
|
||||||
|
.quick-profile-profile-card,
|
||||||
|
.quick-profile-image-panel,
|
||||||
|
.quick-profile-command-panel,
|
||||||
|
.quick-profile-library,
|
||||||
|
.quick-profile-material-panel,
|
||||||
|
.workflow-panel,
|
||||||
|
.workflow-detail-panel,
|
||||||
|
.workflow-preview-panel,
|
||||||
|
.settings-section,
|
||||||
|
.logs-panel {
|
||||||
|
border-radius: var(--ui-radius-lg);
|
||||||
|
box-shadow: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
.panel,
|
||||||
|
.overview-strip,
|
||||||
|
.detail-hero,
|
||||||
|
.generate-hero,
|
||||||
|
.materials-hero,
|
||||||
|
.queue-board-panel,
|
||||||
|
.queue-detail-panel,
|
||||||
|
.materials-library-panel,
|
||||||
|
.quick-profile-profile-card,
|
||||||
|
.quick-profile-image-panel,
|
||||||
|
.quick-profile-command-panel,
|
||||||
|
.quick-profile-library,
|
||||||
|
.quick-profile-material-panel,
|
||||||
|
.workflow-panel,
|
||||||
|
.workflow-detail-panel,
|
||||||
|
.workflow-preview-panel,
|
||||||
|
.settings-section,
|
||||||
|
.logs-panel {
|
||||||
|
background: var(--panel);
|
||||||
|
}
|
||||||
|
|
||||||
|
.signal-card::before,
|
||||||
|
.metric-card::before,
|
||||||
|
.queue-action-card::before,
|
||||||
|
.workflow-draft-grid > article.final::before {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
.signal-card.good,
|
||||||
|
.metric-card.good,
|
||||||
|
.signal-card.warn,
|
||||||
|
.metric-card.warn,
|
||||||
|
.signal-card.bad,
|
||||||
|
.metric-card.bad,
|
||||||
|
.signal-card.idle,
|
||||||
|
.metric-card.idle {
|
||||||
|
border-color: var(--border);
|
||||||
|
background: var(--panel);
|
||||||
|
}
|
||||||
|
|
||||||
|
.signal-card.good,
|
||||||
|
.metric-card.good { border-color: color-mix(in srgb, var(--accent) 52%, var(--border)); }
|
||||||
|
.signal-card.warn,
|
||||||
|
.metric-card.warn { border-color: color-mix(in srgb, var(--warn) 52%, var(--border)); }
|
||||||
|
.signal-card.bad,
|
||||||
|
.metric-card.bad { border-color: color-mix(in srgb, var(--danger) 52%, var(--border)); }
|
||||||
|
|
||||||
|
.panel header,
|
||||||
|
.overview-strip > header,
|
||||||
|
.generate-hero > header,
|
||||||
|
.materials-hero > header,
|
||||||
|
.queue-board-panel > header,
|
||||||
|
.materials-library-panel > header {
|
||||||
|
gap: var(--ui-space-3);
|
||||||
|
}
|
||||||
|
|
||||||
|
.navigation-shell h1,
|
||||||
|
.navigation-shell h2,
|
||||||
|
.navigation-shell h3,
|
||||||
|
.navigation-shell strong {
|
||||||
|
text-wrap: balance;
|
||||||
|
}
|
||||||
|
|
||||||
|
.navigation-shell p,
|
||||||
|
.navigation-shell dd,
|
||||||
|
.navigation-shell .panel-copy,
|
||||||
|
.navigation-shell .empty-state span {
|
||||||
|
text-wrap: pretty;
|
||||||
|
}
|
||||||
|
|
||||||
|
.navigation-shell input,
|
||||||
|
.navigation-shell select,
|
||||||
|
.navigation-shell textarea {
|
||||||
|
min-height: 38px;
|
||||||
|
border-color: var(--border);
|
||||||
|
background: var(--panel);
|
||||||
|
}
|
||||||
|
|
||||||
|
.navigation-shell input::placeholder,
|
||||||
|
.navigation-shell textarea::placeholder {
|
||||||
|
color: var(--text-soft);
|
||||||
|
opacity: 0.9;
|
||||||
|
}
|
||||||
|
|
||||||
|
.navigation-shell .primary-button,
|
||||||
|
.navigation-shell button.primary,
|
||||||
|
.navigation-shell .quick-create {
|
||||||
|
box-shadow: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
.navigation-shell .state-card,
|
||||||
|
.navigation-shell .empty-state {
|
||||||
|
border-color: var(--border);
|
||||||
|
}
|
||||||
|
|
||||||
|
.navigation-shell .state-card.good,
|
||||||
|
.navigation-shell .state-card.warn,
|
||||||
|
.navigation-shell .state-card.bad,
|
||||||
|
.navigation-shell .state-card.info {
|
||||||
|
background: var(--panel);
|
||||||
|
}
|
||||||
|
|
||||||
|
@media (max-width: 1180px) {
|
||||||
|
.navigation-shell {
|
||||||
|
--workbench-pad: 16px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.topbar {
|
||||||
|
gap: 10px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@media (max-width: 900px) {
|
||||||
|
.navigation-shell {
|
||||||
|
--workbench-pad: 12px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.topbar {
|
||||||
|
padding-top: 14px;
|
||||||
|
padding-bottom: 14px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@media (prefers-reduced-motion: reduce) {
|
||||||
|
.navigation-shell *,
|
||||||
|
.navigation-shell *::before,
|
||||||
|
.navigation-shell *::after {
|
||||||
|
animation-duration: 0.001ms !important;
|
||||||
|
animation-iteration-count: 1 !important;
|
||||||
|
scroll-behavior: auto !important;
|
||||||
|
transition-duration: 0.001ms !important;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
.generate-page,
|
||||||
|
.profiles-page,
|
||||||
|
.materials-page,
|
||||||
|
.settings-page,
|
||||||
|
.logs-page,
|
||||||
|
.performance-detail-page,
|
||||||
|
.queue-page,
|
||||||
|
.workflow-workspace,
|
||||||
|
.quick-profile-workspace {
|
||||||
|
gap: var(--ui-space-4);
|
||||||
|
}
|
||||||
|
|
||||||
|
.generate-hero,
|
||||||
|
.queue-hero,
|
||||||
|
.profiles-workspace,
|
||||||
|
.materials-workbench,
|
||||||
|
.settings-page > .hero,
|
||||||
|
.logs-hero,
|
||||||
|
.performance-detail-page > header {
|
||||||
|
border: 1px solid var(--border);
|
||||||
|
background: var(--panel);
|
||||||
|
}
|
||||||
|
|
||||||
|
.generate-mode-actions,
|
||||||
|
.materials-view-tabs,
|
||||||
|
.materials-filter-strip,
|
||||||
|
.materials-subfilter-strip,
|
||||||
|
.queue-filter-tabs,
|
||||||
|
.profile-tabs,
|
||||||
|
.detail-tabs,
|
||||||
|
.logs-toolbar,
|
||||||
|
.workflow-section-header,
|
||||||
|
.workflow-round-toolbar {
|
||||||
|
border: 1px solid var(--border);
|
||||||
|
border-radius: var(--ui-radius-md);
|
||||||
|
background: var(--panel-muted);
|
||||||
|
}
|
||||||
|
|
||||||
|
.generate-mode-button,
|
||||||
|
.materials-view-tabs button,
|
||||||
|
.queue-filter-tabs button,
|
||||||
|
.profile-tabs button,
|
||||||
|
.detail-tabs button,
|
||||||
|
.workflow-round-toolbar button {
|
||||||
|
border-radius: var(--ui-radius-sm);
|
||||||
|
}
|
||||||
|
|
||||||
|
.generate-mode-button.active,
|
||||||
|
.materials-view-tabs button.active,
|
||||||
|
.queue-filter-tabs button.active,
|
||||||
|
.profile-tabs button.active,
|
||||||
|
.detail-tabs button.active {
|
||||||
|
border-color: color-mix(in srgb, var(--primary) 48%, var(--border));
|
||||||
|
color: var(--text);
|
||||||
|
background: var(--primary-soft);
|
||||||
|
}
|
||||||
|
|
||||||
|
.image-generation-workspace,
|
||||||
|
.performance-detail-grid,
|
||||||
|
.queue-workbench,
|
||||||
|
.materials-workbench,
|
||||||
|
.profiles-workspace,
|
||||||
|
.settings-page .workspace,
|
||||||
|
.logs-workspace,
|
||||||
|
.workflow-layout {
|
||||||
|
min-width: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.image-preview-panel,
|
||||||
|
.image-display-panel,
|
||||||
|
.image-info-card,
|
||||||
|
.performance-summary-panel,
|
||||||
|
.performance-breakdown,
|
||||||
|
.queue-board-panel,
|
||||||
|
.queue-detail-panel,
|
||||||
|
.queue-actions-panel,
|
||||||
|
.materials-library-panel,
|
||||||
|
.materials-actions-panel,
|
||||||
|
.profile-master,
|
||||||
|
.profile-detail,
|
||||||
|
.detail-content,
|
||||||
|
.settings-page section,
|
||||||
|
.logs-stream,
|
||||||
|
.workflow-preview-panel,
|
||||||
|
.workflow-detail-panel,
|
||||||
|
.workflow-candidate-pool,
|
||||||
|
.workflow-dependency-card,
|
||||||
|
.workflow-round-panel,
|
||||||
|
.workflow-material-drawer,
|
||||||
|
.workflow-composer-panel {
|
||||||
|
border-color: var(--border);
|
||||||
|
border-radius: var(--ui-radius-lg);
|
||||||
|
box-shadow: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
.image-preview-panel,
|
||||||
|
.image-display-panel,
|
||||||
|
.image-info-card,
|
||||||
|
.performance-summary-panel,
|
||||||
|
.performance-breakdown,
|
||||||
|
.queue-board-panel,
|
||||||
|
.queue-detail-panel,
|
||||||
|
.queue-actions-panel,
|
||||||
|
.materials-library-panel,
|
||||||
|
.materials-actions-panel,
|
||||||
|
.profile-master,
|
||||||
|
.profile-detail,
|
||||||
|
.detail-content,
|
||||||
|
.settings-page section,
|
||||||
|
.logs-stream,
|
||||||
|
.workflow-preview-panel,
|
||||||
|
.workflow-detail-panel,
|
||||||
|
.workflow-candidate-pool,
|
||||||
|
.workflow-dependency-card,
|
||||||
|
.workflow-round-panel,
|
||||||
|
.workflow-material-drawer,
|
||||||
|
.workflow-composer-panel {
|
||||||
|
background: var(--panel);
|
||||||
|
}
|
||||||
|
|
||||||
|
.image-preview-card,
|
||||||
|
.queue-task-card,
|
||||||
|
.queue-list li,
|
||||||
|
.materials-library-card,
|
||||||
|
.materials-action-card,
|
||||||
|
.profile-list-item,
|
||||||
|
.workflow-candidate-card,
|
||||||
|
.workflow-round-card,
|
||||||
|
.workflow-group-card,
|
||||||
|
.workflow-material-bind-card,
|
||||||
|
.workflow-prompt-plan-card,
|
||||||
|
.workflow-branch-panel,
|
||||||
|
.workflow-chat-panel {
|
||||||
|
border-color: var(--border);
|
||||||
|
border-radius: var(--ui-radius-md);
|
||||||
|
background: var(--panel-muted);
|
||||||
|
box-shadow: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
.image-preview-card:hover,
|
||||||
|
.image-preview-card.active,
|
||||||
|
.queue-task-card:hover,
|
||||||
|
.queue-list li:hover,
|
||||||
|
.materials-library-card:hover,
|
||||||
|
.profile-list-item:hover,
|
||||||
|
.profile-list-item.active,
|
||||||
|
.workflow-candidate-card:hover,
|
||||||
|
.workflow-round-card:hover {
|
||||||
|
border-color: color-mix(in srgb, var(--primary) 44%, var(--border));
|
||||||
|
background: color-mix(in srgb, var(--primary-soft) 20%, var(--panel-muted));
|
||||||
|
}
|
||||||
|
|
||||||
|
.image-stage,
|
||||||
|
.image-stage-empty,
|
||||||
|
.image-preview-empty,
|
||||||
|
.detail-empty,
|
||||||
|
.profile-detail-empty,
|
||||||
|
.logs-empty,
|
||||||
|
.workflow-candidate-empty,
|
||||||
|
.workflow-round-empty,
|
||||||
|
.workflow-dependency-empty {
|
||||||
|
border-radius: var(--ui-radius-md);
|
||||||
|
border-color: var(--border);
|
||||||
|
background: var(--panel-muted);
|
||||||
|
}
|
||||||
|
|
||||||
|
.image-stage-button,
|
||||||
|
.quick-create,
|
||||||
|
.quick-profile-hero-button,
|
||||||
|
.quick-profile-portrait-button,
|
||||||
|
.materials-primary-add,
|
||||||
|
.workflow-review-trigger,
|
||||||
|
.workflow-compare-trigger {
|
||||||
|
border-radius: var(--ui-radius-md);
|
||||||
|
}
|
||||||
|
|
||||||
|
.status-pill,
|
||||||
|
.queue-task-status,
|
||||||
|
.workflow-status-pill,
|
||||||
|
.profile-status-pill,
|
||||||
|
.material-status-pill {
|
||||||
|
border-radius: 999px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.navigation-shell table {
|
||||||
|
border-collapse: separate;
|
||||||
|
border-spacing: 0;
|
||||||
|
overflow: hidden;
|
||||||
|
border: 1px solid var(--border);
|
||||||
|
border-radius: var(--ui-radius-md);
|
||||||
|
}
|
||||||
|
|
||||||
|
.navigation-shell th,
|
||||||
|
.navigation-shell td {
|
||||||
|
border-color: var(--border);
|
||||||
|
}
|
||||||
|
|
||||||
|
.navigation-shell :is(.dialog, .drawer, [class*="-dialog"], [class*="-drawer"]) {
|
||||||
|
border-radius: var(--ui-radius-lg);
|
||||||
|
box-shadow: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
.navigation-shell :is(.dialog, .drawer, [class*="-dialog"], [class*="-drawer"]) > header,
|
||||||
|
.navigation-shell :is(.dialog, .drawer, [class*="-dialog"], [class*="-drawer"]) > footer {
|
||||||
|
border-color: var(--border);
|
||||||
|
}
|
||||||
|
|
||||||
|
@media (max-width: 1180px) {
|
||||||
|
.image-generation-workspace,
|
||||||
|
.performance-detail-grid,
|
||||||
|
.queue-workbench,
|
||||||
|
.materials-workbench,
|
||||||
|
.profiles-workspace,
|
||||||
|
.workflow-layout {
|
||||||
|
gap: var(--ui-space-3);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@media (max-width: 1360px) and (min-width: 901px) {
|
||||||
|
.overview-strip {
|
||||||
|
grid-template-columns: minmax(220px, 1.2fr) repeat(3, minmax(120px, 0.8fr)) minmax(200px, 0.9fr);
|
||||||
|
gap: 10px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.overview-strip > * {
|
||||||
|
min-width: 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@media (max-width: 1360px) and (min-width: 901px) {
|
||||||
|
.navigation-shell .overview-strip {
|
||||||
|
grid-template-columns: minmax(220px, 1.2fr) repeat(3, minmax(120px, 0.8fr)) minmax(200px, 0.9fr);
|
||||||
|
gap: 10px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.navigation-shell .overview-strip > * {
|
||||||
|
min-width: 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@media (max-width: 1180px) {
|
||||||
|
.navigation-shell .overview-strip {
|
||||||
|
grid-template-columns: repeat(2, minmax(0, 1fr));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,59 @@
|
||||||
|
import fs from 'node:fs'
|
||||||
|
import path from 'node:path'
|
||||||
|
import test from 'node:test'
|
||||||
|
import assert from 'node:assert/strict'
|
||||||
|
import { fileURLToPath } from 'node:url'
|
||||||
|
|
||||||
|
const __dirname = path.dirname(fileURLToPath(import.meta.url))
|
||||||
|
const repoRoot = path.resolve(__dirname, '..', '..')
|
||||||
|
const frontendRoot = path.join(repoRoot, 'frontend')
|
||||||
|
const standaloneRoot = path.join(frontendRoot, 'standalone-web', 'src')
|
||||||
|
const app = fs.readFileSync(path.join(standaloneRoot, 'App.vue'), 'utf8')
|
||||||
|
const navigation = fs.readFileSync(path.join(standaloneRoot, 'features', 'navigation', 'navigation-config.ts'), 'utf8')
|
||||||
|
const workbenchStyles = fs.readFileSync(path.join(standaloneRoot, 'styles', 'workbench.css'), 'utf8')
|
||||||
|
const bridge = fs.readFileSync(path.join(frontendRoot, 'shared', 'api', 'astrbot-page-bridge.ts'), 'utf8')
|
||||||
|
|
||||||
|
const views = ['overview', 'generate', 'queue', 'performance', 'gallery', 'profiles', 'materials', 'settings', 'logs']
|
||||||
|
|
||||||
|
test('UI shell keeps all supported views and landmarks', () => {
|
||||||
|
for (const view of views) assert.match(navigation, new RegExp('key: \"' + view + '\"'), 'missing nav view: ' + view)
|
||||||
|
assert.match(app, /<main\s+[\s\S]*aria-label=\"ImageStudio workbench\"/)
|
||||||
|
assert.match(app, /<section class=\"workbench\" aria-label=\"ImageStudio workspace\">/)
|
||||||
|
assert.match(app, /role=\"status\"[\s\S]*aria-live=\"polite\"/)
|
||||||
|
})
|
||||||
|
|
||||||
|
test('UI shell preserves plugin bridge and lazy page loading', () => {
|
||||||
|
assert.match(app, /defineAsyncComponent\(\(\) => import\(\"\.\/features\/gallery\/GalleryPage\.vue\"\)\)/)
|
||||||
|
assert.match(app, /defineAsyncComponent\(\(\) => import\(\"\.\/features\/settings\/SettingsPage\.vue\"\)\)/)
|
||||||
|
assert.match(app, /defineAsyncComponent\(\(\) => import\(\"\.\/features\/workflow\/WorkflowComposer\.vue\"\)\)/)
|
||||||
|
assert.match(bridge, /kind: \"ready\"/)
|
||||||
|
assert.match(bridge, /message.kind === \"context\"/)
|
||||||
|
assert.match(bridge, /apiGet/)
|
||||||
|
assert.match(bridge, /apiPost/)
|
||||||
|
})
|
||||||
|
|
||||||
|
test('UI CSS avoids layout-property animation and supports reduced motion', () => {
|
||||||
|
assert.doesNotMatch(workbenchStyles, /transition\s*:\s*[^;]*(?:width|height|max-height|grid-template-columns|padding|margin)/i)
|
||||||
|
assert.match(workbenchStyles, /@media \(max-width: 1180px\)/)
|
||||||
|
assert.match(workbenchStyles, /@media \(max-width: 900px\)/)
|
||||||
|
assert.match(workbenchStyles, /@media \(prefers-reduced-motion: reduce\)/)
|
||||||
|
assert.match(workbenchStyles, /--ui-focus-ring/)
|
||||||
|
})
|
||||||
|
|
||||||
|
test('standalone image markup provides alt text', () => {
|
||||||
|
const files = []
|
||||||
|
const visit = (dir) => {
|
||||||
|
for (const entry of fs.readdirSync(dir, { withFileTypes: true })) {
|
||||||
|
const fullPath = path.join(dir, entry.name)
|
||||||
|
if (entry.isDirectory()) visit(fullPath)
|
||||||
|
else if (entry.name.endsWith('.vue')) files.push(fullPath)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
visit(standaloneRoot)
|
||||||
|
for (const file of files) {
|
||||||
|
const source = fs.readFileSync(file, 'utf8')
|
||||||
|
for (const tag of source.match(/<img\b[\s\S]*?>/gi) ?? []) {
|
||||||
|
assert.match(tag, /\balt\s*=/i, 'image without alt: ' + path.relative(repoRoot, file))
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
@ -0,0 +1,50 @@
|
||||||
|
import fs from 'node:fs'
|
||||||
|
import path from 'node:path'
|
||||||
|
import test from 'node:test'
|
||||||
|
import assert from 'node:assert/strict'
|
||||||
|
import { fileURLToPath } from 'node:url'
|
||||||
|
|
||||||
|
const __dirname = path.dirname(fileURLToPath(import.meta.url))
|
||||||
|
const repoRoot = path.resolve(__dirname, '..', '..')
|
||||||
|
const tokens = fs.readFileSync(path.join(repoRoot, 'frontend', 'standalone-web', 'src', 'styles', 'tokens.css'), 'utf8')
|
||||||
|
const workbench = fs.readFileSync(path.join(repoRoot, 'frontend', 'standalone-web', 'src', 'styles', 'workbench.css'), 'utf8')
|
||||||
|
const app = fs.readFileSync(path.join(repoRoot, 'frontend', 'standalone-web', 'src', 'App.vue'), 'utf8')
|
||||||
|
|
||||||
|
const requiredTokens = [
|
||||||
|
'--ui-space-1', '--ui-space-2', '--ui-space-3', '--ui-space-4', '--ui-space-5', '--ui-space-6',
|
||||||
|
'--ui-radius-sm', '--ui-radius-md', '--ui-radius-lg', '--ui-focus-ring', '--ui-duration-fast',
|
||||||
|
]
|
||||||
|
|
||||||
|
test('visual tokens remain centralized', () => {
|
||||||
|
for (const token of requiredTokens) assert.match(tokens, new RegExp(`${token}:`), `missing token ${token}`)
|
||||||
|
assert.match(workbench, /var\(--ui-radius-md\)/)
|
||||||
|
assert.match(workbench, /var\(--ui-radius-lg\)/)
|
||||||
|
assert.doesNotMatch(workbench, /#[0-9a-f]{6}\b/i)
|
||||||
|
})
|
||||||
|
|
||||||
|
test('semantic states retain readable borders', () => {
|
||||||
|
for (const state of ['good', 'warn', 'bad', 'disabled']) {
|
||||||
|
assert.match(`${workbench}\n${app}`, new RegExp(`\\.${state}`), `missing ${state} state styling`)
|
||||||
|
}
|
||||||
|
assert.match(workbench, /color-mix\(in srgb, var\(--danger\)/)
|
||||||
|
assert.match(workbench, /color-mix\(in srgb, var\(--warn\)/)
|
||||||
|
})
|
||||||
|
|
||||||
|
function luminance(hex) {
|
||||||
|
const values = hex.match(/[0-9a-f]{2}/gi).map((value) => Number.parseInt(value, 16) / 255)
|
||||||
|
const linear = values.map((value) => value <= 0.03928 ? value / 12.92 : ((value + 0.055) / 1.055) ** 2.4)
|
||||||
|
return 0.2126 * linear[0] + 0.7152 * linear[1] + 0.0722 * linear[2]
|
||||||
|
}
|
||||||
|
|
||||||
|
function contrastRatio(first, second) {
|
||||||
|
const firstLuminance = luminance(first)
|
||||||
|
const secondLuminance = luminance(second)
|
||||||
|
return (Math.max(firstLuminance, secondLuminance) + 0.05) / (Math.min(firstLuminance, secondLuminance) + 0.05)
|
||||||
|
}
|
||||||
|
|
||||||
|
test('dark and light text tokens meet AA contrast targets', () => {
|
||||||
|
assert.ok(contrastRatio('#edf4fb', '#111522') >= 4.5)
|
||||||
|
assert.ok(contrastRatio('#9aa8ba', '#111522') >= 4.5)
|
||||||
|
assert.ok(contrastRatio('#18202b', '#f3f6fb') >= 4.5)
|
||||||
|
assert.ok(contrastRatio('#667085', '#f3f6fb') >= 4.5)
|
||||||
|
})
|
||||||
|
|
@ -2,7 +2,7 @@ name: astrbot_plugin_imagestudio
|
||||||
display_name: ImageStudio
|
display_name: ImageStudio
|
||||||
desc: AstrBot >=4.25 ImageStudio role asset and image-generation workspace for Windows, Linux, macOS and Docker.
|
desc: AstrBot >=4.25 ImageStudio role asset and image-generation workspace for Windows, Linux, macOS and Docker.
|
||||||
short_desc: AstrBot 鍐呯殑瑙掕壊璧勪骇銆佸伐浣滄祦涓庡浘鐗囩敓鎴愮鐞嗗伐浣滃彴銆?
|
short_desc: AstrBot 鍐呯殑瑙掕壊璧勪骇銆佸伐浣滄祦涓庡浘鐗囩敓鎴愮鐞嗗伐浣滃彴銆?
|
||||||
version: 1.0.65
|
version: 1.0.66
|
||||||
author: YokiiroBW
|
author: YokiiroBW
|
||||||
repo: "http://192.168.31.210:18085/YokiiroBW/astrbot_plugin_imagestudio"
|
repo: "http://192.168.31.210:18085/YokiiroBW/astrbot_plugin_imagestudio"
|
||||||
astrbot_version: ">=4.25.0,<5"
|
astrbot_version: ">=4.25.0,<5"
|
||||||
|
|
|
||||||
文件差异因一行或多行过长而隐藏
文件差异因一行或多行过长而隐藏
文件差异因一行或多行过长而隐藏
文件差异因一行或多行过长而隐藏
|
|
@ -4,8 +4,8 @@
|
||||||
<meta charset="UTF-8" />
|
<meta charset="UTF-8" />
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||||
<title>AstrBot ImageStudio</title>
|
<title>AstrBot ImageStudio</title>
|
||||||
<script type="module" crossorigin src="./assets/index-DeH0Kig6.js"></script>
|
<script type="module" crossorigin src="./assets/index-BZ25rUbw.js"></script>
|
||||||
<link rel="stylesheet" crossorigin href="./assets/index-Bw79A5u9.css">
|
<link rel="stylesheet" crossorigin href="./assets/index-B8Z-z8zX.css">
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<div id="app"></div>
|
<div id="app"></div>
|
||||||
|
|
|
||||||
|
|
@ -24,8 +24,11 @@ from backend.services.advanced_style_set_service import (
|
||||||
_normalize_artist_signature,
|
_normalize_artist_signature,
|
||||||
_normalize_style_deltas,
|
_normalize_style_deltas,
|
||||||
_normalize_style_dimension_scores,
|
_normalize_style_dimension_scores,
|
||||||
|
_normalize_rendering_layer_scores,
|
||||||
|
_normalized_feature_evidence,
|
||||||
_scale_specific_style_prompt,
|
_scale_specific_style_prompt,
|
||||||
_scale_transfer_instruction,
|
_scale_transfer_instruction,
|
||||||
|
_style_attempt_comparison,
|
||||||
_sanitize_validation_content,
|
_sanitize_validation_content,
|
||||||
_validation_cases,
|
_validation_cases,
|
||||||
_weighted_style_fidelity_score,
|
_weighted_style_fidelity_score,
|
||||||
|
|
@ -1721,5 +1724,50 @@ class AdvancedStyleSetWorkflowTests(unittest.TestCase):
|
||||||
)
|
)
|
||||||
self.assertEqual([item["dimension"] for item in signature], ["linework"])
|
self.assertEqual([item["dimension"] for item in signature], ["linework"])
|
||||||
|
|
||||||
|
def test_core_evidence_requires_cross_context_support_when_declared(self) -> None:
|
||||||
|
evidence = _normalized_feature_evidence([
|
||||||
|
{
|
||||||
|
"trait": "distinct lavender shadow bands",
|
||||||
|
"support_ratio": 1.0,
|
||||||
|
"confidence": 0.95,
|
||||||
|
"cross_role_support": True,
|
||||||
|
"cross_scene_support": False,
|
||||||
|
"cross_palette_support": True,
|
||||||
|
}
|
||||||
|
])
|
||||||
|
self.assertFalse(evidence[0]["supported"])
|
||||||
|
self.assertFalse(evidence[0]["cross_context_supported"])
|
||||||
|
|
||||||
|
def test_review_layer_scores_are_normalized_separately_from_global_palette(self) -> None:
|
||||||
|
layers = _normalize_rendering_layer_scores({
|
||||||
|
"character_linework": 0.9,
|
||||||
|
"figure_coloring": 0.7,
|
||||||
|
"background_palette": 0.4,
|
||||||
|
"effect_interference": 0.2,
|
||||||
|
})
|
||||||
|
self.assertEqual(layers["character_linework"], 0.9)
|
||||||
|
self.assertEqual(layers["character_coloring"], 0.7)
|
||||||
|
self.assertEqual(layers["background_color"], 0.4)
|
||||||
|
self.assertEqual(layers["optical_effect_interference"], 0.2)
|
||||||
|
|
||||||
|
def test_regressed_case_blocks_automatic_candidate_adoption(self) -> None:
|
||||||
|
def case(key: str, score: float) -> SimpleNamespace:
|
||||||
|
return SimpleNamespace(
|
||||||
|
case_id=key,
|
||||||
|
case_key=key,
|
||||||
|
fidelity_score=score,
|
||||||
|
style_review={"status": "succeeded", "fidelity_score": score, "dimension_scores": {}},
|
||||||
|
)
|
||||||
|
current = SimpleNamespace(attempt_id="new", fidelity_score=0.82)
|
||||||
|
previous = SimpleNamespace(attempt_id="old", fidelity_score=0.80)
|
||||||
|
comparison = _style_attempt_comparison(
|
||||||
|
current_attempt=current,
|
||||||
|
current_cases=[case("portrait", 0.85), case("fullbody", 0.70), case("novel_scene", 0.91)],
|
||||||
|
previous_attempt=previous,
|
||||||
|
previous_cases=[case("portrait", 0.80), case("fullbody", 0.80), case("novel_scene", 0.80)],
|
||||||
|
)
|
||||||
|
self.assertEqual(comparison["recommendation"], "keep_previous_candidate")
|
||||||
|
self.assertIn("fullbody", comparison["scenario_regressions"])
|
||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
unittest.main()
|
unittest.main()
|
||||||
|
|
|
||||||
文件差异因一行或多行过长而隐藏
文件差异因一行或多行过长而隐藏
57
web/assets/index-EHiWqZav.js
普通文件
57
web/assets/index-EHiWqZav.js
普通文件
文件差异因一行或多行过长而隐藏
文件差异因一行或多行过长而隐藏
|
|
@ -4,8 +4,8 @@
|
||||||
<meta charset="UTF-8" />
|
<meta charset="UTF-8" />
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||||
<title>AstrBot ImageStudio</title>
|
<title>AstrBot ImageStudio</title>
|
||||||
<script type="module" crossorigin src="/api/v1/plugins/extensions/astrbot_plugin_imagestudio/web/assets/index-BE0GnfZC.js"></script>
|
<script type="module" crossorigin src="/api/v1/plugins/extensions/astrbot_plugin_imagestudio/web/assets/index-EHiWqZav.js"></script>
|
||||||
<link rel="stylesheet" crossorigin href="/api/v1/plugins/extensions/astrbot_plugin_imagestudio/web/assets/index-BqAqEWbf.css">
|
<link rel="stylesheet" crossorigin href="/api/v1/plugins/extensions/astrbot_plugin_imagestudio/web/assets/index-Fxlc51Vo.css">
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<div id="app"></div>
|
<div id="app"></div>
|
||||||
|
|
|
||||||
正在加载…
添加表格
在新工单中引用