Repository navigation
fix(event-display): apply custom color to line and circular hits and … - #1061
Merged
EdwardMoyse merged 1 commit intoNov 11, 2026
Merged
Conversation
|
🚀 Preview deployed: http://phoenix-pr-1061.surge.sh Built from a9a7772. |
Contributor
Author
|
Hi @EdwardMoyse, Following up on PR #1053, while looking through PhoenixObjects, I noticed that when parseColor was introduced in commit 4be833a for hit types, hitsToCircularPoints and hitsToLines were missed. In addition, hitsToLines was checking hitsParams.color directly on the array instead of reading from the hit parameters, which caused custom line colors to always fall back to the default. I've aligned both with hitsToPoints/hitsToBoxes, cleaned up an undeclared length assignment in getHits, and added unit tests covering custom colors for line hits across hex string formats. Whenever you have a moment, I'd appreciate your review! |
Member
|
Thanks for the fixes! |
This branch was successfully 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.
Summary of Changes
This PR resolves three related issues in
PhoenixObjects.getHitsand its hit-generation methods:Custom colors completely ignored for
Linehits:In
hitsToLines, line color was accessed ashitsParams.color ?? EVENT_DATA_TYPE_COLORS.Hits. SincehitsParamsis an array of hit objects (Hit[]),hitsParams.colorwas alwaysundefined. As a result, custom colors supplied for line hits were completely ignored and always fell back to default hits color.Inconsistent hex color parsing for
LineandCircularPointhits:In commit
4be833ae(fix(app): Fix/sync config to gui #996),parseColorwas introduced so that hex colors in event data without#(e.g.'00ff00') are properly handled. WhilehitsToPointsandhitsToBoxeswere updated to useparseColor,hitsToCircularPointsandhitsToLineswere missed. Both methods now useparseColor(hitsParams[0]?.color) ?? EVENT_DATA_TYPE_COLORS.Hits.Global variable leak & dead code in
getHits:getHits,if (isSimpleArray) length = hitLength;assigned to an undeclared identifierlength, leaking to the global scope (window.lengthin browser environments), and was never used.let positions: any[];was declared and never referenced.Testing
phoenix-objects.test.ts:Lineto the default hit color test suite.Linehits correctly render custom colors in all accepted formats ('00ff00','#00ff00','0x00ff00').