Files
Jyotisha/frontend/tests/chart-dasha-switch-layout.test.ts
T
ClaudeandClaude Opus 5.5 cb0a62897d
Independent Staging Quality Gate / validate (push) Successful in 16m59s
Independent Staging Quality Gate / publish (push) Successful in 4m7s
feat: fixed-size chart cards that show everything, and a quiet 第二条运法
星盘页按 2026-11-02 确认的原型重排:盘 | 盘面检视,宫位主题 | 命盘速览,
盘面数据占满整行。每张卡固定大小、一次装下全部内容、不在卡内滚动;选星、
选宫、选点或不选,卡片大小都不变。布局由工作区自身宽度(容器查询)决定。

- 盘面检视:一个固定框架(头部、两列事实格、操作行),保留原有全部信息;
  窄检视卡一行一格;对话右栏仍是 440px 卡内滚动。
- 宫位主题:3×4 的 44px 格子,有星的宫一个小点,选中浅色强调底。
- 命盘速览:3×2 六项,仍可点。
- 盘面数据:九个页签做成标题右侧的分段胶囊,全部可见;高度按最高的常规
  页签定,只有长 Yogini 大运表等不定长列表才在卡内滚动。
- 第二条运法:分段切换「Chara 星座运 / Yogini 八运」、一行「现在」、与星程
  同款的年龄刻度尺、紧凑表格,「看小运」原地展开;去掉彩色条和灰色大块。
  年龄刻度尺抽成 chart-age-ruler.tsx,星程和第二条运法共用。

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DbBXoyeZrYn6ryNcSe5Y2Y
2026-11-02 15:07:21 +08:00

23 lines
1.4 KiB
TypeScript
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
import assert from "node:assert/strict";
import { readFileSync } from "node:fs";
import test from "node:test";
import { cssDeclarations } from "./css-contract-test-support.ts";
const boardStyles = readFileSync(new URL("../src/components/chart-board/chart-board.css", import.meta.url), "utf8");
// 原值:`.chart-page-dasha-switch` 是 globals.css 里的下划线页签行(overflow-x: hidden,每个选项 flex: 1 1 0、
// 至少 44×44),两栏布局在 @media (min-width: 1024px) 下
// 新值:第二条运法的切换是 chart-board.css 里的分段胶囊:桌面 40px 高、在标题右侧;手机(≤640px)占满一行,
// 两格等宽,每格 44px 高,不横向滚动
// 原因:2026-11-02 第二条运法按原型改版,下划线页签换成分段胶囊
test("the dasha switch stays inside the column and keeps a 44px hit area", () => {
const pill = cssDeclarations(".chart-dasha .chart-dasha-switch", boardStyles);
assert.match(pill, /border-radius: 999px/);
assert.doesNotMatch(pill, /overflow-x:\s*auto/);
const phone = boardStyles.slice(boardStyles.indexOf("/* 第二条运法 (2026-11-02"));
const media = phone.slice(phone.indexOf("@media (max-width: 640px)"));
assert.match(media, /\.chart-dasha \.chart-dasha-switch \{ display: grid; grid-template-columns: repeat\(2, minmax\(0, 1fr\)\); width: 100%;/);
assert.match(media, /\.chart-dasha \.chart-dasha-switch \.chart-dasha-switch-tab \{ height: 44px;/);
});