Repository navigation
Add per-type label font size to node and edge styling - #1930
danielvanza wants to merge 2 commits into
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.
|
Hi @danielvanza, thanks for the contribution, and welcome. Per-type font size fits the existing style cascade cleanly, and routing it through the app-default to user layers rather than special-casing it was the right instinct. Fair warning that it's taking me longer than I'd like to get back to reviewing community PRs, so this may sit for a bit. I see you have a few open now, and I will work through them. |
|
Hi @kmcginnes, following up on these contributions when you have review bandwidth. I have updated #1931 and #2239 against current main and cleared their merge conflicts; static checks and the complete local test suites pass (3,354 and 3,345 tests respectively, with the test suite’s expected en-US locale). #1930, #2200, and #2201 are also still mergeable and have no requested changes. GitHub CI checks have not appeared on these community PRs. Could you approve/start the workflows if approval is required, and review them when convenient? Happy to address any further feedback. |
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)