FN-6125: hide duplicate agent prompts in CE transcript
Remove structured question echoing so CE transcripts only show the user-facing answer flow. - stop rendering stored agent question control records as transcript bubbles while keeping question metadata for answer label lookup - remove the now-unused transcript question styling - update CE transcript tests to assert hidden structured question turns and preserved answer rendering Files changed: plugins/fusion-plugin-compound-engineering/src/dashboard/CeFlow.tsx | 9 --------- plugins/fusion-plugin-compound-engineering/src/dashboard/CompoundEngineeringView.css | 3 --- plugins/fusion-plugin-compound-engineering/src/dashboard/__tests__/CeFlow.test.tsx | 16 ++++++++++++++-- 3 files changed, 14 insertions(+), 14 deletions(-) Fusion-Task-Id: FN-6125 Fusion-Task-Lineage: 5cfec24a-8c46-4983-8fa5-77da821ac0ca
This commit is contained in:
@@ -43,7 +43,6 @@ const BOTTOM_FOLLOW_THRESHOLD_PX = 50;
|
||||
|
||||
type DisplayItem =
|
||||
| { kind: "chat"; role: "user" | "agent"; text: string }
|
||||
| { kind: "qa-question"; question: PlanningQuestion }
|
||||
| { kind: "qa-answer"; question?: PlanningQuestion; response: unknown }
|
||||
| { kind: "activity"; turns: CeActivityTurn[] }
|
||||
| { kind: "complete" };
|
||||
@@ -78,7 +77,6 @@ function parseHistory(history: CeConversationTurn[]): DisplayItem[] {
|
||||
const q = obj.question as PlanningQuestion | undefined;
|
||||
if (q && typeof q.id === "string" && typeof q.question === "string") {
|
||||
questionsById.set(q.id, q);
|
||||
items.push({ kind: "qa-question", question: q });
|
||||
continue;
|
||||
}
|
||||
const activity = obj.activity as { turns?: CeActivityTurn[] } | undefined;
|
||||
@@ -213,13 +211,6 @@ function Transcript({ history }: { history: CeConversationTurn[] }) {
|
||||
<span className="ce-flow-turn-text">{item.text}</span>
|
||||
</li>
|
||||
);
|
||||
case "qa-question":
|
||||
return (
|
||||
<li key={i} className="ce-flow-turn ce-flow-turn-agent ce-flow-turn-question" data-testid="ce-flow-past-question">
|
||||
<span className="ce-flow-turn-role">Agent asked</span>
|
||||
<span className="ce-flow-turn-text">{item.question.question}</span>
|
||||
</li>
|
||||
);
|
||||
case "qa-answer": {
|
||||
const a = formatAnswer(item.response, item.question);
|
||||
return (
|
||||
|
||||
@@ -444,9 +444,6 @@
|
||||
word-break: break-word;
|
||||
font-size: 0.86rem;
|
||||
}
|
||||
.ce-flow-turn-question {
|
||||
border-left: 3px solid var(--todo);
|
||||
}
|
||||
.ce-flow-turn-answer.is-steering {
|
||||
border-left: 3px solid var(--color-warning);
|
||||
}
|
||||
|
||||
@@ -252,20 +252,32 @@ describe("CeFlow — Q&A transcript rendering", () => {
|
||||
];
|
||||
}
|
||||
|
||||
it("renders past questions and answers as bubbles, mapping option ids to labels", () => {
|
||||
it("renders past answers as bubbles, mapping option ids to labels", () => {
|
||||
render(
|
||||
<CeFlow
|
||||
session={makeSession({ status: "active", conversationHistory: historyWith("y") })}
|
||||
onAnswer={vi.fn()}
|
||||
/>,
|
||||
);
|
||||
expect(screen.getByTestId("ce-flow-past-question")).toHaveTextContent("Which path?");
|
||||
expect(screen.queryByTestId("ce-flow-past-question")).not.toBeInTheDocument();
|
||||
// The answer shows the LABEL, not the raw option id.
|
||||
expect(screen.getByTestId("ce-flow-past-answer")).toHaveTextContent("The Y path");
|
||||
// The opening message renders as a plain user bubble.
|
||||
expect(screen.getByText("kick off")).toBeInTheDocument();
|
||||
});
|
||||
|
||||
it("hides structured question turns while preserving option-label lookup for answers", () => {
|
||||
render(
|
||||
<CeFlow
|
||||
session={makeSession({ status: "active", conversationHistory: historyWith("y") })}
|
||||
onAnswer={vi.fn()}
|
||||
/>,
|
||||
);
|
||||
expect(screen.queryByTestId("ce-flow-past-question")).not.toBeInTheDocument();
|
||||
expect(screen.queryByText("Which path?")).not.toBeInTheDocument();
|
||||
expect(screen.getByTestId("ce-flow-past-answer")).toHaveTextContent("The Y path");
|
||||
});
|
||||
|
||||
it("renders {value, comment} answers with the steering comment attached", () => {
|
||||
render(
|
||||
<CeFlow
|
||||
|
||||
Reference in New Issue
Block a user