Skip to content

Commit 6c38cab

Browse files
Merge pull request #61 from fIyingPhoenix/main
Starting
2 parents 8a52b76 + 61e58a2 commit 6c38cab

96 files changed

Lines changed: 889 additions & 59822 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/dotnet.yml

Lines changed: 39 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
name: Trion CI
2-
32
on:
43
push:
54
branches: [ main, dev ]
@@ -12,49 +11,81 @@ jobs:
1211
strategy:
1312
matrix:
1413
os: [ubuntu-latest, windows-latest]
15-
1614
steps:
1715
- name: Checkout
1816
uses: actions/checkout@v4
1917

20-
- name: Setup .NET 9
18+
# Setup .NET 9 runtime
19+
- name: Setup .NET 9
2120
uses: actions/setup-dotnet@v4
2221
with:
2322
dotnet-version: 9.0.x
2423

25-
- name: Install .NET workloads
26-
run: dotnet workload install aspire wasm-tools
24+
# MAUI is Windows-only, skip on Linux to avoid workload installation errors
25+
- name: Install MAUI workload (Windows)
26+
if: matrix.os == 'windows-latest'
27+
run: dotnet workload install maui
28+
29+
# wasm-tools needed for web projects on all platforms
30+
- name: Install wasm-tools workload
31+
run: dotnet workload install wasm-tools
2732

28-
- name: Restore
33+
# RESTORE: Windows restores everything, Linux only restores Web project
34+
# This prevents MAUI-tizen dependency errors on Linux runners
35+
- name: Restore (Windows - all projects)
36+
if: matrix.os == 'windows-latest'
2937
run: dotnet restore
3038

31-
- name: Build
39+
- name: Restore (Linux - web only)
40+
if: matrix.os == 'ubuntu-latest'
41+
run: dotnet restore src/Trion.Web/Trion.Web.csproj
42+
43+
# BUILD: Split build steps by OS to avoid Desktop project compilation on Linux
44+
# Windows builds Desktop (MAUI) + Web, Linux builds Web only
45+
- name: Build (Windows - all projects)
46+
if: matrix.os == 'windows-latest'
3247
run: dotnet build -c Release --no-restore --warnaserror
3348

34-
- name: Test
49+
- name: Build (Linux - web only)
50+
if: matrix.os == 'ubuntu-latest'
51+
run: dotnet build src/Trion.Web/Trion.Web.csproj -c Release --no-restore --warnaserror
52+
53+
# TEST: Run unit tests only on relevant projects per platform
54+
- name: Test (Windows - all)
55+
if: matrix.os == 'windows-latest'
3556
run: dotnet test -c Release --no-build --logger trx --collect:"XPlat Code Coverage"
3657

58+
- name: Test (Linux - web only)
59+
if: matrix.os == 'ubuntu-latest'
60+
run: dotnet test src/Trion.Web/Trion.Web.csproj -c Release --no-build --logger trx --collect:"XPlat Code Coverage"
61+
62+
# PUBLISH DESKTOP: Windows only - creates self-contained single-file exe
3763
- name: Publish desktop (Windows)
3864
if: matrix.os == 'windows-latest'
3965
run: dotnet publish src/Trion.Desktop/Trion.Desktop.csproj -c Release -r win-x64 --self-contained true -p:PublishSingleFile=true -o artifacts/desktop
4066

67+
# PUBLISH WEB: Both platforms - portable web app deployment
4168
- name: Publish web (portable)
4269
run: dotnet publish src/Trion.Web/Trion.Web.csproj -c Release -o artifacts/web
4370

71+
# ARTIFACT UPLOADS
72+
# Upload test results from both platforms
4473
- name: Upload test results
4574
if: always()
4675
uses: actions/upload-artifact@v4
4776
with:
4877
name: test-results-${{ matrix.os }}
4978
path: '**/*.trx'
5079

80+
# Upload code coverage to codecov (Linux only to avoid duplicates)
5181
- name: Upload coverage
5282
if: matrix.os == 'ubuntu-latest'
5383
uses: codecov/codecov-action@v4
5484
with:
5585
token: ${{ secrets.CODECOV_TOKEN }}
5686
files: '**/coverage.cobertura.xml'
5787

88+
# Upload all build artifacts (desktop exe on Windows, web files on both)
5889
- name: Upload build artifacts
5990
uses: actions/upload-artifact@v4
6091
with:

Trion.sln

Lines changed: 15 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Trion.Core", "src\Trion.Cor
1717
EndProject
1818
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Trion.Web", "src\Trion.Web\Trion.Web.csproj", "{C99FA784-527A-433A-8892-71A951DF63CE}"
1919
EndProject
20-
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Trion.Desktop", "src\Trion.Desktop\Trion.Desktop.csproj", "{8976C35D-279D-4B29-B769-C72BA79201DD}"
20+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Trion.Desktop", "src\Trion.Desktop\Trion.Desktop.csproj", "{75DB2555-FFE9-459B-B0E6-092D892FBE85}"
2121
EndProject
2222
Global
2323
GlobalSection(SolutionConfigurationPlatforms) = preSolution
@@ -89,18 +89,19 @@ Global
8989
{C99FA784-527A-433A-8892-71A951DF63CE}.Release|x64.Build.0 = Release|Any CPU
9090
{C99FA784-527A-433A-8892-71A951DF63CE}.Release|x86.ActiveCfg = Release|Any CPU
9191
{C99FA784-527A-433A-8892-71A951DF63CE}.Release|x86.Build.0 = Release|Any CPU
92-
{8976C35D-279D-4B29-B769-C72BA79201DD}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
93-
{8976C35D-279D-4B29-B769-C72BA79201DD}.Debug|Any CPU.Build.0 = Debug|Any CPU
94-
{8976C35D-279D-4B29-B769-C72BA79201DD}.Debug|x64.ActiveCfg = Debug|Any CPU
95-
{8976C35D-279D-4B29-B769-C72BA79201DD}.Debug|x64.Build.0 = Debug|Any CPU
96-
{8976C35D-279D-4B29-B769-C72BA79201DD}.Debug|x86.ActiveCfg = Debug|Any CPU
97-
{8976C35D-279D-4B29-B769-C72BA79201DD}.Debug|x86.Build.0 = Debug|Any CPU
98-
{8976C35D-279D-4B29-B769-C72BA79201DD}.Release|Any CPU.ActiveCfg = Release|Any CPU
99-
{8976C35D-279D-4B29-B769-C72BA79201DD}.Release|Any CPU.Build.0 = Release|Any CPU
100-
{8976C35D-279D-4B29-B769-C72BA79201DD}.Release|x64.ActiveCfg = Release|Any CPU
101-
{8976C35D-279D-4B29-B769-C72BA79201DD}.Release|x64.Build.0 = Release|Any CPU
102-
{8976C35D-279D-4B29-B769-C72BA79201DD}.Release|x86.ActiveCfg = Release|Any CPU
103-
{8976C35D-279D-4B29-B769-C72BA79201DD}.Release|x86.Build.0 = Release|Any CPU
92+
{75DB2555-FFE9-459B-B0E6-092D892FBE85}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
93+
{75DB2555-FFE9-459B-B0E6-092D892FBE85}.Debug|Any CPU.Build.0 = Debug|Any CPU
94+
{75DB2555-FFE9-459B-B0E6-092D892FBE85}.Debug|Any CPU.Deploy.0 = Debug|Any CPU
95+
{75DB2555-FFE9-459B-B0E6-092D892FBE85}.Debug|x64.ActiveCfg = Debug|Any CPU
96+
{75DB2555-FFE9-459B-B0E6-092D892FBE85}.Debug|x64.Build.0 = Debug|Any CPU
97+
{75DB2555-FFE9-459B-B0E6-092D892FBE85}.Debug|x86.ActiveCfg = Debug|Any CPU
98+
{75DB2555-FFE9-459B-B0E6-092D892FBE85}.Debug|x86.Build.0 = Debug|Any CPU
99+
{75DB2555-FFE9-459B-B0E6-092D892FBE85}.Release|Any CPU.ActiveCfg = Release|Any CPU
100+
{75DB2555-FFE9-459B-B0E6-092D892FBE85}.Release|Any CPU.Build.0 = Release|Any CPU
101+
{75DB2555-FFE9-459B-B0E6-092D892FBE85}.Release|x64.ActiveCfg = Release|Any CPU
102+
{75DB2555-FFE9-459B-B0E6-092D892FBE85}.Release|x64.Build.0 = Release|Any CPU
103+
{75DB2555-FFE9-459B-B0E6-092D892FBE85}.Release|x86.ActiveCfg = Release|Any CPU
104+
{75DB2555-FFE9-459B-B0E6-092D892FBE85}.Release|x86.Build.0 = Release|Any CPU
104105
EndGlobalSection
105106
GlobalSection(SolutionProperties) = preSolution
106107
HideSolutionNode = FALSE
@@ -111,7 +112,7 @@ Global
111112
{8F4FA8F8-6064-41DC-B0B8-4394373EBC83} = {827E0CD3-B72D-47B6-A68D-7590B98EB39B}
112113
{7489FB6C-F47B-4178-B5DD-20D8F4608728} = {827E0CD3-B72D-47B6-A68D-7590B98EB39B}
113114
{C99FA784-527A-433A-8892-71A951DF63CE} = {827E0CD3-B72D-47B6-A68D-7590B98EB39B}
114-
{8976C35D-279D-4B29-B769-C72BA79201DD} = {827E0CD3-B72D-47B6-A68D-7590B98EB39B}
115+
{75DB2555-FFE9-459B-B0E6-092D892FBE85} = {827E0CD3-B72D-47B6-A68D-7590B98EB39B}
115116
EndGlobalSection
116117
GlobalSection(ExtensibilityGlobals) = postSolution
117118
SolutionGuid = {11752BB0-7828-4D57-81A5-144236B2A82F}

src/Trion.Desktop/App.xaml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
<?xml version="1.0" encoding="UTF-8" ?>
2+
<Application xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
3+
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
4+
xmlns:local="clr-namespace:Trion.Desktop"
5+
x:Class="Trion.Desktop.App">
6+
<Application.Resources>
7+
<ResourceDictionary>
8+
9+
<!--
10+
For information about styling .NET MAUI pages
11+
please refer to the documentation:
12+
https://go.microsoft.com/fwlink/?linkid=2282329
13+
-->
14+
15+
</ResourceDictionary>
16+
</Application.Resources>
17+
</Application>

src/Trion.Desktop/App.xaml.cs

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
namespace Trion.Desktop
2+
{
3+
public partial class App : Application
4+
{
5+
public App()
6+
{
7+
InitializeComponent();
8+
}
9+
10+
protected override Window CreateWindow(IActivationState? activationState)
11+
{
12+
return new Window(new MainPage()) { Title = "Trion.Desktop" };
13+
}
14+
}
15+
}

src/Trion.Desktop/Components/Appli.razor

Lines changed: 0 additions & 20 deletions
This file was deleted.

src/Trion.Desktop/Components/Layout/MainLayout.razor

Lines changed: 16 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,37 +1,32 @@
11
@inherits LayoutComponentBase
22

3-
<MudThemeProvider Theme="@_theme" IsDarkMode="@_isDarkMode" />
3+
<MudThemeProvider Theme="@_theme" IsDarkMode="_isDarkMode" />
44
<MudPopoverProvider />
55
<MudDialogProvider />
66
<MudSnackbarProvider />
7-
87
<MudLayout>
98
<MudAppBar Elevation="1">
10-
<MudIconButton Icon="@Icons.Material.Filled.Menu"
11-
Color="Color.Inherit"
12-
Edge="Edge.Start"
13-
OnClick="@DrawerToggle" />
9+
<MudIconButton Icon="@Icons.Material.Filled.Menu" Color="Color.Inherit" Edge="Edge.Start" OnClick="@((e) => DrawerToggle())" />
1410
<MudText Typo="Typo.h5" Class="ml-3">Application</MudText>
1511
<MudSpacer />
16-
<MudIconButton Icon="@DarkLightModeButtonIcon"
17-
Color="Color.Inherit"
18-
OnClick="@DarkModeToggle" />
19-
<MudIconButton Icon="@Icons.Material.Filled.MoreVert"
20-
Color="Color.Inherit"
21-
Edge="Edge.End" />
12+
<MudIconButton Icon="@(DarkLightModeButtonIcon)" Color="Color.Inherit" OnClick="@DarkModeToggle" />
13+
<MudIconButton Icon="@Icons.Material.Filled.MoreVert" Color="Color.Inherit" Edge="Edge.End" />
2214
</MudAppBar>
23-
24-
<MudDrawer @bind-Open="_drawerOpen"
25-
ClipMode="DrawerClipMode.Always"
26-
Elevation="2">
15+
<MudDrawer id="nav-drawer" @bind-Open="_drawerOpen" ClipMode="DrawerClipMode.Always" Elevation="2">
2716
<NavMenu />
2817
</MudDrawer>
29-
3018
<MudMainContent Class="pt-16 pa-4">
3119
@Body
3220
</MudMainContent>
3321
</MudLayout>
3422

23+
24+
<div id="blazor-error-ui" data-nosnippet>
25+
An unhandled error has occurred.
26+
<a href="." class="reload">Reload</a>
27+
<span class="dismiss">🗙</span>
28+
</div>
29+
3530
@code {
3631
private bool _drawerOpen = true;
3732
private bool _isDarkMode = true;
@@ -40,6 +35,7 @@
4035
protected override void OnInitialized()
4136
{
4237
base.OnInitialized();
38+
4339
_theme = new()
4440
{
4541
PaletteLight = _lightPalette,
@@ -102,4 +98,6 @@
10298
true => Icons.Material.Rounded.AutoMode,
10399
false => Icons.Material.Outlined.DarkMode,
104100
};
105-
}
101+
}
102+
103+

src/Trion.Desktop/Components/Layout/MainLayout.razor.css

Lines changed: 15 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -27,23 +27,23 @@ main {
2727
text-decoration: none;
2828
}
2929

30-
.top-row ::deep a:hover, .top-row ::deep .btn-link:hover {
31-
text-decoration: underline;
32-
}
30+
.top-row ::deep a:hover, .top-row ::deep .btn-link:hover {
31+
text-decoration: underline;
32+
}
3333

34-
.top-row ::deep a:first-child {
35-
overflow: hidden;
36-
text-overflow: ellipsis;
37-
}
34+
.top-row ::deep a:first-child {
35+
overflow: hidden;
36+
text-overflow: ellipsis;
37+
}
3838

3939
@media (max-width: 640.98px) {
4040
.top-row {
4141
justify-content: space-between;
4242
}
4343

44-
.top-row ::deep a, .top-row ::deep .btn-link {
45-
margin-left: 0;
46-
}
44+
.top-row ::deep a, .top-row ::deep .btn-link {
45+
margin-left: 0;
46+
}
4747
}
4848

4949
@media (min-width: 641px) {
@@ -64,35 +64,14 @@ main {
6464
z-index: 1;
6565
}
6666

67-
.top-row.auth ::deep a:first-child {
68-
flex: 1;
69-
text-align: right;
70-
width: 0;
71-
}
67+
.top-row.auth ::deep a:first-child {
68+
flex: 1;
69+
text-align: right;
70+
width: 0;
71+
}
7272

7373
.top-row, article {
7474
padding-left: 2rem !important;
7575
padding-right: 1.5rem !important;
7676
}
7777
}
78-
79-
#blazor-error-ui {
80-
color-scheme: light only;
81-
background: lightyellow;
82-
bottom: 0;
83-
box-shadow: 0 -1px 2px rgba(0, 0, 0, 0.2);
84-
box-sizing: border-box;
85-
display: none;
86-
left: 0;
87-
padding: 0.6rem 1.25rem 0.7rem 1.25rem;
88-
position: fixed;
89-
width: 100%;
90-
z-index: 1000;
91-
}
92-
93-
#blazor-error-ui .dismiss {
94-
cursor: pointer;
95-
position: absolute;
96-
right: 0.75rem;
97-
top: 0.5rem;
98-
}
Lines changed: 27 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,27 @@
1-
<MudNavMenu>
2-
<MudNavLink Href="/" Match="NavLinkMatch.All" Icon="@Icons.Material.Filled.Home">Home</MudNavLink>
3-
<MudNavLink Href="/counter" Match="NavLinkMatch.Prefix" Icon="@Icons.Material.Filled.Add">Counter</MudNavLink>
4-
<MudNavLink Href="/weather" Match="NavLinkMatch.Prefix" Icon="@Icons.Material.Filled.List">Weather</MudNavLink>
5-
</MudNavMenu>
1+
<div class="top-row ps-3 navbar navbar-dark">
2+
<div class="container-fluid">
3+
<a class="navbar-brand" href="">Trion.Desktop</a>
4+
</div>
5+
</div>
6+
7+
<input type="checkbox" title="Navigation menu" class="navbar-toggler" />
8+
9+
<div class="nav-scrollable" onclick="document.querySelector('.navbar-toggler').click()">
10+
<nav class="flex-column">
11+
<div class="nav-item px-3">
12+
<NavLink class="nav-link" href="" Match="NavLinkMatch.All">
13+
<span class="bi bi-house-door-fill-nav-menu" aria-hidden="true"></span> Home
14+
</NavLink>
15+
</div>
16+
<div class="nav-item px-3">
17+
<NavLink class="nav-link" href="counter">
18+
<span class="bi bi-plus-square-fill-nav-menu" aria-hidden="true"></span> Counter
19+
</NavLink>
20+
</div>
21+
<div class="nav-item px-3">
22+
<NavLink class="nav-link" href="weather">
23+
<span class="bi bi-list-nested-nav-menu" aria-hidden="true"></span> Weather
24+
</NavLink>
25+
</div>
26+
</nav>
27+
</div>

0 commit comments

Comments
 (0)