Skip to content

feat: implement colored state labels for storage groups - #4458

Merged
kkdras merged 2 commits into
mainfrom
kkdras.4436
Oct 6, 2026
Merged

kkdras merged 2 commits into
mainfrom
kkdras.4436

Conversation

@kkdras

@kkdras kkdras commented Oct 5, 2026 •

Copy link
Copy Markdown
Contributor

Resolves #4436

Stand (frontend mocks)

CI Results

Test Status: ⚠️ FLAKY

📊 Full Report

Total Passed Failed Flaky Skipped
1298 1293 0 5 0

😟 No changes in tests. 😕

Bundle Size: 🔺

Current: 65.30 MB | Main: 65.30 MB
Diff: +4.38 KB (0.01%)

⚠️ Bundle size increased. Please review.

ℹ️ CI Information
  • Test recordings for failed tests are available in the full report.
  • Bundle size is measured for the entire 'dist' directory.
  • 📊 indicates links to detailed reports.
  • 🔺 indicates increase, 🔽 decrease, and ✅ no change in bundle size.

RetriggerConfidence Score: 5/5 Tier: plus

The PR appears safe to merge; the reviewed changes leave no outstanding finding.

What we checked:

  • Bare group states stay visible: No. The parser supplies a title, and the shared label displays that title when no value is present.

Summary

Storage group states now appear as colored labels with their details, making them easier to scan. The separate Degraded column also uses the shared disk-status label style.

  • Known and unknown states get matching colored or neutral labels.
  • Degraded counts appear in a status label.
  • Disk status helpers read the heavy-danger style from shared severity settings.

Reviews (3) · Last reviewed commit: "fix(storage): clarify state label data a..."

@kkdras

kkdras commented Oct 5, 2026

Copy link
Copy Markdown
Contributor Author

@codex review
@greptile review

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 5, 2026 •

Copy link
Copy Markdown

Codex Review Summary

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

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-05T14:37:56.777041Z f79829a Draft marked ready
ℹ️ 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

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. 🚀

Reviewed commit: a7e0dd1a3b

ℹ️ 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 thread src/containers/Storage/utils/getStorageGroupStateLabel.ts Outdated
Comment thread src/containers/Storage/utils/getStorageGroupStateLabel.ts
@greptile-apps

greptile-apps Bot commented Oct 5, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerTREX TREX

Tested 1 flow, found no issues. Could not complete testing for 1 other flow.

What we tested

  • Pass — VDisk and PDisk status details ▶
  • Incomplete — Storage group state labels ▶

@kkdras

kkdras commented Oct 5, 2026

Copy link
Copy Markdown
Contributor Author

@codex review
@greptile review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. 🎉

Reviewed commit: f79829a054

ℹ️ 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".

@kkdras
kkdras marked this pull request as ready for review October 5, 2026 14:33
Copilot AI balanced review requested due to automatic review settings October 5, 2026 14:33

@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: f79829a054

ℹ️ 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 thread src/containers/Storage/utils/getStorageGroupStateLabel.ts

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copilot review overview

🟡 Changes recommended

Known state titles bypass the repository’s localization pattern.

Review effort: Balanced
Findings: 1 Medium severity

Open (1)
What changed in this PR

Adds colored status labels for storage-group state and degradation data.

Changes:

  • Parses group states into themed labels with focused tests.
  • Reuses shared severity styling, including heavy-danger labels.
  • Updates storage table rendering for state and degraded columns.
File Description
src/​utils/​disks/​constants.ts Adds heavy-danger severity metadata.
src/​containers/​Storage/​utils/​getStorageGroupStateLabel.ts Parses states into label data.
src/​containers/​Storage/​utils/​__test__/​getStorageGroupStateLabel.test.ts Tests state parsing and styling.
src/​containers/​Storage/​PaginatedStorageGroupsTable/​columns/​columns.tsx Renders state and degradation labels.
src/​components/​VDiskStatus/​statuses.ts Reads heavy-danger styling from shared configuration.
src/​components/​PDiskInfo/​statuses.ts Uses shared label visual configuration.
src/​components/​DiskStatus/​DiskStatus.tsx Supports labels with a required title and optional value.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread src/containers/Storage/utils/getStorageGroupStateLabel.ts

kkdras commented Oct 6, 2026

Copy link
Copy Markdown
Contributor Author

@astandrik, /storage/groups currently returns a compound State, such as degraded:2(3,1). To render the label, we extract the status and count: degraded:1 is yellow, while degraded:2 is red. The details in parentheses are preserved for display.

Would you be okay with parsing this format on the frontend? Backend PR #55274 adds structured StateInfo with Status, Count, and FailedDomainsPerRealm. I suggest using those fields when available and keeping the State parser as a fallback for older backend versions.

@astandrik

Copy link
Copy Markdown
Contributor

@kkdras, давай сразу добавим чтение StateInfo в этот PR, а разбор State оставим fallback для ответов без нового поля. Так на новых backend не будем зависеть от формата строки, а старые продолжат работать.

Для fallback важно разбирать фактический формат State и сохранять детали в скобках. MissingDisks вместо числа из State брать нельзя: у mirror-3-dc это разные величины. Добавь, пожалуйста, тесты на одинаковое отображение обоих вариантов, отсутствие StateInfo и неизвестный формат State.

kkdras commented Oct 6, 2026

Copy link
Copy Markdown
Contributor Author

@astandrik, I've created #4469 as a follow-up to add StateInfo support once the backend changes are deployed, keeping the existing State parser as a fallback for older backends.

We can keep the current implementation in this PR and proceed with the review without waiting for the backend rollout.

@astandrik astandrik left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Проверено:

  • Разбор State по backend-контракту: mirror-3-dc, детали в скобках, пустые и неизвестные состояния.
  • 50 unit-тестов и embedded-сборки base/head — прошли.
  • 15 состояний в Chromium/WebKit на mock API, светлая и тёмная темы. CI зелёный; 5 E2E прошли после retry.

Неблокирующее замечание: новый бейдж Missing Disks не помещается в стандартную ширину колонки и получает лишнее многоточие. Стоит увеличить width и resizeMinWidth.

StateInfo оставляем для #4469.

@kkdras
kkdras added this pull request to the merge queue Oct 6, 2026
Merged via the queue into main with commit 460eed1 Oct 6, 2026
24 checks passed
@kkdras
kkdras deleted the kkdras.4436 branch October 6, 2026 15:20
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.

Implement changes for colored state labels to Storage → Groups

3 participants