Fix Timeline tab: follow link to read connected positive_prompt node

widgetByName returns nothing when the input is connected. Traverse the
graph link to the source node and read its first widget value instead.
Also fix custom_map always being empty when refinement_key is set.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
digital-garbage
2026-05-27 02:20:49 +03:00
co-authored by Claude Sonnet 4.6
parent efba52d951
commit e680cc8d6a
2 changed files with 16 additions and 2 deletions
+1 -1
View File
@@ -1556,7 +1556,7 @@ async def funpack_parse_timeline(request):
data = await request.json()
prompt = str(data.get("prompt") or "")
refinement_key = str(data.get("refinement_key") or "")
custom_map = load_custom_transition_triggers() if not refinement_key else {}
custom_map = load_custom_transition_triggers()
try:
from .conditioning import parse_timeline_segments
except ImportError:
+15 -1
View File
@@ -1239,8 +1239,22 @@ function openPanel(node) {
}
// ── Timeline ───────────────────────────────────────────────────────────────
function resolveInputValue(n, inputName) {
const w = widgetByName(n, inputName);
if (w) return String(w.value || "");
const idx = (n.inputs || []).findIndex(i => i.name === inputName);
if (idx === -1) return "";
const linkId = n.inputs[idx].link;
if (!linkId) return "";
const link = app.graph?.links?.[linkId];
if (!link) return "";
const src = app.graph.getNodeById(link.origin_id);
if (!src) return "";
return String(src.widgets?.[0]?.value || "");
}
async function renderTimeline() {
const prompt = String(widgetByName(node, "positive_prompt")?.value || "").trim();
const prompt = resolveInputValue(node, "positive_prompt").trim();
if (!prompt) {
body.append(el("div", "funpack-studio-hint", "No prompt — type or connect a positive_prompt to preview the timeline."));
return;