Add per-type label font size to node and edge styling#1930
Open
danielvanza wants to merge 2 commits into
Open
Conversation
Font size was a hardcoded global constant applied only through the generic node/edge Cytoscape selectors, so every type rendered labels at the same size. Add fontSize and minZoomedFontSize to the vertex/edge style cascade (with the existing 7/6 defaults), emit them from the per-type selectors, and expose them as inputs in the node and edge style dialogs. The fields flow through the existing styling import/export as additive optional fields, no export version bump needed. Also drop the node badge's fixed maxWidth truncation, which assumed the old fixed font size and would clip short labels once a larger custom size is set.
useGraphStyles.test.tsx asserted font-size/min-zoomed-font-size only for vertex selectors; add the same coverage on the edge side. Add a small useNodeBadges test asserting the label badge no longer carries the fixed maxWidth that used to clip labels at the old, non-configurable font size.
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.
Summary
node/edgeCytoscape selectors, so every vertex/edge type rendered labels at the same size.fontSizeandminZoomedFontSizeto the vertex/edge style cascade (VertexVisualStyle/EdgeVisualStyle), with the existing 7/6 values as app defaults, so the fields resolve through the existing app-default → shared → user cascade.font-size/min-zoomed-font-sizefrom the per-type Cytoscape selectors, and exposes the two values as inputs in the node and edge style dialogs.STYLING_EXPORT_VERSIONbump needed.maxWidthtruncation, since it assumed the old fixed font size and would clip short labels once a larger custom size is set.Test plan
pnpm checks(types, lint, format)pnpm test— all green except one pre-existing, unrelated flaky test onmain(safeSessionStorage.test.ts, confirmed failing on a clean checkout ofmainas well)