Share edge line rendering between the preview and details panel#2002
Draft
kmcginnes wants to merge 1 commit into
Draft
Share edge line rendering between the preview and details panel#2002kmcginnes wants to merge 1 commit into
kmcginnes wants to merge 1 commit into
Conversation
The edge details sidebar hand-rolled its own vertical connector (arrow icons stacked around a gradient CSS line), which misaligned with the arrow heads. Extract the edge style preview's proven line+arrowhead machinery into a shared, orientation-aware EdgeLinePreview so both the horizontal style preview and the vertical details connector draw from the same cytoscape geometry. - Add EdgeLinePreview: line + source/target arrow heads + optional centered label, in "horizontal" or "vertical" orientation. Arrow heads are rotated to point along the edge and pinned by their tip at cytoscape's spacing/gap insets, so the line meets each head correctly in either orientation. - Extract ArrowPrimitiveShape as the shared primitive renderer. - EdgePreview now composes EdgeLinePreview (label included) + node placeholders; geometry resolves once instead of per-arrow-plus-label. - EdgeDetail renders EdgeLinePreview vertically, replacing the hand-rolled connector and its styleForLineStyle gradient helper. It gains an aria-label since the arrows are otherwise visual-only. - Rename DEFAULT_EDGE_PREVIEW_ZOOM to EDGE_PREVIEW_SCALE (mirrors the vertex preview's PREVIEW_SCALE) and separate it from the CSS-zoom fit control. - Add tests: render smoke over every arrow pair x orientation, the label overlay in both orientations, and rotatedBbox unit tests.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
The edge details sidebar hand-rolled its own vertical connector (arrow icons stacked around a gradient CSS line), which misaligned with the arrow heads. Extracted the edge style preview's line + arrow-head machinery into a shared, orientation-aware
EdgeLinePreviewthat renders:gapat each endspacinginset…in
"horizontal"(style preview) or"vertical"(details connector) orientation.EdgePreviewnow composesEdgeLinePreview;EdgeDetailuses it vertically, dropping the hand-rolled connector and itsstyleForLineStylegradient helper.How to read
EdgeLinePreview.tsx— the shared, orientation-aware line + arrow heads + labelEdgePreview.tsx— now composesEdgeLinePreview+ node placeholdersEdgeDetail.tsx— verticalEdgeLinePreview, old switch + gradient helper removedValidation
pnpm checkspasses (types, lint, format);pnpm testpassesEdgeLinePreview.test.tsx— render smoke over every arrow pair × orientation, label overlay in both orientations,rotatedBboxunit testsRelated Issues
Check List
pnpm checkspasses with no errors.pnpm testpasses with no failures.