Skip to content

优先级 P0–P3 使用不同的颜色标注 #60

Open

Description

@jacksonw111

This was generated by AI during triage.

用例的优先级(P0–P3)使用不同的颜色标注,使高优先级的用例容易看出。

这个需求修改 #22 的决定。#22 规定优先级不用颜色:等宽字体的 P0–P3 文字,只有 P0 加粗。维护者在 triage 中确认改为下面的配色,并且所有位置一致。

优先级 样式
P0 红色实底、白字、加粗
P1 琥珀色浅底
P2 蓝色浅底
P3 灰色描边

P0 用实底。执行结果「失败」用浅红底,所以两个标签放在一起时可以区分。

Activity

  1. added
    enhancement
    ready-for-agent
    on Oct 15, 2026
  2. jacksonw111 commented on Oct 15, 2026

    @jacksonw111
    CollaboratorAuthor

    This was generated by AI during triage.

    Agent Brief

    Category: enhancement
    Summary: 优先级 P0–P3 使用不同的颜色,所有显示优先级的位置一致

    Current behavior:
    统一状态标签 StatusBadge 的 kind="priority" 通过 priorityTone() 得到 priority 或 priority-strong 两种 tone。两种 tone 都没有颜色:等宽字体(numeric),没有内边距,只有 P0 加粗。脑图的 buildPriorityTag() 使用同一组 tone,样式写在脑图标签的 tone 样式表中。用例列表的优先级筛选按钮(ToggleGroup)单独实现,也不用颜色。

    Desired behavior:
    每个优先级有自己的样式。所有颜色使用现有主题令牌,亮色和暗色模式都要达到 WCAG AA 对比度:

    • P0:实底 destructive,文字 destructive-foreground,加粗
    • P1:浅底 warning-soft,文字 warning-soft-foreground,边框 warning/20
    • P2:浅底 info-soft,文字 info-soft-foreground,边框 info/20
    • P3:透明底,灰色描边(与现有 outline tone 相同的颜色),文字 muted-foreground

    标签继续显示 P0–P3 文字和等宽字体。标签有正常的内边距,与其他统一状态标签的形状一致。

    下面的位置都使用这组样式:

    • 用例列表的表格
    • 用例详情的头部
    • 版本历史(快照和对比)
    • 项目概览(优先级卡片和未执行用例列表)
    • 脑图的优先级标签
    • 优先级筛选按钮:按下的按钮使用这个优先级的样式;没有按下的按钮可以只用这个优先级的文字颜色或一个色点,要求一眼能看出对应关系

    Key interfaces:

    • StatusTone:用每个优先级各自的 tone 替换 priority 和 priority-strong(例如 priority-p0 到 priority-p3),并在 STATUS_TONE_CLASSES 中给出样式
    • priorityTone(priority: CasePriority): StatusTone:每个优先级返回自己的 tone。如果 isStrongPriority() 不再使用,就删除
    • 脑图标签的 tone 样式表:增加相同的四种 tone,颜色用 CSS 变量,与 StatusBadge 一致
    • 更新说明「优先级不用颜色」的注释

    Acceptance criteria:

    • StatusBadge kind="priority" 对 P0–P3 渲染四种不同的 data-tone,每种 tone 的 class 与上面的样式一致
    • P0 标签和执行结果「失败」标签的 class 不同(实底与浅底)
    • 脑图的 buildPriorityTag() 对 P0–P3 返回四种不同的背景或边框,颜色与 StatusBadge 使用同一组 CSS 变量
    • 优先级筛选按钮对每个优先级使用对应的颜色,按下和没有按下的状态可以区分
    • 代码中不再有写死的优先级颜色值;只使用主题令牌
    • 单元测试覆盖每个优先级的 tone 和样式(表格驱动);每个文件的测试覆盖率不下降
    • pnpm dlx ultracite check 和 web 的类型检查通过

    Out of scope:

    • 不改优先级的取值和含义
    • 不改执行结果、测试任务状态、用例状态和版本变化的颜色
    • 不改概览图表中的条形颜色(bg-chart-*)
    • 不加新的主题令牌;现有令牌的对比度不够时,停止工作并报告
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementready-for-agent

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions