Spaces:
Running on Zero
Running on Zero
fix: refresh evidence when selecting ideas
Browse filesCo-authored-by: Codex <noreply@openai.com>
- static/app.js +34 -16
static/app.js
CHANGED
|
@@ -681,22 +681,8 @@ function selectIdea(ideaId) {
|
|
| 681 |
if (Array.isArray(idea.goals) && idea.goals.length) {
|
| 682 |
session.goals = goalOptions.filter((option) => idea.goals.includes(option));
|
| 683 |
}
|
| 684 |
-
|
| 685 |
-
|
| 686 |
-
setVerdictDisplay(score.verdict || "DRAFT", score.overall || 0, score);
|
| 687 |
-
renderScore(score);
|
| 688 |
-
ink.classList.toggle("bleed", String(score.verdict || "").startsWith("ECHO"));
|
| 689 |
-
ink.classList.toggle("gold", String(score.verdict || "").startsWith("UNWRITTEN"));
|
| 690 |
-
}
|
| 691 |
-
if (session.last_artifact?.title === idea.title) {
|
| 692 |
-
currentArtifact = session.last_artifact;
|
| 693 |
-
renderWoodMap(currentArtifact.wood_map || null);
|
| 694 |
-
exportButton.disabled = false;
|
| 695 |
-
} else {
|
| 696 |
-
currentArtifact = null;
|
| 697 |
-
renderWoodMap(null);
|
| 698 |
-
exportButton.disabled = true;
|
| 699 |
-
}
|
| 700 |
renderGoals(session.goals || []);
|
| 701 |
renderIdeas(session.ideas);
|
| 702 |
renderPlan([]);
|
|
@@ -705,6 +691,38 @@ function selectIdea(ideaId) {
|
|
| 705 |
saveSession();
|
| 706 |
}
|
| 707 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 708 |
function goalDisplayName(goal) {
|
| 709 |
return goalProfileById.get(goal)?.label || goal;
|
| 710 |
}
|
|
|
|
| 681 |
if (Array.isArray(idea.goals) && idea.goals.length) {
|
| 682 |
session.goals = goalOptions.filter((option) => idea.goals.includes(option));
|
| 683 |
}
|
| 684 |
+
renderSelectedIdeaSeal(idea);
|
| 685 |
+
renderSelectedIdeaArtifact(idea);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 686 |
renderGoals(session.goals || []);
|
| 687 |
renderIdeas(session.ideas);
|
| 688 |
renderPlan([]);
|
|
|
|
| 691 |
saveSession();
|
| 692 |
}
|
| 693 |
|
| 694 |
+
function renderSelectedIdeaSeal(idea) {
|
| 695 |
+
const score = idea?.score || null;
|
| 696 |
+
if (!score) {
|
| 697 |
+
renderScore(null);
|
| 698 |
+
setVerdictDisplay("READY", 0, null);
|
| 699 |
+
ink.classList.remove("bleed", "gold");
|
| 700 |
+
renderProjects([], "Score this idea to see nearby echoes.");
|
| 701 |
+
return;
|
| 702 |
+
}
|
| 703 |
+
setVerdictDisplay(score.verdict || "DRAFT", score.overall || 0, score);
|
| 704 |
+
renderScore(score);
|
| 705 |
+
ink.classList.toggle("bleed", String(score.verdict || "").startsWith("ECHO"));
|
| 706 |
+
ink.classList.toggle("gold", String(score.verdict || "").startsWith("UNWRITTEN"));
|
| 707 |
+
if (score.echoes?.length) {
|
| 708 |
+
renderCitations(score.echoes);
|
| 709 |
+
} else {
|
| 710 |
+
renderProjects([]);
|
| 711 |
+
}
|
| 712 |
+
}
|
| 713 |
+
|
| 714 |
+
function renderSelectedIdeaArtifact(idea) {
|
| 715 |
+
if (session.last_artifact?.title === idea.title) {
|
| 716 |
+
currentArtifact = session.last_artifact;
|
| 717 |
+
renderWoodMap(currentArtifact.wood_map || null);
|
| 718 |
+
exportButton.disabled = false;
|
| 719 |
+
return;
|
| 720 |
+
}
|
| 721 |
+
currentArtifact = null;
|
| 722 |
+
renderWoodMap(null);
|
| 723 |
+
exportButton.disabled = true;
|
| 724 |
+
}
|
| 725 |
+
|
| 726 |
function goalDisplayName(goal) {
|
| 727 |
return goalProfileById.get(goal)?.label || goal;
|
| 728 |
}
|