Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions src/MauiSherpa.Core/Models/DevFlow/DevFlowModels.cs
Original file line number Diff line number Diff line change
Expand Up @@ -389,6 +389,15 @@ public class DevFlowElementInfo
[JsonPropertyName("nativeProperties")]
public Dictionary<string, string?>? NativeProperties { get; set; }

[JsonPropertyName("semanticDescription")]
public string? SemanticDescription { get; set; }

[JsonPropertyName("semanticHint")]
public string? SemanticHint { get; set; }

[JsonPropertyName("semanticHeadingLevel")]
public string? SemanticHeadingLevel { get; set; }

[JsonPropertyName("children")]
public List<DevFlowElementInfo>? Children { get; set; }
}
Expand Down
42 changes: 41 additions & 1 deletion src/MauiSherpa/Pages/Inspector/DevFlowTreeTab.razor
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,35 @@
}
</div>

<!-- Semantic Properties (from element info) -->
@if (!string.IsNullOrEmpty(selectedElement.SemanticDescription) || !string.IsNullOrEmpty(selectedElement.SemanticHint) || !string.IsNullOrEmpty(selectedElement.SemanticHeadingLevel))
{
<div class="prop-section">
<div class="prop-group-title"><i class="fas fa-universal-access prop-group-icon"></i> Accessibility</div>
@if (!string.IsNullOrEmpty(selectedElement.SemanticDescription))
{
<div class="prop-row">
<span class="prop-key">Description</span>
<span class="prop-value">@selectedElement.SemanticDescription</span>
</div>
}
@if (!string.IsNullOrEmpty(selectedElement.SemanticHint))
{
<div class="prop-row">
<span class="prop-key">Hint</span>
<span class="prop-value">@selectedElement.SemanticHint</span>
</div>
}
@if (!string.IsNullOrEmpty(selectedElement.SemanticHeadingLevel) && !selectedElement.SemanticHeadingLevel.Equals("None", StringComparison.OrdinalIgnoreCase))
{
<div class="prop-row">
<span class="prop-key">Heading Level</span>
<span class="prop-value">@selectedElement.SemanticHeadingLevel</span>
</div>
}
</div>
}

<!-- Gestures -->
@if (selectedElement.Gestures?.Count > 0)
{
Expand Down Expand Up @@ -380,11 +409,17 @@
EnumValues: new[] { "Default", "Chat", "Email", "Numeric", "Plain", "Telephone", "Text", "Url" }),
["AutomationId"] = new(EditorType.Text, "Behavior", SortOrder: 0),
["Text"] = new(EditorType.Text, "Appearance", SortOrder: 0),

// --- Accessibility (SemanticProperties) ---
["SemanticProperties.Description"] = new(EditorType.Text, "Accessibility", SortOrder: 0),
["SemanticProperties.Hint"] = new(EditorType.Text, "Accessibility", SortOrder: 1),
["SemanticProperties.HeadingLevel"] = new(EditorType.Enum, "Accessibility", SortOrder: 2,
EnumValues: new[] { "None", "Level1", "Level2", "Level3", "Level4", "Level5", "Level6", "Level7", "Level8", "Level9" }),
};

private static readonly string[] CommonProperties = PropertyRegistry.Keys.ToArray();

private static readonly string[] GroupOrder = new[] { "Appearance", "Layout", "Behavior", "Transform", "Other" };
private static readonly string[] GroupOrder = new[] { "Appearance", "Layout", "Behavior", "Accessibility", "Transform", "Other" };

private static PropertyMeta GetMeta(string propName)
=> PropertyRegistry.TryGetValue(propName, out var meta) ? meta : new PropertyMeta(EditorType.Text, "Other");
Expand Down Expand Up @@ -2859,6 +2894,11 @@
letter-spacing: 0.04em;
}

.prop-group-icon {
margin-right: 0.25rem;
font-size: 0.65rem;
}

/* Boolean toggle */
.bool-toggle {
display: flex;
Expand Down
Loading