kz930 opened a new pull request, #7257:
URL: https://github.com/apache/texera/pull/7257

   ### What changes were proposed in this pull request?
   
   Three colour settings — Line Chart's Line Color, Continuous Error Bands' 
Fill Color, and Figure Factory Table's Font Color — were plain strings whose 
only statement of what is legal lived in a description. Each now declares a 
`pattern` mirroring `ColorValidator` in plotly's 
`_plotly_utils/basevalidators.py`: 3- or 6-digit hex, an 
`rgb`/`rgba`/`hsl`/`hsla`/`hsv`/`hsva` call, a `var(--…)` variable, or a colour 
name. Empty stays legal, since every one of these paths omits the colour 
argument when the field is blank.
   
   Two details are deliberate. Letters are matched through character classes 
rather than an inline `(?i)`, because the browser compiles the pattern with 
`new RegExp`. And `\s*` sits between every element, because plotly strips 
spaces before matching and really does accept `#ff ffff`; rejecting those would 
make the field stricter than the library it feeds. The colour-name branch is 
lexical, so a misspelling still reaches plotly — matching exactly would mean 
copying plotly's 148 CSS names into the annotation.
   
   ### Why are the changes needed?
   
   Nothing inspected the value before the run, so a mistyped colour aborted a 
workflow inside plotly with an error naming a plotly property rather than the 
field the user filled in: `ValueError: Invalid value of type 'builtins.str' 
received for the 'color' property of scatter.line`.
   
   ### Does this PR introduce any user-facing change?
   
   Yes. The three fields now reject `1`, `#12`, `#ggg`, `#ffff`, `rgb(1,2)` and 
`rgb(-1,2,3)` in the form. Every value that previously produced a chart still 
does.
   
   ### How was this patch tested?
   
   `WorkflowOperator/compile`, `scalafmtCheckAll`, and the three operators' 
descriptor specs (18 tests). The pattern was also read back out of the 
generated schema, compiled with `new RegExp`, and checked against sixteen 
values — ten accepted, six rejected — matching plotly's own verdict on each 
except a misspelled colour name, as noted above.
   
   Closes #7252
   
   Generated-by: Claude Code (Claude Opus 5)
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to