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
Binary file not shown.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,11 @@
Clicked="ApplyButton_Clicked"
AutomationId="Apply"/>
</ContentPage.ToolbarItems>
<Grid ColumnSpacing="3"
RowSpacing="-2"
Padding="1"
RowDefinitions="Auto,Auto,Auto,Auto,Auto,Auto,Auto,Auto,Auto,Auto,Auto,Auto,Auto,Auto,Auto,Auto"
ColumnDefinitions="Auto,Auto">
<Grid ColumnSpacing="3"
RowSpacing="-2"
Padding="1"
RowDefinitions="Auto, Auto, Auto, Auto, Auto, Auto, Auto, Auto, Auto, Auto, Auto, Auto, Auto, Auto, Auto, Auto"
ColumnDefinitions="Auto,Auto">

<!-- Text -->
<Label Grid.Row="0"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
<TapGestureRecognizer Tapped="OnLabelTapped"/>
</Label.GestureRecognizers>
</Label>

<!-- Note: FontAutoScaling states cannot currently be reliably covered in CI environments, as system font scaling settings are not consistently supported or controllable in automated runs. -->
<local:UITestEditor x:Name="EditorControl"
IsCursorVisible="False"
Text="{Binding Text}"
Expand All @@ -29,6 +29,8 @@
IsTextPredictionEnabled="{Binding IsTextPredictionEnabled}"
IsSpellCheckEnabled="{Binding IsSpellCheckEnabled}"
Shadow="{Binding EditorShadow}"
BackgroundColor="{Binding BackgroundColor}"
Opacity="{Binding Opacity}"
MaxLength="{Binding MaxLength}"
SelectionLength="{Binding SelectionLength}"
CursorPosition="{Binding CursorPosition, Mode=TwoWay}"
Expand All @@ -38,6 +40,7 @@
IsEnabled="{Binding IsEnabled}"
FlowDirection="{Binding FlowDirection}"
HeightRequest="{Binding HeightRequest}"
WidthRequest="{Binding WidthRequest}"
FontAttributes="{Binding FontAttributes}"
TextTransform="{Binding TextTransform}"
AutoSize="{Binding AutoSizeOption}"
Expand All @@ -52,7 +55,7 @@
<Button Text="Options"
FontSize="11"
Clicked="NavigateToOptionsPage_Clicked"
AutomationId="OptionsButton"
AutomationId="Options"
Margin="0,10,0,0"/>

<Grid ColumnSpacing="10"
Expand Down Expand Up @@ -84,6 +87,7 @@
Grid.Column="0"/>
<local:UITestEntry x:Name="CursorPositionEntry"
Text="{Binding CursorPosition}"
TextChanged="CursorPositionButton_Clicked"
AutomationId="CursorPositionEntry"
IsCursorVisible="False"
Grid.Row="1"
Expand Down Expand Up @@ -114,4 +118,5 @@
AutomationId="UnfocusedLabel"
FontSize="11"/>
</VerticalStackLayout>
</ContentPage>
</ContentPage>

Original file line number Diff line number Diff line change
Expand Up @@ -28,13 +28,7 @@ public EditorControlMainPage(EditorViewModel viewModel)

private async void NavigateToOptionsPage_Clicked(object sender, EventArgs e)
{
BindingContext = _viewModel = new EditorViewModel();
_viewModel.Text = "Test Editor";
_viewModel.Placeholder = "Enter text here";
_viewModel.VerticalTextAlignment = TextAlignment.End;
_viewModel.CursorPosition = 0;
_viewModel.SelectionLength = 0;
_viewModel.HeightRequest = -1;
_viewModel.Reset();
await Navigation.PushAsync(new EditorOptionsPage(_viewModel));
}

Expand Down Expand Up @@ -129,4 +123,5 @@ private void OnLabelTapped(object sender, EventArgs e)
{
EditorControl.Unfocus();
}
}
}

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,12 @@ private void TextColorButton_Clicked(object sender, EventArgs e)
{
if (sender is Button button)
{
_viewModel.TextColor = button.BackgroundColor;
_viewModel.TextColor = button.AutomationId switch
{
"TextColorRed" => Colors.Red,
"TextColorBlue" => Colors.Blue,
_ => null
};
}
}

Expand All @@ -47,7 +52,12 @@ private void PlaceholderColorButton_Clicked(object sender, EventArgs e)
{
if (sender is Button button)
{
_viewModel.PlaceholderColor = button.BackgroundColor;
_viewModel.PlaceholderColor = button.AutomationId switch
{
"PlaceholderColorRed" => Colors.Red,
"PlaceholderColorBlue" => Colors.Blue,
_ => _viewModel.PlaceholderColor
};
Comment on lines +55 to +60
Copy link

Copilot AI Mar 25, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

PlaceholderColorButton_Clicked doesn’t handle the new PlaceholderColorDefault AutomationId. As a result, tapping the “Default” placeholder color button is a no-op (it falls through to _ => _viewModel.PlaceholderColor), so tests that expect the placeholder color to reset to the default will fail. Update the switch to map PlaceholderColorDefault (and/or the default case) to null so the placeholder color actually resets.

Copilot uses AI. Check for mistakes.
}
}
private void HorizontalAlignmentButton_Clicked(object sender, EventArgs e)
Expand Down Expand Up @@ -79,28 +89,27 @@ private void VerticalAlignmentButton_Clicked(object sender, EventArgs e)
}
}

private void ReturnTypeButton_Clicked(object sender, EventArgs e)
private void MaxLengthButton_Clicked(object sender, EventArgs e)
{
if (sender is Button button)
if (int.TryParse(MaxLengthEntry.Text, out int maxLength))
{
_viewModel.ReturnType = button.AutomationId switch
{
"Done" => ReturnType.Done,
"Next" => ReturnType.Next,
"Go" => ReturnType.Go,
"Search" => ReturnType.Search,
"Send" => ReturnType.Send,
"Default" => ReturnType.Default,
_ => _viewModel.ReturnType
};
_viewModel.MaxLength = maxLength;
}
}

private void MaxLengthButton_Clicked(object sender, EventArgs e)
private void HeightRequest_TextChanged(object sender, TextChangedEventArgs e)
{
if (int.TryParse(MaxLengthEntry.Text, out int maxLength))
if (double.TryParse(HeightRequestEntry.Text, out double heightRequest))
{
_viewModel.MaxLength = maxLength;
_viewModel.HeightRequest = heightRequest;
}
}

private void WidthRequest_TextChanged(object sender, TextChangedEventArgs e)
{
if (double.TryParse(WidthRequestEntry.Text, out double widthRequest))
{
_viewModel.WidthRequest = widthRequest;
}
}

Expand Down Expand Up @@ -179,6 +188,19 @@ private void FontFamilyEditor_TextChanged(object sender, TextChangedEventArgs e)
_viewModel.FontFamily = FontFamilyEntry.Text;
}

private void BackgroundColorButton_Clicked(object sender, EventArgs e)
{
if (sender is Button button)
{
_viewModel.BackgroundColor = button.AutomationId switch
{
"BackgroundColorYellow" => Colors.Yellow,
"BackgroundColorLightBlue" => Colors.LightBlue,
_ => null
};
}
}

private void FlowDirection_CheckedChanged(object sender, CheckedChangedEventArgs e)
{
if (sender == FlowDirectionLeftToRight)
Expand Down Expand Up @@ -231,20 +253,17 @@ private void TextTransform_CheckedChanged(object sender, CheckedChangedEventArgs
}
}

private void FontAttributes_CheckedChanged(object sender, CheckedChangedEventArgs e)
private void FontAttributesCheckBox_CheckedChanged(object sender, CheckedChangedEventArgs e)
{
if (sender == FontAttributesBold)
{
_viewModel.FontAttributes = FontAttributes.Bold;
}
else if (sender == FontAttributesNone)
{
_viewModel.FontAttributes = FontAttributes.None;
}
else if (sender == FontAttributesItalic)
{
_viewModel.FontAttributes = FontAttributes.Italic;
}
var attributes = FontAttributes.None;

if (FontAttributesBoldCheckBox.IsChecked)
attributes |= FontAttributes.Bold;

if (FontAttributesItalicCheckBox.IsChecked)
attributes |= FontAttributes.Italic;

_viewModel.FontAttributes = attributes;
}

private void AutoSize_CheckedChanged(object sender, CheckedChangedEventArgs e)
Expand All @@ -260,4 +279,15 @@ private void AutoSize_CheckedChanged(object sender, CheckedChangedEventArgs e)
_viewModel.AutoSizeOption = EditorAutoSizeOption.Disabled;
}
}
}

private void OpacityEditor_TextChanged(object sender, TextChangedEventArgs e)
{
if (double.TryParse(e.NewTextValue, out double opacity))
{
// Clamp opacity between 0.0 and 1.0
opacity = Math.Clamp(opacity, 0.0, 1.0);
_viewModel.Opacity = opacity;
}
}
}

Loading
Loading