feat(webui): show forked history boundary
This commit is contained in:
+11
-2
@@ -29,6 +29,7 @@ import {
|
||||
loadSavedSecret,
|
||||
saveSecret,
|
||||
} from "@/lib/bootstrap";
|
||||
import { displayTitle } from "@/lib/chat-groups";
|
||||
import { deriveTitle } from "@/lib/format";
|
||||
import { NanobotClient } from "@/lib/nanobot-client";
|
||||
import { ClientProvider, useClient } from "@/providers/ClientProvider";
|
||||
@@ -890,7 +891,15 @@ function Shell({
|
||||
beforeUserIndex: number,
|
||||
) => {
|
||||
try {
|
||||
const chatId = await forkChat(sourceChatId, beforeUserIndex);
|
||||
const sourceSession = sessions.find((session) => session.chatId === sourceChatId);
|
||||
const sourceTitle = sourceSession
|
||||
? displayTitle(sourceSession, sidebarState.title_overrides, t("chat.newChat"))
|
||||
: t("chat.newChat");
|
||||
const chatId = await forkChat(
|
||||
sourceChatId,
|
||||
beforeUserIndex,
|
||||
t("chat.forkTitle", { title: sourceTitle }),
|
||||
);
|
||||
navigate({
|
||||
view: "chat",
|
||||
activeKey: `websocket:${chatId}`,
|
||||
@@ -902,7 +911,7 @@ function Shell({
|
||||
console.error("Failed to fork chat", e);
|
||||
return null;
|
||||
}
|
||||
}, [forkChat, navigate]);
|
||||
}, [forkChat, navigate, sessions, sidebarState.title_overrides, t]);
|
||||
|
||||
const onNewChat = useCallback(() => {
|
||||
navigate(defaultShellRoute());
|
||||
|
||||
Reference in New Issue
Block a user