Skip to content
Merged
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
3 changes: 2 additions & 1 deletion .opencode/commands/issue.md
Original file line number Diff line number Diff line change
Expand Up @@ -128,8 +128,9 @@ If that value is blank, stop and ask the user for an issue number before doing a
- For library/test changes (`src/**`, `tests/**`), trigger `build-library.yml`.
- For sample changes (`samples/**`), trigger `build-samples.yml`.
- For template changes (`templates/**`), trigger `build-template.yml`.
- For docs changes (`docs/**`, `mkdocs.yml`, `mkdocs.shared.yml`, `mkdocs.production.yml`), trigger `build-docs.yml`.

Do **not** dispatch `build-docs.yml`. Its `deploy` job has no branch guard, so any `workflow_dispatch` — including from a feature branch — publishes straight to the live GitHub Pages site.
`build-docs.yml`'s `deploy` job only runs for a `release` event, or for `workflow_dispatch` when `github.ref` starts with `refs/tags/`. Dispatching it with `--ref issues/$1` (a branch ref, not a tag) only runs its `build`/`validate` jobs — it is safe to dispatch from a feature branch and will never publish to the live GitHub Pages site. Do not pass a tag ref to `--ref` when dispatching `build-docs.yml` for pre-PR validation.

If none of the changed paths match any of the above, state that no CI workflow applies and continue with local test results only.

Expand Down
7 changes: 4 additions & 3 deletions samples/todoapp/TodoApp.Avalonia/Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,9 @@
<PropertyGroup>
<Nullable>enable</Nullable>
<!-- Keep in sync across all Avalonia.* PackageReferences in this sample tree. -->
<!-- Bumped to resolve NU1903 (GHSA-xrw6-gwf8-vvr9 / CVE-2026-39959) for Tmds.DBus.Protocol,
pulled in transitively via Avalonia.FreeDesktop -> Avalonia.Desktop. See #499. -->
<AvaloniaVersion>11.3.18</AvaloniaVersion>
<!-- Major-version bump from 11.3.18 to the 12.x line (12.1.0, the latest release as of this
writing) for general currency ahead of 11.x reaching end-of-support. See
https://docs.avaloniaui.net/docs/avalonia12-breaking-changes and #507. -->
<AvaloniaVersion>12.1.0</AvaloniaVersion>
</PropertyGroup>
</Project>
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
using Android.App;
using Android.Runtime;
using Avalonia;
using Avalonia.Android;

namespace TodoApp.Avalonia.Android;

// Avalonia 12 changed Android app initialization so that CreateAppBuilder()/CustomizeAppBuilder()
// are handled by an AvaloniaAndroidApplication<TApp> subclass instead of AvaloniaMainActivity<TApp>.
// See https://docs.avaloniaui.net/docs/avalonia12-breaking-changes#android.
[Application]
public class Application : AvaloniaAndroidApplication<App>
{
protected Application(nint javaReference, JniHandleOwnership transfer) : base(javaReference, transfer)
{
}

protected override AppBuilder CustomizeAppBuilder(AppBuilder builder)
{
return base.CustomizeAppBuilder(builder)
.WithInterFont();
}
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
using Android.App;
using Android.Content.PM;
using Avalonia;
using Avalonia.Android;

namespace TodoApp.Avalonia.Android;
Expand All @@ -11,11 +10,6 @@ namespace TodoApp.Avalonia.Android;
Icon = "@drawable/icon",
MainLauncher = true,
ConfigurationChanges = ConfigChanges.Orientation | ConfigChanges.ScreenSize | ConfigChanges.UiMode)]
public class MainActivity : AvaloniaMainActivity<App>
public class MainActivity : AvaloniaMainActivity
{
protected override AppBuilder CustomizeAppBuilder(AppBuilder builder)
{
return base.CustomizeAppBuilder(builder)
.WithInterFont();
}
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android" android:installLocation="auto">
<uses-permission android:name="android.permission.INTERNET" />
<application android:label="TodoApp.Avalonia" android:icon="@drawable/Icon" />
<application android:name=".Application" android:label="TodoApp.Avalonia" android:icon="@drawable/Icon" />
</manifest>
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@
`dotnet build` (not just `dotnet publish`) by SDK default. This CI pipeline only ever runs
`dotnet build` (see build-samples-todoapp-avalonia.yml) - it never publishes with
PublishTrimmed, so no actual IL trimming/linking happens here; the analyzer is purely
diagnostic noise on framework APIs (Avalonia's BindingPlugins.DataValidators, EF Core's
DbContext(DbContextOptions) ctor) that their own maintainers have marked
[RequiresUnreferencedCode]. Setting this also sets EnableTrimAnalyzer=false (see
diagnostic noise on framework APIs (e.g. EF Core's DbContext(DbContextOptions) ctor)
that their own maintainers have marked [RequiresUnreferencedCode]. Setting this also
sets EnableTrimAnalyzer=false (see
Microsoft.NET.ILLink.targets), which disables the analyzer pass itself, not just its
warning output. See https://github.com/CommunityToolkit/Datasync/issues/521.
-->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,6 @@

<ItemGroup>
<PackageReference Include="Avalonia.Desktop" Version="$(AvaloniaVersion)" />
<!--Condition below is needed to remove Avalonia.Diagnostics package from build output in Release configuration.-->
<PackageReference Condition="'$(Configuration)' == 'Debug'" Include="Avalonia.Diagnostics" Version="$(AvaloniaVersion)" />
</ItemGroup>

<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@
because iOS app projects are marked trimmable by the SDK by default. This CI pipeline only
ever runs `dotnet build` (see build-samples-todoapp-avalonia.yml) - it never publishes with
PublishTrimmed, so no actual IL trimming/linking happens here; the analyzer is purely
diagnostic noise on framework APIs (Avalonia's BindingPlugins.DataValidators, EF Core's
DbContext(DbContextOptions) ctor) that their own maintainers have marked
[RequiresUnreferencedCode]. Setting this also sets EnableTrimAnalyzer=false (see
diagnostic noise on framework APIs (e.g. EF Core's DbContext(DbContextOptions) ctor)
that their own maintainers have marked [RequiresUnreferencedCode]. Setting this also
sets EnableTrimAnalyzer=false (see
Microsoft.NET.ILLink.targets), which disables the analyzer pass itself, not just its
warning output. See https://github.com/CommunityToolkit/Datasync/issues/521.
-->
Expand Down
13 changes: 7 additions & 6 deletions samples/todoapp/TodoApp.Avalonia/TodoApp.Avalonia/App.axaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@
using System.IO;
using Avalonia;
using Avalonia.Controls.ApplicationLifetimes;
using Avalonia.Data.Core;
using Avalonia.Data.Core.Plugins;
using Avalonia.Markup.Xaml;
using Avalonia.Threading;
using Microsoft.Data.Sqlite;
Expand Down Expand Up @@ -52,16 +50,19 @@ public override void Initialize()
/// <inheritdoc />
public override void OnFrameworkInitializationCompleted()
{
// Line below is needed to remove Avalonia data validation.
// Without this line you will get duplicate validations from both Avalonia and CT
BindingPlugins.DataValidators.RemoveAt(0);

if (ApplicationLifetime is IClassicDesktopStyleApplicationLifetime desktop)
{
desktop.MainWindow = new MainWindow { DataContext = GetRequiredService<TodoListViewModel>() };
}
else if (ApplicationLifetime is IActivityApplicationLifetime activityLifetime)
{
// Android now uses IActivityApplicationLifetime instead of ISingleViewApplicationLifetime.
// See https://docs.avaloniaui.net/docs/avalonia12-breaking-changes#android.
activityLifetime.MainViewFactory = () => new MainView { DataContext = GetRequiredService<TodoListViewModel>() };
}
else if (ApplicationLifetime is ISingleViewApplicationLifetime singleViewPlatform)
{
// ISingleViewApplicationLifetime is still used by iOS, browser, and embedded Linux platforms.
singleViewPlatform.MainView = new MainView { DataContext = GetRequiredService<TodoListViewModel>() };
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,6 @@
<PackageReference Include="Avalonia" Version="$(AvaloniaVersion)" />
<PackageReference Include="Avalonia.Themes.Fluent" Version="$(AvaloniaVersion)" />
<PackageReference Include="Avalonia.Fonts.Inter" Version="$(AvaloniaVersion)" />
<!--Condition below is needed to remove Avalonia.Diagnostics package from build output in Release configuration.-->
<PackageReference Condition="'$(Configuration)' == 'Debug'" Include="Avalonia.Diagnostics" Version="$(AvaloniaVersion)" />
<PackageReference Include="CommunityToolkit.Datasync.Client" Version="10.1.0" />
<PackageReference Include="CommunityToolkit.Mvvm" Version="8.4.0" />
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="10.0.9" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@
<!-- This TextBox can be used to add new ToDoItems -->
<TextBox Grid.Row="2"
Text="{Binding NewItemContent}"
Watermark="Add a new Item">
PlaceholderText="Add a new Item">
<TextBox.InnerRightContent>
<Button Command="{Binding AddItemCommand}">
<PathIcon Data="{DynamicResource AcceptIconData}"
Expand Down
Loading