refactor(chat): remove UUID generation and update HomePage to use NewChatBootstrap

Merged
AH
6mo ago
+17-17

This commit eliminates the server-side UUID generation in Home and updates the HomePage component to use NewChatBootstrap instead of Chat. The changes streamline the chat initialization process by relying on the NewChatBootstrap for session management and message provisioning.


Summary by cubic

Replaced direct Chat mount with NewChatBootstrap, removed server-side UUIDs, and added legacy auto-login for non-bootstrap chat routes. This centralizes chat bootstrap and ensures auth so sessionId and chatId are ready before rendering.

  • Refactors

    • Removed generateUUID and id prop from app/page.tsx and HomePage.
    • Updated HomePage to render NewChatBootstrap with initialMessages.
    • Added useAutoLogin() in NewChatBootstrap to ensure auth before chat init.
  • New Features

    • Introduced LegacyAutoLogin in Chat to prompt sign-in when sessionId is missing on legacy mounts.

Summary by CodeRabbit

  • New Features

    • Integrated automatic login functionality into the new chat initialization flow, improving the session start experience.
  • Refactor

    • Streamlined chat component initialization process by restructuring internal component dependencies.

Review Change Stack