fix(ui): title-bar buttons are one borderless style — 提问 and 导出 icon-only on phones with a count badge, 中 | EN switch, 那一刻的天空 ghost (BUG-2258)
Independent Staging Quality Gate / validate-frontend (push) Successful in 5m17s
Independent Staging Quality Gate / validate-python (push) Successful in 7m6s
Independent Staging Quality Gate / publish (push) Successful in 3m13s

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DbBXoyn7Hj3LCW3BUs5bZ8
This commit is contained in:
2026-11-23 15:04:09 +08:00
co-authored by Claude Opus 5.5
parent f3efa8ce27
commit 309e57496f
16 changed files with 307 additions and 85 deletions
+19
View File
@@ -30328,3 +30328,22 @@
- 验证与防复发:`tests/test_acceptance_1123_facts.py::test_report_reading_addresses_the_subject_as_you_2255`;需下一份别人档案的报告确认。已生成的那份没有重写。
- 关联记录:#228、BUG-2246。
- 修复版本:`claude/ui-items-2250`。
## BUG-2258 | 报告标题栏三个按钮各一种样式:圆框提问、椭圆描边「中文 / English」、方框「导出」
- 状态:fixed-pending-verify(分支 `claude/header-buttons-2258`,未推送;staging 真机未看)
- 首次发现 / 最近更新:2026-11-23(负责人手机截图:「标题栏上面的聊天按钮、语言切换按钮和导出按钮三个样式太丑了」,要求语言切换改成「中 EN」;原型方案 A 获批「同意 a」)/ 2026-11-23
- 影响面:个人报告、合盘报告、年运页的标题栏(提问、语言切换、导出),星盘页标题栏「那一刻的天空」。对话页右上角的星盘按钮本来就是无边框图标,未改;导出抽屉里的「中文 / English」分段在抽屉内有空间,保持全称未改。
- 现象:手机上标题栏右侧依次是带圆框的提问图标、椭圆描边的「中文 | English」(选中项陶土描边)、带方框的「⬇ 导出」,三种边框、三种高度;星盘页「那一刻的天空」是陶土淡底胶囊,又是第四种。
- 根因:样式逐个加出来,没有共用规则:提问用了正文「就这一节提问」的描边胶囊 `button.report-ask-entry`(BUG-2081);导出 2026-09-29 为了「找得到」改成 `variant="outline"` 带字;语言切换是独立的描边胶囊(`.report-language-switch`);「那一刻的天空」是 `variant="secondary"` 加强调色淡底(`.birth-sky-entry`)。
- 修复:
- 新增共用的 `.title-bar-button`(`frontend/src/app/globals.css` 末尾):无边框、透明底,取顶栏统一的控件高度 `--chat-header-pill`(画 34px,`::after` 补到 ≥44px 点按区),18px 图标,悬停灰底。宽屏图标后带字;加 `.title-bar-icon-on-phone` 的按钮在 ≤640px 只留图标,提问的数字变成右上角小角标(`--color-action-fill` 底、`--color-on-action-fill` 字)。
- `ReportAskPageEntry`(提问)、`ReportExportButton`(导出)改用 ghost + 上述类名,字放进 `title-bar-button-word`;读取全文时导出显示转圈图标,读屏名为「正在读取全文」。
- 新增 `ReportLanguageSwitch`:个人报告和合盘报告共用,中英两版都显示「中 | EN」,读屏仍读「中文 / English」;样式为浅灰底小分段,选中项白底加粗,不再用陶土描边。
- `BirthSkyEntry`:`variant="secondary"` → ghost + `.title-bar-button`,保留星座图标和「那一刻的天空」字样。
- 删除不再需要的 CSS:`.birth-sky-entry` 淡底胶囊、手机 `button.report-ask-page-entry` 规则、406 / 360 宽以下逐个收窄按钮和藏导出图标的三条容器规则、≤767px 语言切换高度规则。
- 验证:新增 `frontend/tests/title-bar-buttons-2258.test.tsx` 5 条(三个按钮同一类名且不是 outline / secondary;手机只留图标的范围;提问数字角标与读屏名;导出忙碌状态;「中 | EN」两版标签与读屏全称;CSS 无边框、控件高度变量、≥44px 点按区、手机角标、灰底分段与白底加粗选中、旧规则已删;年运只有提问和导出)。按「原值 / 新值 / 原因」更新:`language-switch-selected`(报告语言、合盘语言选中项改认白底加粗)、`synastry-report-followups-2082`(中EN、导出字在 span 里、容器规则数 6→5)、`report-questions-2081`、`chat-header-pills-and-quiet-cards-20261102`、`chat-chart-panel-compact-20261102`、`chart-picker-inspector-skeleton-20261102`(`.birth-sky-entry` → `.title-bar-button`)。截图(静态渲染 + Tailwind 编译的同一份样式表,390 / 1280,浅色 / 深色):`/tmp/claude-1000/-workspace-Jyotisha/7126d641-2604-4494-9ed5-fc1a6a545e81/scratchpad/shots2258/`。
- 防复发:标题栏里的新按钮一律用 `.title-bar-button`(需要手机只留图标时加 `.title-bar-icon-on-phone` 并给 `aria-label`);回归测试钉住三个入口不能回到 outline / secondary。
- 关联记录:BUG-2081(页面级提问入口)、BUG-2082(标题栏随版本换语言、窄栏让位)、BUG-2093、BUG-2138(导出读取全文)、2026-11-02 顶栏控件 34px 规则。
- 修复版本:分支 `claude/header-buttons-2258`(待父会话推送)。
+63 -26
View File
@@ -4930,11 +4930,6 @@ input:not([type="radio"]):not([type="checkbox"]):not([class^="ant-"]):not([class
430px phone, 360 a 384px one.) */
@container (max-width: 406px) {
.chat-header.is-title-yielding .personal-report-action-end { gap: var(--space-1); }
.chat-header.is-title-yielding .report-language-switch button { padding: 0 var(--space-2); }
.chat-header.is-title-yielding .personal-report-action-end > [data-slot="button"] { padding: 0 var(--space-2); }
}
@container (max-width: 360px) {
.chat-header.is-title-yielding .personal-report-action-end > [data-slot="button"]:last-child > svg { display: none; }
}
@media (max-width: 480px) {
.chat-header.is-title-yielding { gap: var(--space-2); }
@@ -5384,9 +5379,13 @@ input:not([type="radio"]):not([type="checkbox"]):not([class^="ant-"]):not([class
.personal-report-back:hover { color: var(--color-ink); background: var(--color-canvas-muted); }
.personal-report-action-end { display: flex; align-items: center; justify-content: flex-end; flex-wrap: wrap; gap: var(--space-3); }
/* 中文 | English: a two-segment switch in the reader's action bar, only on reports with both editions. */
.report-language-switch { display: inline-flex; padding: 2px; border: 1px solid var(--color-border); border-radius: 999px; background: var(--color-canvas); }
.report-language-switch button { min-height: 40px; min-width: 64px; padding: 0 var(--space-3); border: 0; border-radius: 999px; background: transparent; color: var(--color-ink-secondary); font: inherit; font-size: var(--type-body-sm); cursor: pointer; }
.report-language-switch button:is([data-active], [aria-selected="true"]) { background: transparent; color: var(--color-action); font-weight: 600; box-shadow: inset 0 0 0 1px var(--color-action-strong); }
/* BUG-2258 (owner 2026-11-23, option A): 中 | EN on a light grey track; the shown edition is white
and bold. 原值: 描边胶囊,「中文 / English」,选中项陶土描边 / 新值: 灰底小分段、白底加粗 / 原因: 标题栏按钮样式统一。
The track takes the bar's control height; the segments get a 44px touch height back through ::after. */
.report-language-switch { display: inline-flex; height: var(--chat-header-pill, 34px); padding: 2px; border: 0; border-radius: 9px; background: var(--color-canvas-muted); }
.report-language-switch button { position: relative; height: 100%; min-height: 0; min-width: 36px; padding: 0 var(--space-2); border: 0; border-radius: 7px; background: transparent; color: var(--color-ink-secondary); font: inherit; font-size: var(--type-body-sm); line-height: 1; cursor: pointer; }
.report-language-switch button::after { position: absolute; inset: -7px 0; content: ""; }
.report-language-switch button:is([data-active], [aria-selected="true"]) { background: var(--color-canvas); color: var(--color-ink); font-weight: 600; box-shadow: 0 1px 2px color-mix(in srgb, var(--color-ink) 12%, transparent); }
.report-language-switch button:focus-visible { outline: 2px solid var(--color-focus); outline-offset: 2px; }
.personal-report-action-end > span {
max-width: 440px;
@@ -5687,8 +5686,6 @@ button.report-ask-clear:hover { color: var(--color-ink); }
.report-ask-compose .composer { width: 100%; box-shadow: none; }
/* BUG-2081: in a narrow panel the notice wraps; the chat page's one-line ellipsis cut it at 360. */
.report-ask-compose .composer-ai-notice { width: 100%; margin: 0; overflow: visible; text-overflow: clip; white-space: normal; }
/* BUG-2081: the page-level entry in the title bar; on a phone the word goes and the icon with the count stays. */
@media (max-width: 640px) { button.report-ask-page-entry { padding: 0 10px; } .report-ask-page-entry-word { display: none; } }
.report-ask-short { margin: 0; display: flex; flex-wrap: wrap; gap: 4px 8px; color: var(--color-ink); font-size: 16px; line-height: 1.6; }
.report-ask-short a { color: var(--color-action); }
.report-ask-sheet[data-slot="drawer-popup"] { height: min(72vh, 620px); padding: 10px 0 0; border-color: var(--color-border); border-radius: 20px 20px 0 0; background: var(--color-canvas); }
@@ -6293,7 +6290,6 @@ button.report-ask-clear:hover { color: var(--color-ink); }
.personal-report-back { padding: 0 var(--space-2); min-width: 44px; justify-content: center; }
.personal-report-back-label { display: none; }
.personal-report-action-end { flex-wrap: nowrap; gap: var(--space-2); }
.report-language-switch button { min-height: 36px; min-width: 0; padding: 0 var(--space-3); }
.personal-report-action-end > [data-slot="button"] { height: 40px; padding: 0 var(--space-3); }
.personal-report-action-end > span { display: none; }
.personal-report-document { margin-top: var(--space-5); padding: var(--space-6) var(--space-4) var(--space-5); }
@@ -6780,21 +6776,6 @@ button.report-ask-clear:hover { color: var(--color-ink); }
.chart-page-skeleton .personal-report-chart-cell,
.chart-page-skeleton .chart-skeleton-sector { animation: none; fill-opacity: 0; }
}
/* 「那一刻的天空」: the chart header's one extra action, tinted with the accent and
a sparkle so it reads as an invitation rather than a thin outline (2026-09-29).
A 12% mix keeps it light in both themes (not the --color-action-soft block, BUG-1078). */
.birth-sky-entry[data-slot="button"] {
height: var(--chat-header-pill, 34px);
min-height: var(--chat-header-pill, 34px);
padding: 0 16px;
border-radius: 999px;
background: color-mix(in srgb, var(--color-action) 12%, transparent);
color: var(--color-action);
font-size: var(--type-body-sm);
font-weight: 600;
}
.birth-sky-entry[data-slot="button"]:hover { background: color-mix(in srgb, var(--color-action) 20%, transparent); }
.birth-sky-entry svg { width: 16px; height: 16px; }
.chart-page-vedic-stage {
position: relative;
background: var(--color-canvas);
@@ -8696,3 +8677,59 @@ button.report-ask-clear:hover { color: var(--color-ink); }
.redeem-success-ok { margin-top: 6px; border-radius: 999px; padding: 9px 26px; }
@keyframes redeem-success-pop { from { opacity: 0; transform: translateY(10px) scale(.96); } to { opacity: 1; transform: none; } } /* the centring lives in Tailwind's separate `translate` property */
@media (prefers-reduced-motion: reduce) { .redeem-success-dialog { animation: none; } }
/* BUG-2258 (owner 2026-11-23, option A): every button in a page title bar — 提问, 导出, 那一刻的天空 —
is borderless, at the bar's one control height (--chat-header-pill, 34px drawn, ≥44px to touch
through ::after, like the person chip and the chart toggle), with an 18px icon; the 中 | EN switch sits beside them. Wider screens
show the word after the icon; on a phone 提问 and 导出 keep only the icon, and 提问's count becomes
a small badge. 原值: 圆框提问、椭圆描边语言、方框导出、陶土淡底「那一刻的天空」/ 新值: 同一种无边框按钮 /
原因: 标题栏三个按钮各一种样式,负责人说太丑。Placed last so the older header rules (32px
.chat-header-actions buttons, 14–16px icons) do not win. */
.chat-header-actions .title-bar-button[data-slot="button"],
.title-bar-button[data-slot="button"] {
position: relative;
height: var(--chat-header-pill, 34px);
min-height: var(--chat-header-pill, 34px);
gap: 6px;
padding: 0 10px;
border: 0;
border-radius: var(--radius-md);
background: transparent;
box-shadow: none;
color: var(--color-ink);
font-size: var(--type-body-sm);
font-weight: 500;
white-space: nowrap;
}
.chat-header-actions .title-bar-button[data-slot="button"]:hover:not(:disabled),
.title-bar-button[data-slot="button"]:hover:not(:disabled) { background: var(--color-canvas-muted); color: var(--color-ink); }
.title-bar-button[data-slot="button"]::after { position: absolute; inset: -5px 0; content: ""; }
.chat-header-actions .title-bar-button[data-slot="button"] > svg,
.title-bar-button[data-slot="button"] > svg { width: 18px; height: 18px; color: currentColor; }
.title-bar-count { color: var(--color-action); font-weight: 600; font-variant-numeric: tabular-nums; }
.title-bar-spin { animation: title-bar-spin 1s linear infinite; }
@keyframes title-bar-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .title-bar-spin { animation: none; } }
.personal-report-header-actions .personal-report-action-end { gap: var(--space-1); }
@media (max-width: 640px) {
.chat-header-actions .title-bar-icon-on-phone[data-slot="button"],
.title-bar-icon-on-phone[data-slot="button"] { width: var(--chat-header-pill, 34px); padding: 0; }
.chat-header-actions .title-bar-icon-on-phone[data-slot="button"]::after,
.title-bar-icon-on-phone[data-slot="button"]::after { inset: -5px -4px; }
.title-bar-icon-on-phone .title-bar-button-word { display: none; }
.title-bar-icon-on-phone .title-bar-count {
position: absolute;
top: -4px;
right: -6px;
min-width: 16px;
height: 16px;
padding: 0 4px;
box-sizing: border-box;
border-radius: 8px;
background: var(--color-action-fill);
color: var(--color-on-action-fill);
font-size: 11px;
line-height: 16px;
text-align: center;
}
}
@@ -20,13 +20,16 @@ export const BIRTH_SKY_ENTRY_LABEL = "那一刻的天空";
* replay opens the moment it arrives — no spinner in between; the replay's own
* convergence is the wait. The replay is a lazy chunk and every open plays it
* again (TASK-mobile-chart-and-confirmed-edit-20260929 M4).
*
* BUG-2258 (owner 2026-11-23): borderless like every title-bar button. 原值: variant="secondary"
* 加陶土淡底胶囊 / 新值: ghost + title-bar-button,图标加字 / 原因: 标题栏按钮统一一种样式。
*/
export function BirthSkyEntry({ cover }: { cover: BirthSkyCover | null }) {
const [wanted, setWanted] = useState(false);
const open = wanted && cover !== null;
return (
<>
<Button type="button" variant="secondary" size="sm" className="birth-sky-entry" onClick={() => setWanted(true)}>
<Button type="button" variant="ghost" className="title-bar-button" onClick={() => setWanted(true)}>
<ConstellationIcon />
{BIRTH_SKY_ENTRY_LABEL}
</Button>
@@ -6,7 +6,7 @@ import { useMemo, useState, type ReactNode } from "react";
import Link from "next/link";
import { ArrowLeft, Download } from "lucide-react";
import { ArrowLeft, Download, LoaderCircle } from "lucide-react";
import type { BirthInputState } from "@/lib/birth-input-revision";
import type { ReportBirthScenario, ReportBirthTimeNote, ReportBirthWindow } from "@/lib/report-birth-marking";
@@ -55,16 +55,58 @@ export const REPORT_ACTIONS_TEXT = {
en: { actions: "Report actions", languageSwitch: "Report language", preparing: "Loading the full text", prepareFailed: "The full report did not finish loading. Check the network and export again.", exportLabel: "Export", exportAria: "Export report" },
} as const;
/**
* BUG-2258 (owner 2026-11-23, option A): a title-bar button like the others there — borderless,
* 40px, the download icon; the word 「导出」 shows on wider screens and the phone keeps the icon.
* 原值: variant="outline",图标加字,手机上也有边框和字 / 新值: ghost + title-bar-button,手机只留图标 /
* 原因: 标题栏三个按钮各一种样式(圆框、椭圆描边、方框),负责人说太丑。
*/
export function ReportExportButton({ onClick, language = "zh", busy = false }: { onClick: () => void; language?: ReportLanguage; busy?: boolean }) {
const text = REPORT_ACTIONS_TEXT[language];
return (
<Button type="button" variant="outline" aria-label={text.exportAria} aria-busy={busy || undefined} disabled={busy} onClick={onClick}>
<Button
type="button"
variant="ghost"
className="title-bar-button title-bar-icon-on-phone"
aria-label={busy ? text.preparing : text.exportAria}
aria-busy={busy || undefined}
disabled={busy}
onClick={onClick}
>
{/* BUG-2138 step 2: while the whole text of a report read in parts is being read, the button says so. */}
{busy ? <><Download aria-hidden="true" />{text.preparing}</> : <><Download aria-hidden="true" />{text.exportLabel}</>}
{busy ? <LoaderCircle aria-hidden="true" className="title-bar-spin" /> : <Download aria-hidden="true" />}
<span className="title-bar-button-word">{busy ? text.preparing : text.exportLabel}</span>
</Button>
);
}
/** BUG-2258: the language switch reads 中 | EN in either edition; screen readers hear the full names. */
export const REPORT_LANGUAGE_SWITCH_LABELS = {
zh: { short: "中", full: "中文" },
en: { short: "EN", full: "English" },
} as const;
/** BUG-2258: the title bar's 中 | EN switch, shared by the personal and the pair report. */
export function ReportLanguageSwitch({ value, label, onChange }: Readonly<{
value: ReportLanguage;
label: string;
onChange: (language: ReportLanguage) => void;
}>) {
return (
<Tabs
value={value}
onValueChange={(next) => {
if (next === "zh" || next === "en") onChange(next);
}}
>
<TabsList variant="default" aria-label={label} className="report-language-switch">
<TabsTrigger value="zh" aria-label={REPORT_LANGUAGE_SWITCH_LABELS.zh.full}>{REPORT_LANGUAGE_SWITCH_LABELS.zh.short}</TabsTrigger>
<TabsTrigger value="en" aria-label={REPORT_LANGUAGE_SWITCH_LABELS.en.full}>{REPORT_LANGUAGE_SWITCH_LABELS.en.short}</TabsTrigger>
</TabsList>
</Tabs>
);
}
export function ReportActions({
markdown,
prepare,
@@ -113,21 +155,9 @@ export function ReportActions({
<div className="personal-report-action-end">
{askEntry}
{/* Only reports that carry an English edition show the switch (2026-09-29). */}
{canSwitch && (
<Tabs
value={language}
onValueChange={(value) => {
if (value === "zh" || value === "en") onLanguageChange(value);
}}
>
<TabsList variant="default" aria-label={text.languageSwitch} className="report-language-switch">
<TabsTrigger value="zh">中文</TabsTrigger>
<TabsTrigger value="en">English</TabsTrigger>
</TabsList>
</Tabs>
)}
{/* Labelled, outlined and full height (2026-09-29): the icon-only ghost
button it replaces was the one control people could not find. */}
{canSwitch && <ReportLanguageSwitch value={language} label={text.languageSwitch} onChange={onLanguageChange} />}
{/* BUG-2258: borderless like the other title-bar buttons; the word shows beside the icon
on wider screens (2026-09-29 had made it outlined so it could be found). */}
<ReportExportButton language={chromeLanguage} busy={preparing} onClick={openExport} />
{editions && (
<ReportExportDrawer
@@ -34,19 +34,22 @@ export function ReportAskEntry({ count, text, sectionTitle, onClick }: Readonly<
/**
* BUG-2081: the page-level entry, for the header's actions. 「提问」 before any question, then the
* report's whole count. It opens the panel with no section pending.
*
* BUG-2258 (owner 2026-11-23, option A): a borderless title-bar button like 导出. Wider screens show
* 「提问」 and the count after it; a phone shows the icon with the count as a small badge.
* 原值: report-ask-entry 的圆角描边胶囊 / 新值: title-bar-button(无边框、40px) / 原因: 标题栏三个按钮样式不一。
*/
export function ReportAskPageEntry({ count, text, onClick }: Readonly<{
count: number;
text: ReportAskText;
onClick: () => void;
}>) {
// On a phone the title bar is full: the word is dropped there and the icon (with the count) stays.
const label = count > 0 ? text.asked(count) : text.askReport;
return (
<Button type="button" variant="ghost" size="sm" className="report-ask-entry report-ask-page-entry" aria-label={label} onClick={onClick}>
<Button type="button" variant="ghost" className="title-bar-button title-bar-icon-on-phone" aria-label={label} onClick={onClick}>
<MessageCircle aria-hidden="true" />
<span className="report-ask-page-entry-word">{text.askReport}</span>
{count > 0 ? <span>{count}</span> : null}
<span className="title-bar-button-word">{text.askReport}</span>
{count > 0 ? <span className="title-bar-count" aria-hidden="true">{count}</span> : null}
</Button>
);
}
@@ -7,14 +7,13 @@ import {
SYNASTRY_ENTERED_TIME_ZH, SYNASTRY_TRIAL_TIME_ZH, synastryAnalysisReaderText, synastryAuditReaderCell, synastrySoReaderText,
synastryTechnicalReaderText,
} from "@/lib/synastry-analysis-reader";
import { ReportExportButton } from "@/components/personal-report/report-actions";
import { ReportExportButton, ReportLanguageSwitch } from "@/components/personal-report/report-actions";
import { ReportExportDrawer } from "@/components/personal-report/report-export-drawer";
import { exportPairName } from "@/lib/report-export-blocks";
import { notifyInfo } from "@/lib/notify";
import { useCallback, useEffect, useRef, useState, type ReactNode } from "react";
import { SynastryWait } from "@/components/synastry/synastry-wait";
import { Tabs, TabsList, TabsTrigger } from "@/components/ui/tabs";
import { ReportAskEntry, ReportAskPageEntry } from "@/components/report-ask/report-ask-entry";
import { ReportAskPanel, ReportAskSheet } from "@/components/report-ask/report-ask-panel";
import { ReportAskSelection } from "@/components/report-ask/report-ask-selection";
@@ -418,12 +417,7 @@ export function SynastryReportView(props: {
{waiting ? null : (
<ReportAskPageEntry count={ask.state.data?.questionCount ?? 0} text={askText} onClick={() => startAsk(null)} />
)}
<Tabs value={language} onValueChange={(next) => { if (next === "en") showEnglish(); else setLanguage("zh"); }}>
<TabsList variant="default" aria-label={chrome.languageSwitch} className="report-language-switch">
<TabsTrigger value="zh">中文</TabsTrigger>
<TabsTrigger value="en">English</TabsTrigger>
</TabsList>
</Tabs>
<ReportLanguageSwitch value={language} label={chrome.languageSwitch} onChange={(next) => { if (next === "en") showEnglish(); else setLanguage("zh"); }} />
{waiting ? null : <ReportExportButton language={shown} onClick={() => setExporting(true)} />}
</div>
</nav>
@@ -122,7 +122,8 @@ test("the chart page header uses the chat's two-line chip, as tall as 「那一
assert.doesNotMatch(renderToStaticMarkup(<CurrentSubjectSwitcher />), /is-chip/);
// 原值:`var(--chat-header-pill, 44px)`;新值:后备值 34px,和顶栏变量一致
// 原因:2026-11-02 产品:顶栏胶囊太高、边框贴到顶栏上下边,画出来改成 34px
assert.match(cssDeclarations('.birth-sky-entry[data-slot="button"]', globalStyles), /height: var\(--chat-header-pill, 34px\)/);
// 原值(2):'.birth-sky-entry[data-slot="button"]' / 新值(2):'.title-bar-button[data-slot="button"]' / 原因(2):BUG-2258 标题栏按钮统一
assert.match(cssDeclarations('.title-bar-button[data-slot="button"]', globalStyles), /height: var\(--chat-header-pill, 34px\)/);
assert.match(cssDeclarations(".chat-profile-picker-trigger.is-chip", globalStyles), /height: var\(--chat-header-pill\)/);
});
@@ -14,7 +14,9 @@ test("top-bar pills draw at 34px inside the bar and keep a 44px touch target", (
assert.match(cssDeclarations(".chat-header", globals), /--chat-header-pill: 34px/);
// The bar is 46px (52px on a phone): 34px leaves air above and below every pill.
assert.match(cssDeclarations(".chat-panel", globals), /grid-template-rows: 46px/);
for (const selector of [".chat-profile-picker-trigger.is-chip", '.birth-sky-entry[data-slot="button"]', ".chat-header-actions button.chat-chart-toggle"]) {
// 原值:'.birth-sky-entry[data-slot="button"]' / 新值:'.title-bar-button[data-slot="button"]'
// 原因:BUG-2258「那一刻的天空」与报告标题栏的提问、导出共用一种无边框按钮
for (const selector of [".chat-profile-picker-trigger.is-chip", '.title-bar-button[data-slot="button"]', ".chat-header-actions button.chat-chart-toggle"]) {
assert.match(cssDeclarations(selector, globals), /(^|[;\s])height: var\(--chat-header-pill/, selector);
}
// 34px + 2 × 5px = 44px for the chip; 34px + 2 × 6px for the other actions.
@@ -109,7 +109,11 @@ test("the person chip takes the one top-bar height token, desktop and phone", ()
assert.doesNotMatch(globalStyles, /credit-balance/);
assert.match(cssDeclarations(".chat-header-actions button::after", globalStyles), /inset: -6px/);
assert.equal((globalStyles.match(/--chat-header-pill:/g) ?? []).length, 1);
assert.match(cssDeclarations('.birth-sky-entry[data-slot="button"]', globalStyles), /min-height:\s*var\(--chat-header-pill, 34px\)/);
// 原值(4):.birth-sky-entry[data-slot="button"] 取这个变量(陶土淡底胶囊,类名随之删掉)
// 新值(4):「那一刻的天空」和报告标题栏的提问、导出共用 .title-bar-button,仍取这个变量
// 原因(4):BUG-2258 负责人要标题栏按钮统一成无边框一种样式
assert.match(cssDeclarations('.title-bar-button[data-slot="button"]', globalStyles), /min-height:\s*var\(--chat-header-pill, 34px\)/);
assert.match(cssDeclarations('.report-language-switch', globalStyles), /height:\s*var\(--chat-header-pill, 34px\)/);
const chip = ".chat-profile-picker-trigger.is-chip";
for (const selector of [chip]) {
const body = cssDeclarations(selector, globalStyles);
@@ -91,7 +91,13 @@ function matchesSelector(node: Node, selector: string): boolean {
return true;
}
function themeRules() {
// BUG-2258 (owner 2026-11-23, option A): the title bar's 中 | EN shows its selected edition as a
// white, bold segment on a grey track, not with the accent. 原值: 只认 --color-action(-strong) 的选中规则 /
// 新值: 报告语言认白底(--color-canvas)加粗的选中规则,另外两组仍认强调色 / 原因: 标题栏按钮统一样式。
const ACCENT_BODY = /--color-action-strong|--color-action\b/;
const WHITE_SEGMENT_BODY = /background:\s*var\(--color-canvas\)[\s\S]*font-weight:\s*600/;
function themeRules(body: RegExp = ACCENT_BODY) {
const clean = css.replace(/\/\*[\s\S]*?\*\//g, " ");
const rules: { selector: string; body: string }[] = [];
for (const hit of clean.matchAll(/([^{}@]+)\{([^{}]*)\}/g)) {
@@ -100,7 +106,7 @@ function themeRules() {
rules.push({ selector, body: hit[2] });
}
return rules.filter((rule) => /\[data-active\]|\[aria-selected="true"\]/.test(rule.selector)
&& /--color-action-strong|--color-action\b/.test(rule.body));
&& body.test(rule.body));
}
/** The pair report with a stand-in for the title bar's actions slot (BUG-2080). */
@@ -118,15 +124,15 @@ function PairReportWithBar() {
);
}
function hitsTheme(node: Node): boolean {
return themeRules().some((rule) => splitTop(rule.selector).some((selector) => matchesSelector(node, selector.trim())));
function hitsTheme(node: Node, body?: RegExp): boolean {
return themeRules(body).some((rule) => splitTop(rule.selector).some((selector) => matchesSelector(node, selector.trim())));
}
function tabsIn(nodes: Node[], owner: Node) {
return nodes.filter((node) => node.getAttribute("role") === "tab" && owner.contains(node));
}
function pair(nodes: Node[], owner: Node, label: string) {
function pair(nodes: Node[], owner: Node, label: string, body?: RegExp) {
const tabs = tabsIn(nodes, owner);
const selected = tabs.find((node) => node.getAttribute("aria-selected") === "true");
const unselected = tabs.find((node) => node.getAttribute("aria-selected") === "false");
@@ -139,8 +145,8 @@ function pair(nodes: Node[], owner: Node, label: string) {
`${unselected.getAttribute("class")}|${unselected.getAttribute("aria-selected")}|${unselected.hasAttribute("data-active")}`,
`${label} class or attribute`,
);
assert.equal(hitsTheme(selected), true, `${label} theme rule`);
assert.equal(hitsTheme(unselected), false, `${label} unselected theme rule`);
assert.equal(hitsTheme(selected, body), true, `${label} theme rule`);
assert.equal(hitsTheme(unselected, body), false, `${label} unselected theme rule`);
}
test("the three language switches and the export scope card show which one is selected", async () => {
@@ -176,7 +182,7 @@ test("the three language switches and the export scope card show which one is se
assert.ok(found, label);
return found;
};
pair(nodes, list("报告语言"), "报告语言");
pair(nodes, list("报告语言"), "报告语言", WHITE_SEGMENT_BODY);
pair(nodes, list("导出语言"), "导出语言");
pair(nodes, list("导出范围"), "导出范围");
// 原值: 按 class synastry-lang 在报告正文里找
@@ -184,7 +190,7 @@ test("the three language switches and the export scope card show which one is se
// 原因: BUG-2080 合盘的语言切换和导出移到标题栏
const synastry = nodes.find((node) => node.getAttribute("id") === "pair-report-actions");
assert.ok(synastry, "合盘语言");
pair(nodes, synastry, "合盘语言");
pair(nodes, synastry, "合盘语言", WHITE_SEGMENT_BODY);
assert.equal(harness.errors.length, 0, harness.errors.map(String).join("\n"));
} finally {
await harness.close();
+7 -3
View File
@@ -172,17 +172,21 @@ test("ready reports expose only the back link and accessible export icon", () =>
// 新值:不再是图标按钮(doesNotMatch size="icon"),可见文字「导出」,描边样式
// 原因:TASK-report-reader-polish-20260929 §3-3——图标按钮太不显眼,产品要求做明显
assert.doesNotMatch(actionsSource, /size="icon"/);
assert.match(actionsSource, /variant="outline"/);
// 原值(2):variant="outline" / 新值(2):标题栏统一的无边框按钮(ghost + title-bar-button),宽屏仍有字「导出」
// 原因(2):BUG-2258 负责人:标题栏三个按钮样式不一太丑,方案 A
assert.match(actionsSource, /variant="ghost"\s+className="title-bar-button title-bar-icon-on-phone"/);
// 原值: 源码里是 <Download aria-hidden="true" />导出
// 新值: 文字取自 REPORT_ACTIONS_TEXT(中文 exportLabel 仍是「导出」),按钮写成 <Download aria-hidden="true" />{text.exportLabel}
// 原因: BUG-2082 显示英文版时标题栏的导出按钮用英文 Export,默认仍是中文
assert.match(actionsSource, /zh: \{[^}]*exportLabel: "导出", exportAria: "导出报告" \}/);
assert.match(actionsSource, /<Download aria-hidden="true" \/>\{text\.exportLabel\}/);
// 原值(3):<Download aria-hidden="true" />{text.exportLabel} / 新值(3):字在 title-bar-button-word 里,手机上只留图标 / 原因(3):BUG-2258
assert.match(actionsSource, /<Download aria-hidden="true" \/>\}\n\s+<span className="title-bar-button-word">\{busy \? text\.preparing : text\.exportLabel\}<\/span>/);
assert.doesNotMatch(actionsSource, /PERSONAL_REPORT_EXPORT_LABEL|#export|reportId|reportTitle/);
// 原值: 源码里写死 aria-label="导出报告"
// 新值: aria-label={text.exportAria},中文一栏仍是「导出报告」(上面已断言)
// 原因: BUG-2082 显示英文版时导出按钮的朗读名用英文 Export report
assert.match(actionsSource, /aria-label=\{text\.exportAria\}/);
// 原值(4):aria-label={text.exportAria} / 新值(4):读取全文时读「正在读取全文」,否则 exportAria / 原因(4):BUG-2258 字可能被藏
assert.match(actionsSource, /aria-label=\{busy \? text\.preparing : text\.exportAria\}/);
assert.doesNotMatch(actionsSource, /RawAppendixDownload|printPersonalReport|PERSONAL_REPORT_PRINT_LABEL|Printer|useSyncExternalStore|detectPrintRestriction/);
});
@@ -170,7 +170,9 @@ test("the language switch only exists when both editions do", async () => {
// 原值:English 是 BUTTON,aria-pressed="false"
// 新值:English 是 role=tab,aria-selected="false"
// 原因:K5 报告语言改用分段页签
const english = h.elements().find(node => node.getAttribute("role") === "tab" && node.text === "English");
// 原值(2):按文字 English 找 / 新值(2):文字是 EN,读屏名仍是 English / 原因(2):BUG-2258
const english = h.elements().find(node => node.getAttribute("role") === "tab" && node.getAttribute("aria-label") === "English");
assert.equal(english?.text, "EN");
assert.ok(english);
assert.equal(english.getAttribute("aria-selected"), "false");
await h.event(english);
@@ -60,10 +60,12 @@ async function openReader(initialLanguage: "zh" | "en") {
const pressed = h.elements().find(node => node.getAttribute("role") === "tab" && node.getAttribute("aria-selected") === "true");
// The article only: the 「到底部」 jump beside it is app chrome and stays Chinese (English edition decision 6).
const articles = h.elements().filter(node => hasClass(node, "personal-report-md-article"));
return { layouts: layouts.length, reader: articles.map(node => node.text).join(""), toc: toc?.text, pressed: pressed?.text, url: location.href };
// 原值:pressed 读页签文字(中文 / English)/ 新值:读页签的读屏名(文字已是「中 | EN」)/ 原因:BUG-2258
return { layouts: layouts.length, reader: articles.map(node => node.text).join(""), toc: toc?.text, pressed: pressed?.getAttribute("aria-label"), url: location.href };
};
const pick = async (label: string) => {
const button = h.elements().find(node => node.getAttribute("role") === "tab" && node.text === label);
// 原值:按页签文字找 / 新值:按读屏名找(「中文」「English」)/ 原因:BUG-2258 标题栏显示「中 | EN」
const button = h.elements().find(node => node.getAttribute("role") === "tab" && node.getAttribute("aria-label") === label);
assert.ok(button, `${label} switch button`);
await h.event(button);
await h.idle();
@@ -267,13 +267,16 @@ test("BUG-2081: every section has an entry, the advice section too, and the page
assert.match(view, /<ReportAskPageEntry count=\{ask\.state\.data\?\.questionCount \?\? 0\} text=\{askText\} onClick=\{\(\) => startAsk\(null\)\} \/>/);
const none = renderToStaticMarkup(<ReportAskPageEntry count={0} text={text} onClick={() => undefined} />);
assert.match(none, /aria-label="提问"/);
assert.match(none, /<span class="report-ask-page-entry-word">提问<\/span><\/button>/);
// 原值:report-ask-page-entry-word / <span>4</span>;新值:title-bar-button-word / 数字是 title-bar-count(手机上变成角标)
// 原因:BUG-2258 标题栏按钮统一成无边框一种样式
assert.match(none, /<span class="title-bar-button-word">提问<\/span><\/button>/);
const some = renderToStaticMarkup(<ReportAskPageEntry count={4} text={text} onClick={() => undefined} />);
assert.match(some, /aria-label="提问 4"/);
assert.match(some, /<span class="report-ask-page-entry-word">提问<\/span><span>4<\/span>/);
assert.match(some, /<span class="title-bar-button-word">提问<\/span><span class="title-bar-count" aria-hidden="true">4<\/span>/);
// In the title bar's actions, before the language switch; on a phone only the icon and the count.
assert.match(view, /<div className="personal-report-action-end">\n\s+\{\/\* BUG-2081[^\n]*\n\s+\{waiting \? null : \(\n\s+<ReportAskPageEntry/);
assert.match(read("../src/app/globals.css"), /@media \(max-width: 640px\) \{ button\.report-ask-page-entry \{ padding: 0 10px; \} \.report-ask-page-entry-word \{ display: none; \} \}/);
// 原值:手机规则 button.report-ask-page-entry / 新值:.title-bar-icon-on-phone 隐藏字、数字成角标 / 原因:BUG-2258
assert.match(read("../src/app/globals.css"), /\.title-bar-icon-on-phone \.title-bar-button-word \{ display: none; \}/);
});
test("BUG-2081: the 「问这一段」 bar is never on the selected lines", () => {
@@ -192,7 +192,8 @@ test("BUG-2082: the pair report's title bar and head read in the edition that is
barClass: "chat-header has-title is-title-yielding",
title: "林甲 × 周乙",
back: ["/synastry", "婚恋合盘", "返回婚恋合盘"],
tabs: [["报告语言", "中文English"]],
// 原值:中文English / 新值:中EN / 原因:BUG-2258 标题栏语言切换改成「中 | EN」
tabs: [["报告语言", "中EN"]],
exportButton: ["导出", "导出报告"],
actions: "报告操作",
h1: "林甲 × 周乙,婚恋合盘",
@@ -209,7 +210,7 @@ test("BUG-2082: the pair report's title bar and head read in the edition that is
// Names are names; the tabs name each language in itself.
title: "林甲 × 周乙",
back: ["/synastry", "Synastry", "Back to Synastry"],
tabs: [["Report language", "中文English"]],
tabs: [["Report language", "中EN"]],
exportButton: ["Export", "Export report"],
actions: "Report actions",
h1: "林甲 × 周乙, Synastry report",
@@ -261,7 +262,8 @@ test("BUG-2082: the personal report's title bar reads in the edition that is sho
assert.match(zh, /<strong>个人报告,林甲<\/strong>/);
assert.match(zh, /<nav aria-label="报告操作"/);
assert.match(zh, /aria-label="报告语言"/);
assert.match(zh, /aria-label="导出报告"[^>]*>.*?导出<\/button>/);
// 原值:…导出</button> / 新值:字在 title-bar-button-word 里(手机上只留图标)/ 原因:BUG-2258
assert.match(zh, /aria-label="导出报告"[^>]*>.*?<span class="title-bar-button-word">导出<\/span><\/button>/);
assert.equal(/Export|My reports|Personal report|Report (actions|language)/.test(zh), false);
const en = header("en");
@@ -271,12 +273,13 @@ test("BUG-2082: the personal report's title bar reads in the edition that is sho
assert.match(en, /<strong>Personal report, 林甲<\/strong>/);
assert.match(en, /<nav aria-label="Report actions"/);
assert.match(en, /aria-label="Report language"/);
assert.match(en, /aria-label="Export report"[^>]*>.*?Export<\/button>/);
assert.match(en, /aria-label="Export report"[^>]*>.*?<span class="title-bar-button-word">Export<\/span><\/button>/);
assert.equal(/导出|我的报告|个人报告|报告操作|报告语言|返回/.test(en), false);
assert.match(en, />中文<\/button>/);
// 原值:>中文</button> / 新值:>中</button>,读屏仍读「中文」/ 原因:BUG-2258
assert.match(en, /aria-label="中文"[^>]*>中<\/button>/);
// Defaults stay Chinese for every other caller.
assert.match(renderToStaticMarkup(<ReportExportButton onClick={() => {}} />), /aria-label="导出报告"[^>]*>.*?导出<\/button>/);
assert.match(renderToStaticMarkup(<ReportExportButton onClick={() => {}} />), /aria-label="导出报告"[^>]*>.*?<span class="title-bar-button-word">导出<\/span><\/button>/);
assert.equal(REPORT_ACTIONS_TEXT.zh.exportLabel, "导出");
const plain = renderToStaticMarkup(<SidebarProvider open><SecondaryHeader title="星历" back={{ href: "/chart", label: "星盘" }} /></SidebarProvider>);
assert.match(plain, /aria-label="返回星盘"/);
@@ -298,7 +301,9 @@ test("BUG-2082: on a narrow title bar the pair's names go first; the way back an
assert.match(css, /@container \(max-width: 640px\) \{\n \.chat-header\.is-title-yielding \.chat-header-title > strong,\n \.chat-header\.is-title-yielding \.secondary-header-crumb \{ display: none; \}\n \.chat-header\.is-title-yielding \.personal-report-action-end \{ flex-wrap: nowrap; \}\n\}/);
// Every rule of the modifier is scoped to it: other pages' bars are untouched.
const lines = css.split("\n").filter((line) => line.includes("is-title-yielding") && !line.trimStart().startsWith("/*") && line.includes("{"));
assert.equal(lines.length >= 6, true);
// 原值:>= 6 / 新值:>= 5 / 原因:BUG-2258 手机上提问、导出只留图标,406 宽以下逐个收窄按钮内边距、
// 360 宽以下藏导出图标的三条规则不再需要
assert.equal(lines.length >= 5, true);
for (const line of lines) assert.match(line.trimStart(), /^\.chat-header\.is-title-yielding[ .]/, line);
// The way back and the action group are never hidden by it.
for (const line of lines) assert.equal(/secondary-header-back\b(?!-)|chat-header-actions|report-language-switch \{ display/.test(line), false, line);
@@ -0,0 +1,107 @@
/**
* BUG-2258 (owner 2026-11-23, prototype option A): every button in a page title bar is the same
* borderless button at the bar's one control height; phones keep only the icons of 提问 and 导出
* (提问's count becomes a badge); the language switch reads 中 | EN with the selected edition white
* and bold. Places: personal report, pair report, annual report, chart page 「那一刻的天空」.
*/
import assert from "node:assert/strict";
import { readFileSync } from "node:fs";
import test from "node:test";
import { renderToStaticMarkup } from "react-dom/server";
import { BirthSkyEntry } from "../src/components/birth-sky/birth-sky-entry";
import { ReportExportButton, ReportLanguageSwitch } from "../src/components/personal-report/report-actions";
import { ReportAskPageEntry } from "../src/components/report-ask/report-ask-entry";
import { REPORT_ASK_TEXT } from "../src/lib/report-ask-client";
import { cssDeclarations } from "./css-contract-test-support.ts";
const css = readFileSync(new URL("../src/app/globals.css", import.meta.url), "utf8");
const read = (path: string) => readFileSync(new URL(path, import.meta.url), "utf8");
function classOf(markup: string) {
return markup.match(/<button[^>]*class="([^"]*)"/)?.[1] ?? "";
}
test("提问, 导出 and 那一刻的天空 are the same borderless title-bar button", () => {
const ask = renderToStaticMarkup(<ReportAskPageEntry count={0} text={REPORT_ASK_TEXT.zh} onClick={() => {}} />);
const exportButton = renderToStaticMarkup(<ReportExportButton onClick={() => {}} />);
const sky = renderToStaticMarkup(<BirthSkyEntry cover={null} />);
for (const [name, markup] of [["提问", ask], ["导出", exportButton], ["天空", sky]] as const) {
const classes = classOf(markup).split(/\s+/);
assert.ok(classes.includes("title-bar-button"), name);
// ghost: no outline or secondary fill from the button kit.
assert.equal(/\bborder-border\b|\bbg-secondary\b|\bbg-background\b/.test(classOf(markup)), false, name);
}
// On a phone only 提问 and 导出 drop their word; 「那一刻的天空」 keeps it.
assert.ok(classOf(ask).includes("title-bar-icon-on-phone"));
assert.ok(classOf(exportButton).includes("title-bar-icon-on-phone"));
assert.equal(classOf(sky).includes("title-bar-icon-on-phone"), false);
assert.match(sky, />那一刻的天空<\/button>/);
for (const file of ["../src/components/report-ask/report-ask-entry.tsx", "../src/components/personal-report/report-actions.tsx", "../src/components/birth-sky/birth-sky-entry.tsx"]) {
const source = read(file);
assert.doesNotMatch(source, /className="title-bar-button[^"]*"[^>]*variant="(outline|secondary)"|variant="(outline|secondary)"[^>]*className="title-bar-button/, file);
}
});
test("both title-bar buttons keep a spoken name when the word is hidden; 提问's count is a badge", () => {
const none = renderToStaticMarkup(<ReportAskPageEntry count={0} text={REPORT_ASK_TEXT.zh} onClick={() => {}} />);
assert.match(none, /aria-label="提问"/);
assert.doesNotMatch(none, /title-bar-count/);
const some = renderToStaticMarkup(<ReportAskPageEntry count={3} text={REPORT_ASK_TEXT.zh} onClick={() => {}} />);
assert.match(some, /aria-label="提问 3"/);
assert.match(some, /<span class="title-bar-count" aria-hidden="true">3<\/span>/);
assert.match(renderToStaticMarkup(<ReportExportButton onClick={() => {}} />), /aria-label="导出报告"/);
assert.match(renderToStaticMarkup(<ReportExportButton language="en" onClick={() => {}} />), /aria-label="Export report"/);
const busy = renderToStaticMarkup(<ReportExportButton busy onClick={() => {}} />);
assert.match(busy, /aria-label="正在读取全文"/);
assert.match(busy, /aria-busy="true"/);
assert.match(busy, /title-bar-spin/);
});
test("the language switch reads 中 | EN in either edition and keeps the full names for screen readers", () => {
for (const value of ["zh", "en"] as const) {
const markup = renderToStaticMarkup(<ReportLanguageSwitch value={value} label="报告语言" onChange={() => {}} />);
assert.match(markup, /aria-label="中文"[^>]*>中<\/button>/);
assert.match(markup, /aria-label="English"[^>]*>EN<\/button>/);
assert.doesNotMatch(markup, />中文<|>English</);
}
// Both reports use the one switch.
assert.match(read("../src/components/personal-report/report-actions.tsx"), /<ReportLanguageSwitch value=\{language\}/);
assert.match(read("../src/components/synastry/synastry-report-view.tsx"), /<ReportLanguageSwitch value=\{language\}/);
// The export sheet keeps its own full-word segment (inside the sheet there is room).
assert.match(read("../src/components/personal-report/report-export-drawer.tsx"), /<TabsTrigger value="en">English<\/TabsTrigger>/);
});
test("the CSS: one borderless rule at the bar's control height, a phone badge, a grey 中 | EN track", () => {
const button = cssDeclarations('.title-bar-button[data-slot="button"]', css);
assert.match(button, /border: 0/);
assert.match(button, /background: transparent/);
assert.match(button, /(^|[;\s])height: var\(--chat-header-pill, 34px\)/);
assert.match(button, /min-height: var\(--chat-header-pill, 34px\)/);
assert.match(cssDeclarations('.title-bar-button[data-slot="button"] > svg', css), /width: 18px; height: 18px/);
// A touch area of at least 44px: 34 + 2 × 5.
assert.match(cssDeclarations('.title-bar-button[data-slot="button"]::after', css), /inset: -5px 0/);
const phone = css.slice(css.lastIndexOf("@media (max-width: 640px) {"));
assert.match(phone, /\.title-bar-icon-on-phone \.title-bar-button-word \{ display: none; \}/);
assert.match(phone, /\.title-bar-icon-on-phone \.title-bar-count \{[^}]*position: absolute;[^}]*background: var\(--color-action-fill\);[^}]*color: var\(--color-on-action-fill\);/);
const track = cssDeclarations(".report-language-switch", css);
assert.match(track, /border: 0/);
assert.match(track, /background: var\(--color-canvas-muted\)/);
// Read straight from the sheet: the helper splits selector lists on commas, and :is() holds one.
const selected = css.match(/\n\.report-language-switch button:is\(\[data-active\], \[aria-selected="true"\]\) \{([^}]*)\}/)?.[1] ?? "";
assert.match(selected, /background: var\(--color-canvas\)/);
assert.match(selected, /font-weight: 600/);
assert.doesNotMatch(selected, /--color-action/);
// The old outlined pill and the accent-tinted sky pill are gone.
assert.equal(css.includes(".birth-sky-entry"), false);
assert.equal(css.includes("button.report-ask-page-entry"), false);
assert.doesNotMatch(css, /\.report-language-switch \{[^}]*border: 1px solid/);
});
test("the annual report's title bar uses the same two buttons and no language switch", () => {
const annual = read("../src/components/annual/annual-report-page.tsx");
assert.match(annual, /<ReportAskPageEntry count=\{askHeader\.count\}/);
assert.match(annual, /<ReportExportButton onClick=\{\(\) => setOpen\(true\)\} \/>/);
assert.doesNotMatch(annual, /ReportLanguageSwitch|report-language-switch/);
});