Skip to content

fix(hubble): distinguish unstyled vertex labels with stable colors - #100

Closed
imbajin wants to merge 1 commit into
masterfrom
fix/hubble-default-label-palette-20261025
Closed

imbajin wants to merge 1 commit into
masterfrom
fix/hubble-default-label-palette-20261025

Conversation

@imbajin

@imbajin imbajin commented Oct 25, 2026 •

Copy link
Copy Markdown

Labels imported through the Server API without a saved ~style currently share the same blue, so the canvas and legend do not distinguish Person, Team and Project. Generate a deterministic palette color from the vertex-label name only when ~style is absent. Default reads remain read-only.

All non-null saved styles keep the existing parsing path, including explicit blue, partial styles and historical Hubble-created blue defaults. Those historical defaults cannot be distinguished from a user's choice, so they are preserved. The palette is finite and does not promise collision-free colors for unlimited labels; the existing legend text remains visible.

Validation:

  • Three focused JUnit tests pass for stable colors across read order and individual reads, no default persistence, complete custom-blue preservation and partial saved-style compatibility. The offline JDK 17 reactor compile, candidate SDK input guard and Checkstyle passed. An independent static review found no further issues.
  • Real Chromium 154 against isolated candidate backend/frontend, using the same real graph seeded with 3,000 vertices and 6,000 edges. Three community queries each rendered 125 vertices and 250 edges; the second community was repeated after a full page reload.
  • Five actual UI schema responses consistently returned Person #785FC1, Team #16817D, Project #B07724. The canvas and text-labelled legend were visually checked. Direct Server schema readback still had no saved ~style for these labels.
  • No page exceptions or HTTP/business API failures during this browser session. Four existing Ant Design Drawer/Table deprecation warnings remain. The three measured query action-to-paint times were 1.54 s, 1.23 s and 1.11 s on this small local test; these are observations, not a scalability benchmark.
  • Current-head GitHub Module validation run 40186956414 passed, including the Hubble candidate job. CodeRabbit reported its review quota was exhausted, so its success status is not a substantive completed review.

Screenshot comparison: the before and after captures use the same community_01 query and real 125-vertex/250-edge result, captured before a separate temporary CRUD probe. The graph has since been restored to exactly 3,000 vertices and 6,000 edges, with full normalized data hashes and schema matching the initial baseline. Before: all three labels blue. After: purple Person, teal Team and ochre Project, with readable legend text. A second after capture confirms the colors after page reload on community_02.

Screenshot binaries, browser receipts and logs remain outside Git under the user's explicit instruction. The regression and screenshot record requires Page access; GitHub-native image upload is unavailable in this session. The paired before/after captures, page-reload capture and read-only verification record are published together in issue 38 · 默认多标签同蓝 on that Page (publication read back at revision 108). These are private Page attachments, not anonymous GitHub image URLs.

Based on freshly verified org and ASF master 8eb5de9009d494842f6b8ee58b83e1f1248c8aff. Verified source head: 6c34884bd9987c5ac02ae6ac5b26e6231dac1efd. The change is three files, 140 additions and one deletion.

Upstream apache#855 is merged and this org source mirror is closed. The two later palette review findings are fixed in the still-open ASF #857, through the shared org #102 branch: palette commit cabc56a5, also included in current 5a5d45cd.

Only two slots change: default-blue collision → #758700; the near-tan person/Project slot → berry #B12C86. The other ten slots, hashing and all saved-style handling are preserved. Twenty-four focused backend tests, compilation and Checkstyle pass; both new palette regressions fail on the previous palette. Tests check white-background stroke contrast and the actual 0.4-opacity fills, not just unequal hex strings.

Five additional screenshots are now embedded directly beside issue 38 in the Hubble record, read back at revision 120: the precise-label fixture comparison/reload and two native candidate-backend community01 captures at 125 vertices/250 edges. The fixture uses real service DTOs with controlled API responses; the separate native queries use the actual existing 3000-vertex/6000-edge graph. Schema/user_data and counts remain unchanged. A receipt-finalization harness mistake is retained and corrected separately; it was not a business/API failure. Pictures retain their cabc56a5 version and remain outside Git.

All three org review threads were verified resolved before this mirror was closed. Current-head ASF apache#857 validation run 40214549649 passed on shared head 5a5d45cd; this does not replace the historical validation recorded above.

@coderabbitai

coderabbitai Bot commented Oct 25, 2026

Copy link
Copy Markdown

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 34 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

Learn how review limits work.

Review configuration:

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: d62e9339-1d59-4e5c-aa81-490452d9dc97
Commits

Reviewing files that changed from the base of the PR and between 8eb5de9 and 6c34884.

Files selected for processing: 3
  • hugegraph-hubble/hubble-be/src/main/java/org/apache/hugegraph/service/schema/VertexLabelService.java
  • hugegraph-hubble/hubble-be/src/test/java/org/apache/hugegraph/unit/UnitTestSuite.java
  • hugegraph-hubble/hubble-be/src/test/java/org/apache/hugegraph/unit/VertexLabelStyleDefaultsTest.java
  • 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

Comment @coderabbitai help to get the list of available commands.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 25, 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-25T11:00:08.435317Z 6c34884 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: 6c34884bd9

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

@codecov

codecov Bot commented Oct 25, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 53.78%. Comparing base (8e6ed84) to head (6c34884).
⚠️ Report is 33 commits behind head on master.

Additional details and impacted files
@@             Coverage Diff              @@
##             master     #100      +/-   ##
============================================
+ Coverage     47.04%   53.78%   +6.74%     
+ Complexity     4518     3463    -1055     
============================================
  Files           602      282     -320     
  Lines         29448    19242   -10206     
  Branches       3454     2891     -563     
============================================
- Hits          13854    10350    -3504     
+ Misses        14312     7789    -6523     
+ Partials       1282     1103     -179     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@imbajin imbajin left a comment

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

独立 + 交叉对抗性 Review

评分:9.1 / 10
结论:实现简洁、确定性明确,当前 head 未发现新的功能阻塞,可合入。

本轮锁定 exact head 6c34884bd9,独立检查颜色映射的稳定性、负 hash、保存样式兼容、读路径副作用以及测试能否区分“未保存样式”和“用户显式选择蓝色”。

复核结论

  • 固定 12 色 palette 配合 Math.floorMod(name.hashCode(), size),同一 label 名称不受 API 返回顺序、分页或进程重启影响,并正确处理负 hash。
  • 仅在 ~style 完全不存在时生成颜色;任何非 null 的历史或用户样式继续走原 JSON 解析路径,显式蓝色及 partial style 均不会被覆盖。
  • 默认颜色只存在于返回 DTO,不写回 Server userdata,读取保持只读。
  • 测试覆盖重排后稳定性、单独读取一致性、显式蓝色完整字段保留、partial style 默认值和无持久化副作用。
  • exact-head Module validation 40186956414 已通过。

非阻塞边界

有限 palette 不保证无限 label 无碰撞,但 legend 文本仍可区分,且本 PR 没有承诺无冲突分配;不建议为此引入持久颜色注册表或额外状态。

@bitflicker64 bitflicker64 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Blocking: no. Score: 9/10 (10 - 0.5 - 0.5). Covers 6c34884.

The fallback is deterministic: String.hashCode is fixed by the Java spec, so floorMod(name.hashCode(), 12) gives the same color across reloads, restarts and JVMs, and saved ~style values are still read unchanged. Two small palette issues are noted inline. With 12 slots, a graph with 3 unstyled labels has about a 24% chance of a shared color, and one with 5 labels about 62%. person/account and transaction/device already share a color. The PR already accepts this limit.

Evidence: VertexLabelStyleDefaultsTest passes locally (3/3, offline mvn test -pl hugegraph-hubble/hubble-be -am). It runs in CI through UnitTestSuite, and the step passed in the candidate job. On the base it would fail, because all three labels get #5C73E6. A script reimplementing the hash checked common label sets, and every palette color has at least 3.08:1 stroke contrast on white. Node label text stays #343434. All checks pass or are skipped.

imbajin commented Oct 25, 2026

Copy link
Copy Markdown
Author

Closing this org review mirror after the original palette change merged upstream as apache#855. The two subsequent palette findings are fixed in cabc56a and carried on the still-open shared branch for apache#857 / org #102, now read back at 5a5d45c. All three inline threads here are resolved; this does not rewrite the historical apache#855 source.

The five new before/after/reload images are embedded directly under Issue 38 of the Hubble record, read back at Page revision120 (Page access required). Controlled fixture images cover vertex/person/movie/saved_blue/default_edge; separate native images cover the unchanged existing community01 125-vertex/250-edge query, including reload. The receipt explicitly retains the harness metadata-field correction and confirms the real Server's user_data, unchanged full schema, and3000/6000 counts. No screenshot or run output was committed to Git.

All24 focused backend tests, compilation and Checkstyle passed. Current shared-head remote CI is pending; closing the mirror does not claim CI success or completion of the separately recorded AUTOMATIC-ID follow-up. The active upstream review continues at apache#857.

@imbajin imbajin closed this Oct 25, 2026
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