feat: add session resume capability with automatic continuation

Add ability to resume inactive sessions and automatically continue with new
session ID. Includes message merging for preserving conversation history,
UI improvements to allow sending during inactive state, and database schema
migration. close #87
This commit is contained in:
weishu
2026-01-27 14:44:53 +08:00
parent 7a8f1c3e87
commit 87c79c3b94
24 changed files with 534 additions and 70 deletions
@@ -266,6 +266,8 @@ export function HappyThread(props: {
prevLoadingMoreRef.current = props.isLoadingMoreMessages
}, [props.isLoadingMoreMessages])
const showSkeleton = props.isLoadingMessages && props.rawMessagesCount === 0 && props.pendingCount === 0
return (
<HappyChatProvider value={{
api: props.api,
@@ -280,7 +282,7 @@ export function HappyThread(props: {
<div ref={viewportRef} className="min-h-0 flex-1 overflow-y-auto overflow-x-hidden">
<div className="mx-auto w-full max-w-content min-w-0 p-3">
<div ref={topSentinelRef} className="h-px w-full" aria-hidden="true" />
{props.isLoadingMessages ? (
{showSkeleton ? (
<MessageSkeleton />
) : (
<>