feat(chat): enhance chat component with workflowChatId and isBootstrapPreparing props
This update introduces two new props, workflowChatId and isBootstrapPreparing, to the Chat component, improving the handling of chat sessions. The workflowChatId is used for workflow transport when the chat ID is a client placeholder, while isBootstrapPreparing indicates when session provisioning is in progress. Additionally, the ChatInput component now disables message sending during bootstrap preparation, enhancing user experience. The NewChatBootstrap component has been updated to manage these new props effectively.
Summary by cubic
Enable parallel new‑chat bootstrap with workflowChatId and isBootstrapPreparing; the chat UI renders immediately with a placeholder ID and blocks send until the session is ready. Also simplifies the provider with a new useVercelChatProviderValue hook and keeps session‑based chat APIs.
-
New Features
NewChatBootstrapmounts<Chat>with a client placeholder ID and passesworkflowChatId/isBootstrapPreparingviaisNewChatBootstrapPreparing.useVercelChatusestransportChatId = workflowChatId ?? idfor transport, initial message load, and URL; defers the first send until auth andsessionIdexist.ChatInputdisables send and shows “Preparing…” during bootstrap.
-
Refactors
- Centralized auto‑login in
UserProvider; removeduseAutoLoginacross pages/components. - Extracted
VercelChatContextanduseVercelChatProviderValue;VercelChatProvidernow passesisBootstrapPreparing. - Always clear attachments after send (finally), removed a redundant reload wrapper, and kept session‑based delete/rename APIs.
- Centralized auto‑login in
Summary by CodeRabbit
- New Features
- Chat shows a persistent "Preparing…" status during bootstrap so users know initialization is in progress.
- Submit button is disabled while preparing to prevent sending messages prematurely.
- Chat interface now appears immediately during bootstrap (with temporary session handling) to reduce perceived loading time.