Skip to content

fix: serialize compound property types with full detail#21

Merged
Redth merged 1 commit into
mainfrom
fix/compound-property-serialization
Mar 3, 2026
Merged

fix: serialize compound property types with full detail#21
Redth merged 1 commit into
mainfrom
fix/compound-property-serialization

Conversation

@Redth
Copy link
Copy Markdown
Owner

@Redth Redth commented Mar 3, 2026

Summary

Fixes #20 — gradient brushes now include stop colors and offsets in the property API response.

Before

Background: LinearGradientBrush StartPoint={X=0 Y=1}, EndPoint={X=0 Y=0}, Stops=2

After

Background: LinearGradientBrush StartPoint={X=0 Y=1}, EndPoint={X=0 Y=0}, Stops=[#FF0000 0%, #0000FF 100%]

Changes

All in FormatPropertyValue (DevFlowAgentService.cs):

  • LinearGradientBrush — serializes each gradient stop as #RRGGBB NN%
  • RadialGradientBrush — same format, includes center + radius
  • LayoutOptions — shows Alignment + , Expands flag when true
  • LinearItemsLayout — shows Orientation + ItemSpacing
  • GridItemsLayout — shows Span, Orientation, horizontal/vertical spacing

Testing

Verified on Mac Catalyst:

  • Linear gradient: Stops=[#FF0000 0%, #0000FF 100%]
  • Radial gradient with 3 stops: Stops=[#FF6347 0%, #4169E1 50%, #32CD32 100%]
  • LayoutOptions: Fill (no Expands suffix when false) ✅
  • 94/94 tests pass

Fix gradient brushes (LinearGradientBrush, RadialGradientBrush) to
include gradient stop colors and offsets instead of just the count.
Before: 'Stops=2'. After: 'Stops=[#FF0000 0%, #0000FF 100%]'.

Also add rich formatting for:
- LayoutOptions: shows Alignment + Expands flag
- LinearItemsLayout: shows Orientation + ItemSpacing
- GridItemsLayout: shows Span + Orientation + spacing

Fixes #20

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@Redth Redth merged commit 91886dd into main Mar 3, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

GetProperty for Brush returns ToString() which loses gradient stop details

1 participant