Skip to content

fix(overview): 同步组件状态磁贴的图标和颜色 - #94

Merged
Yundi339 merged 1 commit into
AlkaidLab:mainfrom
WatchKitty:fix/overview-component-status
Nov 30, 2026
Merged

Yundi339 merged 1 commit into
AlkaidLab:mainfrom
WatchKitty:fix/overview-component-status

Conversation

@WatchKitty

Copy link
Copy Markdown
Contributor

补充 #87。系统页已用灰色下载图标表示未安装,概览仍把未安装、警告和故障都画成红色感叹号。

系统页和概览共用状态映射。未安装显示灰色下载图标,警告为黄色,故障为红色。覆盖方形、中型和备用磁贴。

Node.js 22 下相关测试 18 项通过。全量测试 2420 项通过,跳过 3 项。Gallery 构建通过。

@coderabbitai

coderabbitai Bot commented Nov 28, 2026 •

Copy link
Copy Markdown

Explain Change →

No actionable comments were generated in the recent review.

Summary

Summary by CodeRabbit

  • 界面优化
    • 组件状态卡片和状态图标现在会根据正常、警告、错误、缺失或未知状态显示相应的颜色与图标。
  • 测试
    • 补充了不同组件状态及卡片尺寸的显示验证。

新增共享的组件状态外观映射,并在状态芯片、组件卡片和瓦片中使用。CSS 根据状态色调显示不同配色。新增 SSR 测试,覆盖多种状态及不同尺寸的展示。

Changes: 组件状态外观

Layer / File(s) Summary
共享状态外观与视图接入
src/status/model.js, src/vue/MComponentStatus.vue, src/vue/MDashComponent.vue, src/vue/homeSmall.js, src/vue/tiles/TileComponent.vue
新增 componentStateAppearance(state),为 ok、warn、error、missing 和 unknown 状态返回色调与图标。状态芯片、组件卡片和瓦片改为使用此映射。
卡片与瓦片状态配色
src/vue/MDashCardView.vue, src/css/dash.css, src/css/tiles-b2.css
组件小卡片启用专用样式。卡片头像使用当前瓦片颜色;瓦片状态图标和面板根据 data-tone 应用颜色。
状态外观渲染验证
test/component-status-tiles.test.js
新增 SSR 测试,检查多种 Vulkan 状态在小、中尺寸卡片及回退展示中的图标和色调。

Estimated code review effort: 2 (Simple) | ~12 minutes

Change: Bug fix

Suggested reviewers: skyhua0224, yundi339

Merge Risk: Minimal · up to 2d31c

This change makes the overview and system page use one status mapping. Not-installed components get a gray download icon, warnings are yellow, and faults are red. No concrete merge-blocking risk was found.

Pre-merge checks: Passed 4

Check name Status Explanation
Title check Passed 标题描述了主要变更:同步组件状态磁贴的图标和颜色。变更涉及 model.js 新增 componentStateAppearance,并在概览磁贴与状态组件中统一使用,与标题一致。
Description check Passed 描述说明了问题(系统页用灰色下载图标表示未安装,概览仍用红色感叹号)、共用状态映射的做法(未安装灰色下载图标,警告黄色,故障红色)、覆盖的磁贴类型以及测试结果。与变更内容直接相关。
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Finishing Touches

Generate unit tests (beta)

  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

小兔看见状态新装扮,
图标随色调轻轻变换。
警告与错误各有颜色,
正常与缺失也能辨认。
测试逐一照亮每张卡片,
兔耳一竖,欢快地称赞!

Recent review info

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 5d650817-fbf2-4223-8edc-3fddc30546ef
Commits

Reviewing files that changed from the base of the PR and between c0cfbeb and 2d31c68.

Files selected for processing: 9

  • src/css/dash.css
  • src/css/tiles-b2.css
  • src/status/model.js
  • src/vue/MComponentStatus.vue
  • src/vue/MDashCardView.vue
  • src/vue/MDashComponent.vue
  • src/vue/homeSmall.js
  • src/vue/tiles/TileComponent.vue
  • test/component-status-tiles.test.js

Included review availability: This review used your included allowance. Your plan provides up to 1 included review per hour; 0 remain after this review.

@Yundi339
Yundi339 merged commit 169dd54 into AlkaidLab:main Nov 30, 2026
7 checks passed
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.

2 participants