Skip to content

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

Merged
imbajin merged 1 commit into
apache:masterfrom
hugegraph:fix/hubble-default-label-palette-20261025
Oct 25, 2026
Merged

imbajin merged 1 commit into
apache:masterfrom
hugegraph:fix/hubble-default-label-palette-20261025

Conversation

@imbajin

@imbajin imbajin commented Oct 25, 2026 •

Copy link
Copy Markdown
Member

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.

Source review: hugegraph#100

Visual overview

Deterministic fallback label colors preserving saved styles

Absent vertex-label styles receive deterministic palette colors without persisting defaults. Non-null saved styles, including historical blue and partial styles, keep their existing parsing path. The finite palette may collide; legend text remains essential. Conceptual illustration, not a screenshot or scalability/RC acceptance.

@imbajin
imbajin merged commit 6a4834b into apache:master Oct 25, 2026
18 checks passed
@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.79%. Comparing base (411aca3) to head (6c34884).
⚠️ Report is 25 commits behind head on master.

Additional details and impacted files
@@             Coverage Diff              @@
##             master     #855      +/-   ##
============================================
+ Coverage     51.79%   53.79%   +1.99%     
+ Complexity     5309     3463    -1846     
============================================
  Files           619      282     -337     
  Lines         31606    19242   -12364     
  Branches       3945     2891    -1054     
============================================
- Hits          16370    10351    -6019     
+ Misses        13750     7788    -5962     
+ Partials       1486     1103     -383     

☔ 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.

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