chore: snapshot WIP previo + flow 0008 + 7 sub-issues (0112-0119)
Snapshot de WIP acumulado de sesiones previas antes de merge wave 1 del flow 0008 (kanban_cpp + agent_runner_api + DoD schema). Incluye: - dev/flows/0008-kanban-cpp-and-agent-workflows.md - dev/issues/0112-0119*.md (7 sub-issues) - WIP previo en cmd/fn/doctor.go, registry/*, modules/, cpp/, etc. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -15,11 +15,19 @@ import sys
|
||||
from pathlib import Path
|
||||
from typing import Any
|
||||
|
||||
from infra.generate_app_icon import _find_registry_root, _make_icon_image
|
||||
from infra.generate_app_icon import (
|
||||
_find_registry_root,
|
||||
_make_icon_image,
|
||||
_make_icon_image_adaptive,
|
||||
_make_icon_image_duotone,
|
||||
WHITE_DUOTONE_GLYPH,
|
||||
)
|
||||
|
||||
DEFAULT_PHOSPHOR = "app-window"
|
||||
DEFAULT_ACCENT = "#64748b"
|
||||
DEFAULT_SIZE = 64
|
||||
DEFAULT_STYLE = "fill_white"
|
||||
VALID_STYLES = ("fill_white", "adaptive_duotone", "white_duotone")
|
||||
|
||||
|
||||
def _read_frontmatter(md_path: Path) -> dict[str, Any]:
|
||||
@@ -46,6 +54,7 @@ def export_hub_icons(
|
||||
*,
|
||||
size: int = DEFAULT_SIZE,
|
||||
registry_root: str | None = None,
|
||||
style: str = DEFAULT_STYLE,
|
||||
) -> dict:
|
||||
"""Rasteriza iconos PNG para todas las apps C++/imgui del registry.
|
||||
|
||||
@@ -76,6 +85,9 @@ def export_hub_icons(
|
||||
]
|
||||
}
|
||||
"""
|
||||
if style not in VALID_STYLES:
|
||||
raise ValueError(f"style invalido: {style!r}. Valores: {' | '.join(VALID_STYLES)}")
|
||||
|
||||
root = _find_registry_root(registry_root)
|
||||
|
||||
db_path = root / "registry.db"
|
||||
@@ -128,17 +140,30 @@ def export_hub_icons(
|
||||
phosphor_name = DEFAULT_PHOSPHOR
|
||||
accent_hex = DEFAULT_ACCENT
|
||||
|
||||
# --- Localizar SVG Phosphor ---
|
||||
svg_path = phosphor_assets / "fill" / f"{phosphor_name}-fill.svg"
|
||||
if not svg_path.exists():
|
||||
msg = f"Phosphor SVG not found: {svg_path}"
|
||||
print(f"[export_hub_icons] SKIP {app_name}: {msg}", file=sys.stderr)
|
||||
skipped.append({"name": app_name, "reason": msg})
|
||||
continue
|
||||
# --- Localizar SVG Phosphor (duotone preferido si style lo necesita) ---
|
||||
svg_fill = phosphor_assets / "fill" / f"{phosphor_name}-fill.svg"
|
||||
svg_duo = phosphor_assets / "duotone" / f"{phosphor_name}-duotone.svg"
|
||||
if style == "fill_white":
|
||||
if not svg_fill.exists():
|
||||
msg = f"Phosphor SVG not found: {svg_fill}"
|
||||
print(f"[export_hub_icons] SKIP {app_name}: {msg}", file=sys.stderr)
|
||||
skipped.append({"name": app_name, "reason": msg})
|
||||
continue
|
||||
else:
|
||||
if not svg_duo.exists() and not svg_fill.exists():
|
||||
msg = f"Phosphor SVG not found: {svg_duo} ni {svg_fill}"
|
||||
print(f"[export_hub_icons] SKIP {app_name}: {msg}", file=sys.stderr)
|
||||
skipped.append({"name": app_name, "reason": msg})
|
||||
continue
|
||||
|
||||
# --- Rasterizar y guardar PNG ---
|
||||
try:
|
||||
img = _make_icon_image(svg_path, accent_hex, size)
|
||||
if style == "fill_white":
|
||||
img = _make_icon_image(svg_fill, accent_hex, size)
|
||||
elif style == "adaptive_duotone":
|
||||
img = _make_icon_image_adaptive(phosphor_name, accent_hex, size, phosphor_assets)
|
||||
else: # white_duotone
|
||||
img = _make_icon_image_duotone(phosphor_name, accent_hex, size, phosphor_assets, WHITE_DUOTONE_GLYPH)
|
||||
png_out = out_path / f"{app_name}.png"
|
||||
img.save(str(png_out), format="PNG")
|
||||
count += 1
|
||||
@@ -175,11 +200,18 @@ if __name__ == "__main__":
|
||||
default=None,
|
||||
help="Path to fn_registry root (default: FN_REGISTRY_ROOT env or /home/lucas/fn_registry)",
|
||||
)
|
||||
parser.add_argument(
|
||||
"--style",
|
||||
default=DEFAULT_STYLE,
|
||||
choices=VALID_STYLES,
|
||||
help=f"Estilo del icono (default {DEFAULT_STYLE})",
|
||||
)
|
||||
args = parser.parse_args()
|
||||
|
||||
result = export_hub_icons(
|
||||
args.out_dir,
|
||||
size=args.size,
|
||||
registry_root=args.registry_root,
|
||||
style=args.style,
|
||||
)
|
||||
print(json.dumps(result, indent=2))
|
||||
|
||||
Reference in New Issue
Block a user