Skip to content

feat: 新增 BarList、SegmentedBar、StatusList、Steps 通用数据对比与步骤原语 - #49

Open
qqqqqf-q wants to merge 3 commits into
mainfrom
feat/memoh-345-data-comparison-primitives
Open

qqqqqf-q wants to merge 3 commits into
mainfrom
feat/memoh-345-data-comparison-primitives

Conversation

@qqqqqf-q

@qqqqqf-q qqqqqf-q commented Dec 1, 2026 •

Copy link
Copy Markdown
Member

关联 Issue

改动内容

  1. 新增 4 个通用数据对比与流程原语组件(src/components/):
    • BarList:单序列排行与多序列分组横向比例对比条(顶部圆点图例、无全宽灰底轨道、全组件共享统一的右侧等宽数值列宽度以保证比例尺严格一致、自动统一小数位)。
    • SegmentedBar:部分占整体的多段构成占比条(分段色条与下方圆点明细行共享悬停弱化联动,悬停过渡与 [data-dimmed] 样式统一收敛至 src/style.css @layer components、自动百分比计算与零分母保护)。
    • StatusList:带语义状态图标(ok / warn / error / info / neutral)与无障碍状态读音(sr-only)的紧凑检查与键值对齐行,支持 divided 细线分隔与右侧辅助说明 meta。
    • Steps:纵向编号与状态步骤流(done / current / warn / upcoming)。
  2. Showcase 独立演示页、基础色板工具与原语字典更新:
    • showcase/specs/:补齐 bar-list.ts、segmented-bar.ts、status-list.ts、steps.ts 四个独立演示规范页并注册至 showcase/specs/index.ts。
    • src/lib/data-tone.ts:统一映射 src/style.css 强调色 Token(--accent-*、--border-hairline)与数值单位格式化,零手写裸颜色或任意圆角;未修改任何存量组件视觉行为。
    • 更新 src/index.ts(经 gen-entry.ts 生成)及 skills/ui-owners/SKILL.md 原语选型字典。

验证结果

  • 自动检查:pnpm type-check(vue-tsc --build)与宿主仓库 node scripts/check-ui-contract.mjs 均零报错通过。
  • 组件库独立 Showcase 明暗同屏实检(Agent 浏览器自检,非人工 QA):

BarList 独立 Showcase 明暗对比

SegmentedBar 独立 Showcase 明暗对比

StatusList 独立 Showcase 明暗对比

Steps 独立 Showcase 明暗对比

  • 宿主集成实时联动与多序列对比实检(保留既有附件):

SegmentedBar 与 StatusList 实时联动

BarList 双序列横向对比

⚠️ No human QA — this PR has not been verified by a human yet. Remove this line once a human confirms the happy path.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Dec 1, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-12-01T07:12:54.401547Z 9e550e3 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 9e550e34f9

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +96 to +97
class="h-full min-w-1 transition-opacity duration-150"
:class="activeHover !== null && activeHover !== item.idx ? 'opacity-40' : ''"

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Move hover appearance into the shared component style layer

The segment and detail-row hover states implement opacity and transition styling directly in the Vue template. This violates the ownership rule in AGENTS.md, which reserves hover appearance for src/style.css under @layer components, mounted through data attributes. Keeping these as utility classes also places them above that shared layer, preventing centralized interaction rules from overriding them normally. Expose the dimmed state through a data attribute and move both selectors and their transitions into the shared stylesheet.

AGENTS.md reference: AGENTS.md:L28-L32

Useful? React with 👍 / 👎.

Comment thread src/components/bar-list/BarList.vue Outdated
:class="cn('w-full space-y-3', props.class)"
>
<div v-if="title || subtitle" class="space-y-0.5">
<h4 v-if="title" class="text-control font-medium leading-snug text-foreground">

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Apply the required section-title font weight

When title is supplied, this section heading uses font-medium, although AGENTS.md explicitly requires section and surface titles to use font-semibold. The same heading pattern is introduced in SegmentedBar, StatusList, and Steps, so all four primitives depart from the documented role-based typography contract. Use font-semibold for these component headings while retaining medium weight for labels and emphasized values.

AGENTS.md reference: AGENTS.md:L161-L161

Useful? React with 👍 / 👎.

Comment thread src/components/bar-list/BarList.vue Outdated
Comment on lines +164 to +166
class="flex items-center justify-between gap-4"
>
<div class="flex min-w-0 flex-1 items-center">

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Give every bar the same available plotting width

When readouts have different lengths, each independent flex row reserves a different width for its value, so the percentage bar widths are calculated against different-sized plotting areas. Consequently, a value of 99 can render a longer bar than 100 because its two-digit readout leaves more room; custom valueLabel strings can amplify the distortion. tabular-nums only equalizes individual digit widths, not the readout columns. Reserve a shared readout-column width across all rows so the common resolvedMax actually produces a common visual scale.

Useful? React with 👍 / 👎.

Comment on lines +81 to +84
<component
:is="row.visual.icon"
v-if="row.visual.icon"
aria-hidden="true"

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Expose the status independently of its hidden icon

For items whose status is not repeated in label or value—for example, { label: 'Database', status: 'error' }—the icon is the only non-color indication of the result, but it is explicitly hidden from assistive technology. The row's data-status does not provide accessible semantics, so screen-reader users hear only “Database” and the placeholder rather than the failure. Add an accessible status label or visually hidden status text so ok, warn, and error remain distinguishable without seeing the icon.

Useful? React with 👍 / 👎.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant