From 4e5df3d3c81f32ef472b21a24c090f62ae7c1e51 Mon Sep 17 00:00:00 2001 From: Hugo Gu Date: Tue, 26 May 2026 20:35:04 +0800 Subject: [PATCH] fix(web): address four more PR review comments MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Edge visibility (useSigma.ts): HAS_METHOD / HAS_PROPERTY edges were hidden when any edge-type filter was active because those types are not in the EdgeType union. Normalize HAS_METHOD → DEFINES and HAS_PROPERTY → CONTAINS before the visibleTypes.includes() guard so Kotlin/Java hierarchy edges follow the same filter logic as their semantic equivalents. Force-mode edge styles (graph-adapter.ts): HAS_METHOD / HAS_PROPERTY fell back to the default gray color in the force-graph adapter because EDGE_STYLES had no entries for them. Added explicit entries using the same hues as DEFINES/CONTAINS so force mode renders Kotlin/Java hierarchy edges consistently with tree/circles. Accessibility (GraphCanvas.tsx, locales): the layout-mode switcher (Force / Tree / Circles) had no ARIA semantics. Added role="tablist" on the container and role="tab" + aria-selected on each button. Added the viewModes.label i18n key (used as aria-label on the tablist) to en and zh-CN locale files. Flaky test (graph-adapter.test.ts): replaced the hard 2 s wall-clock assertion with a structural check (node count + edge count) that is deterministic across CI hardware. Timing tests are inherently flaky and provide no correctness signal. Co-authored-by: Claude AI-model: claude-sonnet-4-5 --- gitnexus-web/src/components/GraphCanvas.tsx | 12 +++++++++++- gitnexus-web/src/hooks/useSigma.ts | 13 +++++++++++-- gitnexus-web/src/lib/graph-adapter.test.ts | 15 +++++++++------ gitnexus-web/src/lib/graph-adapter.ts | 5 +++++ gitnexus-web/src/locales/en/graph.json | 1 + gitnexus-web/src/locales/zh-CN/graph.json | 1 + 6 files changed, 38 insertions(+), 9 deletions(-) diff --git a/gitnexus-web/src/components/GraphCanvas.tsx b/gitnexus-web/src/components/GraphCanvas.tsx index e06146cdc..d0880dbe1 100644 --- a/gitnexus-web/src/components/GraphCanvas.tsx +++ b/gitnexus-web/src/components/GraphCanvas.tsx @@ -272,8 +272,14 @@ export const GraphCanvas = forwardRef((_, ref) => { {/* View Mode Tabs */} -
+