Skip to content

Commit 5c58122

Browse files
committed
fix(pi): keep collapsed and multiline dialog titles literal
1 parent b4584da commit 5c58122

3 files changed

Lines changed: 8 additions & 2 deletions

File tree

‎apps/web/src/components/chat/ComposerPendingUserInputPanel.tsx‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import { type RuntimeRequestId, type ScopedThreadRef } from "@t3tools/contracts";
2+
import { decodeHTMLStrict } from "entities";
23
import { memo, use, useEffect, useEffectEvent, useRef, useState } from "react";
34
import { BackgroundThreadContext } from "./backgroundThread";
45
import { useStableCallback } from "~/hooks/useStableCallback";
@@ -204,7 +205,7 @@ const ComposerPendingUserInputCard = memo(function ComposerPendingUserInputCard(
204205
<>
205206
<ComposerBanner.Separator />
206207
<span className="min-w-0 flex-1 truncate text-secondary-label">
207-
{activeQuestion.question}
208+
{decodeHTMLStrict(activeQuestion.question)}
208209
</span>
209210
</>
210211
) : null}

‎packages/provider-pi/src/server/adapter.test.ts‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3354,6 +3354,11 @@ describe("PiAdapterV2", () => {
33543354
question: "Where should this run?\n1&#46; Current branch\n2&#46; New worktree",
33553355
},
33563356
{ placeholder: "1,3; custom answer", title: "Enter a value", question: "Enter a value" },
3357+
{
3358+
placeholder: "",
3359+
title: "Optional release note\n===",
3360+
question: "Optional release note\n&#61;&#61;&#61;",
3361+
},
33573362
])(
33583363
"maps native text input without turning its placeholder into an answer, placeholder=%s",
33593364
({ placeholder, title, question: expectedQuestion }) =>

‎packages/provider-pi/src/server/adapter.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3335,7 +3335,7 @@ function piQuestion(
33353335
.replace(/&/g, "&amp;")
33363336
.replace(/</g, "&lt;")
33373337
.replace(/>/g, "&gt;")
3338-
.replace(/[\\`*_[\]{}()#+.!|~$-]/g, (character) => `&#${character.charCodeAt(0)};`) ||
3338+
.replace(/[\\`*_[\]{}()#+.!|~=$-]/g, (character) => `&#${character.charCodeAt(0)};`) ||
33393339
(method === "select"
33403340
? "Choose an option"
33413341
: method === "editor"

0 commit comments

Comments
 (0)