feat(ui): 星盘/星历/报告中心并入 app 外壳,侧栏不再消失
三个页面此前各是脱离外壳的独立全屏路由,各写了一套一样的 *-shell / *-topbar(只有一个「返回对话」链接)/ *-hero 骨架, 侧栏在打开它们的瞬间整个消失。 新增 AppNavRail(只读:两个 GET,零写操作)与 SecondaryShell。 会话行走 sessionHref → /?c=<uuid>,跳转复用现有侧栏的 persistLoginSessionReturn + location.assign,行为完全一致。 刻意不带重命名/收藏/归档/删除与账户菜单:那套连着 Home() 的乐观更新与 回滚层,为四个路由把它整体上提远超需要,且会撞 useState 增长门禁。 四个路由渲染标记完全不变:/ ○、/chart ○、/ephemeris ○、/reports ƒ。 CSS gzip 39,825→39,727(−0.25%);per-route JS 体积构建不输出, 已作为口径缺口记录。 两处自身问题被测试抓到并修复:usePathname() 在 app-router 上下文外 返回 null(类型说是 string)、fetch 在 jsdom 里可能不存在。 另差点随 hero 一起丢掉 BUG-717 的 eyebrow 文案(成本与速度承诺, 会印在失败页上),已放回 tab 行下方。 /reports/[reportId] 留给 R6 与目录一起做;根边界页保留「返回对话」, 它们不得 import globals.css,挂不了外壳。 Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_0193vBv6w5MV2cifdTUu9H5P
This commit is contained in:
co-authored by
Claude Opus 5
parent
b3ea8c336e
commit
50ce02c837
@@ -1,9 +1,8 @@
|
||||
"use client";
|
||||
|
||||
import Link from "next/link";
|
||||
import { ArrowLeft } from "lucide-react";
|
||||
import { useState } from "react";
|
||||
|
||||
import { SecondaryShell } from "@/components/secondary-shell";
|
||||
import { useChartPage } from "@/hooks/use-chart-page";
|
||||
import {
|
||||
CHART_VIEW_TABS,
|
||||
@@ -59,34 +58,26 @@ export function ChartPageView({
|
||||
if (id !== "D1") onNeedLayer?.("varga");
|
||||
}
|
||||
|
||||
return (
|
||||
<main className="chart-page-shell">
|
||||
<header className="chart-page-topbar">
|
||||
<Link href="/" className="chart-page-back">
|
||||
<ArrowLeft aria-hidden="true" />
|
||||
返回对话
|
||||
</Link>
|
||||
</header>
|
||||
const birthline = view != null && view.status === "ok"
|
||||
? `${view.profile.name} · ${view.profile.date} ${view.profile.time} · ${view.profile.placeLabel}`
|
||||
: null;
|
||||
|
||||
return (
|
||||
<SecondaryShell title="星盘" note={birthline}>
|
||||
{view == null ? (
|
||||
<section className="chart-page-hero">
|
||||
<h1>星盘</h1>
|
||||
<section className="chart-page-message">
|
||||
<p>{CHART_VIEW_COPY.waitingChart}</p>
|
||||
</section>
|
||||
) : view.status !== "ok" ? (
|
||||
<section className="chart-page-hero">
|
||||
<h1>星盘</h1>
|
||||
<section className="chart-page-message">
|
||||
<p>{view.message}</p>
|
||||
</section>
|
||||
) : (
|
||||
<>
|
||||
<section className="chart-page-hero">
|
||||
<p className="chart-page-eyebrow">{CHART_VIEW_COPY.eyebrow}</p>
|
||||
<h1>星盘</h1>
|
||||
<p className="chart-page-birthline">
|
||||
{view.profile.name} · {view.profile.date} {view.profile.time} · {view.profile.placeLabel}
|
||||
</p>
|
||||
</section>
|
||||
<div className="chart-page-body">
|
||||
{/* BUG-717 copy: a cost and speed promise that also prints on the
|
||||
failure page. It used to sit in the hero as an eyebrow; the hero is
|
||||
gone, the promise is not. */}
|
||||
<p className="chart-page-eyebrow">{CHART_VIEW_COPY.eyebrow}</p>
|
||||
<div className="chart-page-tabs" role="tablist" aria-label="星盘体系">
|
||||
{CHART_VIEW_TABS.map((item) => (
|
||||
<button
|
||||
@@ -128,8 +119,8 @@ export function ChartPageView({
|
||||
)
|
||||
) : null}
|
||||
</section>
|
||||
</>
|
||||
</div>
|
||||
)}
|
||||
</main>
|
||||
</SecondaryShell>
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user