mirror of
https://github.com/paperclipai/paperclip.git
synced 2026-10-28 12:04:41 +01:00
Fix assistant chat preset composer hint
This commit is contained in:
1 parent
e16b1de5d0
commit
95415e2999
2 files changed
+23
-3
No files matched your search
@@ -73,7 +73,11 @@ vi.mock("./IssueChatThread", async () => {
|
||||
<span data-testid="status-notices">
|
||||
{(props.suppressIssueStatusNotices ?? props.preset === "assistant") ? "suppressed" : "visible"}
|
||||
</span>
|
||||
<span data-testid="composer-hint">{props.composerHint}</span>
|
||||
<span data-testid="composer-hint">
|
||||
{props.composerHint === undefined && props.preset === "assistant"
|
||||
? "Enter to send · Shift+Enter for a new line"
|
||||
: props.composerHint}
|
||||
</span>
|
||||
<span data-testid="image-upload-enabled">{String(Boolean(props.imageUploadHandler))}</span>
|
||||
<span data-testid="attach-enabled">{String(Boolean(props.onAttachImage))}</span>
|
||||
<span data-testid="composer-draft">{draft}</span>
|
||||
@@ -471,6 +475,22 @@ describe("AssistantChatView", () => {
|
||||
);
|
||||
});
|
||||
|
||||
it("allows the assistant preset default composer hint when no custom hint is provided", () => {
|
||||
render(
|
||||
<AssistantChatView
|
||||
agents={[ceo]}
|
||||
targetAgentId={ceo.id}
|
||||
comments={[]}
|
||||
starterPrompts={[]}
|
||||
onSend={async () => {}}
|
||||
/>,
|
||||
);
|
||||
|
||||
expect(container.querySelector('[data-testid="composer-hint"]')?.textContent).toBe(
|
||||
"Enter to send · Shift+Enter for a new line",
|
||||
);
|
||||
});
|
||||
|
||||
it("renders assistant starter prompts without the large start-message placeholder", () => {
|
||||
render(
|
||||
<AssistantChatView
|
||||
|
||||
@@ -291,7 +291,7 @@ export function AssistantChatView({
|
||||
header,
|
||||
starterPrompts: providedStarterPrompts,
|
||||
emptyState: providedEmptyState,
|
||||
composerHint = null,
|
||||
composerHint,
|
||||
imageUploadHandler,
|
||||
onAttachImage,
|
||||
loading = false,
|
||||
@@ -790,7 +790,7 @@ export function AssistantChat({
|
||||
header={header}
|
||||
starterPrompts={starterPrompts}
|
||||
emptyState={emptyState}
|
||||
composerHint={hasOpenBackgroundWork ? "Ask me anything while I work on this." : null}
|
||||
composerHint={hasOpenBackgroundWork ? "Ask me anything while I work on this." : undefined}
|
||||
imageUploadHandler={handleImageUpload}
|
||||
onAttachImage={handleAttachFile}
|
||||
loading={commentsQuery.isLoading}
|
||||
|
||||
Reference in new issue
Block a user