Skip to content

Commit 4268505

Browse files
Merge pull request #170 from tomtom-forks/work
Work
2 parents cd0c563 + 98f7ab3 commit 4268505

File tree

4 files changed

+936
-945
lines changed

4 files changed

+936
-945
lines changed

components/Chat/ChatInput.tsx

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -229,7 +229,7 @@ export const ChatInput = ({modelId, onSend, onRegenerate, stopConversationRef, t
229229
const messageContent: MessagePart[] = [
230230
{
231231
type: "text",
232-
text: content ? content.replace(/\s+$/, "").replace(/\n{3,}/g, "\n\n") : ""
232+
text: content ? content.replace(/[\x00-\x1F]/g, ".").replace(/\s+$/, "").replace(/\n{3,}/g, "\n\n") : ""
233233
}
234234
]
235235
if (modelId.includes("gpt-4o")) {
@@ -414,7 +414,8 @@ export const ChatInput = ({modelId, onSend, onRegenerate, stopConversationRef, t
414414
</button>
415415
)}
416416

417-
<div className="relative mx-4 flex w-full flex-grow flex-col rounded-md border border-black/10 bg-white shadow-[0_0_10px_rgba(0,0,0,0.10)] dark:border-gray-900/50 dark:bg-[#40414F] dark:text-white dark:shadow-[0_0_15px_rgba(0,0,0,0.10)]">
417+
<div
418+
className="relative mx-4 flex w-full flex-grow flex-col rounded-md border border-black/10 bg-white shadow-[0_0_10px_rgba(0,0,0,0.10)] dark:border-gray-900/50 dark:bg-[#40414F] dark:text-white dark:shadow-[0_0_15px_rgba(0,0,0,0.10)]">
418419
<button
419420
className="absolute left-2 top-2 rounded-sm p-1 text-neutral-800 opacity-60 hover:bg-neutral-200 hover:text-neutral-900 dark:bg-opacity-50 dark:text-neutral-100 dark:hover:text-neutral-200"
420421
onClick={() => setShowPluginSelect(!showPluginSelect)}
@@ -436,7 +437,8 @@ export const ChatInput = ({modelId, onSend, onRegenerate, stopConversationRef, t
436437
title="Browse file"
437438
>
438439
{messageIsStreaming ? (
439-
<div className="h-4 w-4 animate-spin rounded-full border-t-2 border-neutral-800 opacity-60 dark:border-neutral-100"></div>
440+
<div
441+
className="h-4 w-4 animate-spin rounded-full border-t-2 border-neutral-800 opacity-60 dark:border-neutral-100"></div>
440442
) : (
441443
<IconCameraPlus size={18} />
442444
)}
@@ -463,7 +465,7 @@ export const ChatInput = ({modelId, onSend, onRegenerate, stopConversationRef, t
463465
disabled
464466
? t("Please wait {{waitTime}} seconds", {waitTime: retryAfter})
465467
: prompts.length > 0
466-
? t('Type a message or type "/" and some characters to search for a prompt...')
468+
? t("Type a message or type \"/\" and some characters to search for a prompt...")
467469
: t("Type a message...")
468470
}
469471
value={content}
@@ -483,7 +485,8 @@ export const ChatInput = ({modelId, onSend, onRegenerate, stopConversationRef, t
483485
title="Send query"
484486
>
485487
{messageIsStreaming ? (
486-
<div className="h-4 w-4 animate-spin rounded-full border-t-2 border-neutral-800 opacity-60 dark:border-neutral-100"></div>
488+
<div
489+
className="h-4 w-4 animate-spin rounded-full border-t-2 border-neutral-800 opacity-60 dark:border-neutral-100"></div>
487490
) : (
488491
<IconSend size={18} />
489492
)}
@@ -509,7 +512,8 @@ export const ChatInput = ({modelId, onSend, onRegenerate, stopConversationRef, t
509512
)}
510513
</div>
511514
</div>
512-
<div className="flex items-center justify-center px-4 pb-1 pt-3 text-center text-[12px] text-black/50 dark:text-white/50">
515+
<div
516+
className="flex items-center justify-center px-4 pb-1 pt-3 text-center text-[12px] text-black/50 dark:text-white/50">
513517
<a href="https://github.com/rijnb/chatty-server" target="_blank" rel="noreferrer" className="underline">
514518
Chatty
515519
</a>

0 commit comments

Comments
 (0)