fix(ui): 回答不再折叠,次级页侧栏改真链接并补回头像
Independent Staging Quality Gate / validate (push) Canceled after 8m15s
Independent Staging Quality Gate / publish (push) Canceled after 0s

真机走查第二批:

1. 普通对话的回答,首个 H2 之后的全部内容(带推理的那一半)被
   <details class="answer-detail">「完整分析」默认收起——用户「输出根本
   看不到」。折叠控件与组件文件一并删除,报告层直接渲染进正文。
   技法审计表保留自己的折叠:那是给人核对的证据,不是回复正文。
   product-voice.ts 同步改掉「UI 会折叠」那句,否则模型继续按折叠写。

2. 次级页侧栏点不了头像、头像样式与首页不一致。根因是 R4 的取舍:
   SecondaryShell 共用,但里面挂的是新写的 AppNavRail 而不是 AppSidebar。
   现在 use-nav-rail 也取 avatar,渲染同一个 UserAvatar;页脚改成真链接,
   指向 / —— 账户菜单连着设置弹窗栈,留在那儿,不在这里复制第二份。

3. 「新建对话」整页刷新。原来走 location.assign,现在是 next/link。
   /login 保留硬跳转:它跨鉴权边界,要先存返回目标。

   注意:第一版我改成了 useRouter(),它在 app-router 上下文外会抛
   「invariant expected app router to be mounted」,打红 12 条渲染测试。
   改用 <Link>,静态渲染也安全;折叠态 tooltip 换成原生 title。

测试 3369,fail 仍 31 且与基线逐条一致;四个路由标记不变;
CSS gzip 40,002。

未修:截图里 `## 适合推进 / 需要避开` 被当字面量渲染,是模型输出里
那两个 H2 前面没有换行,属生成层,另记。

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0193vBv6w5MV2cifdTUu9H5P
This commit is contained in:
Jesse_Chen
2026-09-16 08:15:25 +00:00
co-authored by Claude Opus 5
parent 49bc4a8ba1
commit 524015cfc1
7 changed files with 85 additions and 145 deletions
+6
View File
@@ -2,6 +2,8 @@
import { useEffect, useState } from "react";
import type { BeamAvatar } from "@/lib/beam-avatar";
/**
* Read-only nav data for the secondary pages (/chart, /ephemeris, /reports).
*
@@ -23,6 +25,8 @@ export type NavRailAccount = {
readonly name: string;
readonly initial: string;
readonly credits: number;
/** The same beam avatar the chat sidebar draws, so the two footers match. */
readonly avatar: BeamAvatar | null;
};
export type NavRailState = {
@@ -86,6 +90,7 @@ export function useNavRail(): NavRailState {
credits?: unknown;
user?: { email?: unknown };
profile?: { name?: unknown };
avatar?: BeamAvatar | null;
} | null;
const name = typeof body?.profile?.name === "string" ? body.profile.name.trim() : "";
const email = typeof body?.user?.email === "string" ? body.user.email : "";
@@ -94,6 +99,7 @@ export function useNavRail(): NavRailState {
name: name || email || "账户",
initial: name.slice(0, 1) || email.slice(0, 1).toUpperCase() || "你",
credits: typeof body?.credits === "number" ? body.credits : 0,
avatar: body?.avatar ?? null,
});
}
} else if (accountResult.status === "fulfilled" && accountResult.value.status === 401) {