fix(home): prefetch the warm snapshot from secondary pages so the first 新建对话 skips the loading ring (BUG-1104)
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01N4f2nya58RoRu4yEmJgRGE
This commit is contained in:
co-authored by
Claude Opus 5.5
parent
b19d0bbf36
commit
fee9ddc8a1
@@ -47,6 +47,7 @@ import { ThemePreferenceMenu } from "@/components/theme-preference-menu";
|
||||
import { UserAvatar } from "@/components/user-avatar";
|
||||
import type { BeamAvatar } from "@/lib/beam-avatar";
|
||||
import { groupSessionsByRecency } from "@/lib/session-groups";
|
||||
import { markNewChatClick } from "@/lib/new-chat-timing";
|
||||
|
||||
export type SidebarAccount = {
|
||||
name: string;
|
||||
@@ -185,6 +186,12 @@ export function AppSidebar({
|
||||
closeDrawer();
|
||||
}
|
||||
|
||||
/** Off `/`: the same drawer close, plus the click mark for new-chat timing (BUG-1104). */
|
||||
function handleNewChatLink() {
|
||||
markNewChatClick();
|
||||
closeDrawer();
|
||||
}
|
||||
|
||||
/* Real links. Leaving `/` used to be a full document load: the whole React
|
||||
tree, the session list and the account went with it, so coming back re-ran
|
||||
the entire bootstrap from zero. `/login` keeps the hard exit —
|
||||
@@ -278,7 +285,7 @@ export function AppSidebar({
|
||||
{showExpandedContent ? <span>{creatingSession ? "正在创建" : "新建对话"}</span> : null}
|
||||
</SidebarMenuButton>
|
||||
) : (
|
||||
<SidebarMenuLink className="new-chat" tooltip="新对话" href={newChatHref()} onClick={closeDrawer}>
|
||||
<SidebarMenuLink className="new-chat" tooltip="新对话" href={newChatHref()} onClick={handleNewChatLink}>
|
||||
<SquarePen size={18} strokeWidth={1.75} aria-hidden="true" />
|
||||
{showExpandedContent ? <span>新建对话</span> : null}
|
||||
</SidebarMenuLink>
|
||||
|
||||
Reference in New Issue
Block a user