Repository navigation
Conversation
kmcginnes
force-pushed
the
validate-styling-file-colors
branch
from
November 25, 2026 00:42
2872ada to
aa070a3
Compare
This branch has not been deployed
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
Color fields in styling files and stored styles accepted any string. A value the app can't parse took down the graph and schema views until browser storage was cleared, and a blank edge label color broke the import preview.
User-facing: A styling file with a color that isn't hex,
rgb(),hsl(),hwb(), or a color name now fails to load, and a dialog lists each type, field, and value to fix. Stored styles with an unusable color fall back to the default instead of breaking the app.isAllowedColorValue(utils/), built on thecolorlibrary the app already uses. Callers trim spaces before or after a color first, since the renderers can't read a padded value.stylingParserrejects non-color values in all five color fields (vertexcolor,borderColor; edgelineColor,labelColor,labelBorderColor). A padded color is trimmed and stored trimmed. Blank colors still import, for older files.transformEdgeStyles. This also covers backup restores.buildStyleImportPlannow runs incoming entries through the same transforms, so the preview and the write see the same cleaned styles.useApplyStyleImportno longer transforms on its own.Validation
Before: A styling file with
"labelColor": "nope"imported, and the graph and schema views threw on every load. A file with"labelColor": ""threw as soon as the import preview opened.After: The file is rejected with a dialog listing each bad value:
Verified live: Settings → Styles → Load, in Firefox, against the dev server on this branch. Unparseable and non-color values were rejected per field. In Chrome, a padded
" #fff "loaded as#fff, and padded colors saved by an older version were trimmed on reload. A file with blank edge label colors opened the preview and applied without errors. Valid hex,rgb(), andhsl()colors loaded as before.Related Issues
Check List
pnpm checkspasses with no errors.pnpm testpasses with no failures.