feat(sidebar): build-tag footer + theme auto-pull + × removability + pack badges (#98)
Five user-visible changes to the Kforge Labs sidebar that complete the
dev-sync verification loop and fix theme-mode discovery:
- Build-tag footer at the bottom of the sidebar: `dev <sha> · <time>`
on line 1 (SHA at 13px monospace, the at-a-glance identifier),
italic <scope> on line 2. Reads `web/_dev_build.json` written by
`scripts/sync_to_dev.py --scope "<short scope>"`. Visible-in-app
companion to PR #95's chat-report convention — closes the gap when
the maintainer is juggling parallel sessions and can't tell whether
the browser tab is showing the latest sync. Absent on registry
installs; footer renders empty there.
- Theme/category mode now mirrors repo-mode population: REPOS auto-
pull union user-picks, deduped, with the new auto-pull-hidden set
filtered out. The earlier picks-only design dropped the entire
Koolook pack from theme mode on a stock install, even though those
same nodes appeared in repo mode — silently violating the "my
favorites in two views" mental model. `gatherNodesByTheme` rewritten
to seed from REPOS first, then user picks, with the same
autoCategoryRoots + hidden filtering repo mode uses.
- `×` works on every favorite, including auto-pulled REPOS nodes.
Adds `koolook.autoPullHidden.v1` localStorage Set; `×` on an auto-
pulled row calls `hideAutoPullType(type)` so the next render skips
it. `addToMyPicks` calls `unhideAutoPullType` as a side effect so
re-adding via `+` automatically restores visibility. Same uniform
"remove / bring back" UX whether the node was a user pick or REPOS
auto-pull.
- Pack-name badges restored on theme-mode leaves only. Small dim
`Koolook` / `KJNodes` text on the right of each row, same opacity
as the search-flatten breadcrumb. Memory aid for "where did this
node come from?" Repo mode and search-flatten still skip the badge
(origin is conveyed by tree nesting / breadcrumb prefix).
- `scripts/sync_to_dev.py --scope` flag: extends PR #95's brief-
output design with a JSON artifact (`<target>/web/_dev_build.json`)
carrying commit + timestamp + worktree + scope, which the sidebar
footer fetches on render. Doesn't change the existing one-line
chat-report contract or the `_build_line()` shape.
Tested via dev-sync against the live ComfyUI install:
- Footer renders correctly (`dev afe539e · 2026-05-06 15:38` + scope)
- Image bucket in theme mode now contains Koolook image nodes
- Pack badges visible on theme leaves
- × hides auto-pulled Koolook nodes; toolbar + restores them
CHANGELOG entries added; the prior conflicting [Unreleased] notes
about picks-only theme + pack-badge removal are flagged as superseded
in the new entries (release prep can squash).
Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 4.7
parent
afe539e8dc
commit
a0a8469448
@@ -43,10 +43,12 @@ overwrite files in the target — that's the point.
|
||||
from __future__ import annotations
|
||||
|
||||
import argparse
|
||||
import json
|
||||
import os
|
||||
import shutil
|
||||
import subprocess
|
||||
import sys
|
||||
from datetime import datetime
|
||||
from pathlib import Path
|
||||
|
||||
REPO_ROOT = Path(__file__).resolve().parent.parent
|
||||
@@ -98,6 +100,30 @@ def _build_line() -> str:
|
||||
sha = _get_short_sha() or "unknown"
|
||||
return f"{sha} - {_get_worktree_name()}"
|
||||
|
||||
|
||||
def write_build_info(target: Path, scope: str | None) -> None:
|
||||
"""Drop a tiny JSON next to the sidebar JS so the in-browser footer
|
||||
can render `dev <sha> · <time>` (and an italic <scope> on a second
|
||||
line) — same identifier the chat report quotes, but visible in the
|
||||
running ComfyUI itself. Absent on registry installs (the file is
|
||||
only written by this dev script), so the footer stays empty there.
|
||||
|
||||
Best-effort: missing git → omit `commit` field; no `--scope` → omit
|
||||
`scope`; the timestamp alone is still useful for the maintainer to
|
||||
eyeball "did my last sync land in this browser tab?\""""
|
||||
info: dict[str, str] = {
|
||||
"synced_at": datetime.now().strftime("%Y-%m-%d %H:%M"),
|
||||
"worktree": _get_worktree_name(),
|
||||
}
|
||||
sha = _get_short_sha()
|
||||
if sha:
|
||||
info["commit"] = sha
|
||||
if scope:
|
||||
info["scope"] = scope
|
||||
out = target / "web" / "_dev_build.json"
|
||||
out.parent.mkdir(parents=True, exist_ok=True)
|
||||
out.write_text(json.dumps(info, indent=2) + "\n", encoding="utf-8")
|
||||
|
||||
# Files / dirs ComfyUI actually loads at runtime. Anything outside this
|
||||
# list (CI, docs, .claude/, .github/, .cursor/, CHANGELOG, LICENSE,
|
||||
# pyproject.toml, README, fork manifest YAML, etc.) does not affect what
|
||||
@@ -245,6 +271,21 @@ def main() -> int:
|
||||
"the one-line build summary."
|
||||
),
|
||||
)
|
||||
parser.add_argument(
|
||||
"--scope",
|
||||
type=str,
|
||||
default=None,
|
||||
help=(
|
||||
"Short (≤10 word) description of what this build is about — "
|
||||
"the same scope summary that goes in the chat report's second "
|
||||
"line. Persisted in `web/_dev_build.json` and rendered in the "
|
||||
"Kforge Labs sidebar footer (italic, second line, below the "
|
||||
"`dev <sha> · <time>` identifier) so the maintainer can "
|
||||
"correlate live ComfyUI state with chat history when juggling "
|
||||
"multiple parallel worktree sessions. Optional — when absent, "
|
||||
"the footer renders just identifier + timestamp."
|
||||
),
|
||||
)
|
||||
args = parser.parse_args()
|
||||
|
||||
load_dotenv(REPO_ROOT / ".env")
|
||||
@@ -271,6 +312,8 @@ def main() -> int:
|
||||
# mechanical sync details.
|
||||
print(_build_line())
|
||||
print(f"{verb} {n} entries -> {target}")
|
||||
if not args.dry_run:
|
||||
write_build_info(target, args.scope)
|
||||
return 0
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user