Skip to content

Open-source manufacturing ERP, MES and QMS. Quoting, MRP, inventory, shop floor, quality and lot/serial traceability on one Postgres schema, with a REST API and MCP server. Self-host or use Carbon Cloud.

style: remove jankiness with placeholder animation

Brad Barbin8505f4f26260
diff --git a/apps/erp/app/components/Chat/ChatInput.tsx b/apps/erp/app/components/Chat/ChatInput.tsx
index ce5cd0df43..5cf29789f1 100644
--- a/apps/erp/app/components/Chat/ChatInput.tsx
+++ b/apps/erp/app/components/Chat/ChatInput.tsx
@@ -3,6 +3,7 @@ import { useChatActions, useChatId, useChatStatus } from "@ai-sdk-tools/store";
import { cn } from "@carbon/react";
import { forwardRef, useEffect, useRef, useState } from "react";
import { CommandMenu } from "./CommandMenu";
+import { useChatInterface } from "./hooks/useChatInterface";
import { useChatStore } from "./lib/store";
import {
PromptInput,
@@ -58,6 +59,8 @@ export const ChatInput = forwardRef<RecordButtonRef, ChatInputProps>(
});
const isCanvasVisible = !!current;
+ const { isChatPage } = useChatInterface();
+
const {
input,
isWebSearch,
@@ -75,6 +78,11 @@ export const ChatInput = forwardRef<RecordButtonRef, ChatInputProps>(
// Animated placeholder effect
useEffect(() => {
+ if (!isChatPage) {
+ setCurrentPlaceholder("");
+ return;
+ }
+
if (isWebSearch || isRecording || hasMessages) {
setCurrentPlaceholder("Ask anything");
return;
@@ -112,6 +120,7 @@ export const ChatInput = forwardRef<RecordButtonRef, ChatInputProps>(
isWebSearch,
isRecording,
hasMessages,
+ isChatPage,
]);
const handleSubmit = (message: ChatInputMessage) => {