diff --git a/.github/workflows/api-docs.yml b/.github/workflows/api-docs.yml index 4fe7d5f38..a97953233 100644 --- a/.github/workflows/api-docs.yml +++ b/.github/workflows/api-docs.yml @@ -31,7 +31,7 @@ jobs: continue-on-error: false - name: Setup Pages - uses: actions/configure-pages@v4 + uses: actions/configure-pages@v5 - name: Upload artifact uses: actions/upload-pages-artifact@v2 diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 83d18ebbc..69913111f 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -19,13 +19,13 @@ jobs: fetch-depth: 0 # fetch-depth is needed for GitVersion - name: Install GitVersion - uses: gittools/actions/gitversion/setup@v0 + uses: gittools/actions/gitversion/setup@v1 with: versionSpec: '5.x' includePrerelease: true - name: Determine Version - uses: gittools/actions/gitversion/execute@v0 + uses: gittools/actions/gitversion/execute@v1 with: useConfigFile: true #additionalArguments: /b develop @@ -34,7 +34,7 @@ jobs: - name: Setup dotnet uses: actions/setup-dotnet@v4 with: - dotnet-version: 7.0 + dotnet-version: 8.0 dotnet-quality: 'ga' - name: Install dependencies diff --git a/Example/Example.csproj b/Example/Example.csproj index 900d2a48c..2c2fb9ecc 100644 --- a/Example/Example.csproj +++ b/Example/Example.csproj @@ -1,7 +1,7 @@  Exe - net7.0 + net8.0 1.0.0.0 diff --git a/README.md b/README.md index 080c38269..6aa9c1ae6 100644 --- a/README.md +++ b/README.md @@ -40,7 +40,7 @@ dotnet run _The Documentation matches the most recent Nuget release from the `main` branch ([![Version](https://img.shields.io/nuget/v/Terminal.Gui.svg)](https://www.nuget.org/packages/Terminal.Gui))_ -See the [`Terminal.Gui/` README](https://github.com/gui-cs/Terminal.Gui/tree/master/Terminal.Gui) for an overview of how the library is structured. The [Conceptual Documentation](https://gui-cs.github.io/Terminal.Gui/articles/index.html) provides insight into core concepts. +See the [`Terminal.Gui/` README](https://github.com/gui-cs/Terminal.Gui/tree/master/Terminal.Gui) for an overview of how the library is structured. The [Conceptual Documentation](https://gui-cs.github.io/Terminal.Gui/docs/index.html) provides insight into core concepts. ## Features diff --git a/ReactiveExample/ReactiveExample.csproj b/ReactiveExample/ReactiveExample.csproj index 55eaefa28..e903b9b67 100644 --- a/ReactiveExample/ReactiveExample.csproj +++ b/ReactiveExample/ReactiveExample.csproj @@ -1,7 +1,7 @@  Exe - net7.0 + net8.0 Preview @@ -18,15 +18,15 @@ TRACE;DEBUG_IDISPOSABLE - - + + - - + + all runtime; build; native; contentfiles; analyzers; buildtransitive - + all runtime; build; native; contentfiles; analyzers; buildtransitive diff --git a/UnitTests/Views/ViewTests.cs b/UnitTests/Views/ViewTests.cs index dc366989d..0a64c17b9 100644 --- a/UnitTests/Views/ViewTests.cs +++ b/UnitTests/Views/ViewTests.cs @@ -371,6 +371,79 @@ namespace Terminal.Gui.ViewTests { Assert.True (r.TabIndexes.IndexOf (v1) == 1); } + [Fact] + public void TabIndex_Invert_Order () + { + var r = new View (); + var v1 = new View () { Id = "1", CanFocus = true }; + var v2 = new View () { Id = "2", CanFocus = true }; + var v3 = new View () { Id = "3", CanFocus = true }; + + r.Add (v1, v2, v3); + + v1.TabIndex = 2; + v2.TabIndex = 1; + v3.TabIndex = 0; + Assert.True (r.TabIndexes.IndexOf (v1) == 2); + Assert.True (r.TabIndexes.IndexOf (v2) == 1); + Assert.True (r.TabIndexes.IndexOf (v3) == 0); + + Assert.True (r.Subviews.IndexOf (v1) == 0); + Assert.True (r.Subviews.IndexOf (v2) == 1); + Assert.True (r.Subviews.IndexOf (v3) == 2); + } + + [Fact] + public void TabIndex_Invert_Order_Added_One_By_One_Does_Not_Do_What_Is_Expected () + { + var r = new View (); + var v1 = new View () { Id = "1", CanFocus = true }; + r.Add (v1); + v1.TabIndex = 2; + var v2 = new View () { Id = "2", CanFocus = true }; + r.Add (v2); + v2.TabIndex = 1; + var v3 = new View () { Id = "3", CanFocus = true }; + r.Add (v3); + v3.TabIndex = 0; + + Assert.False (r.TabIndexes.IndexOf (v1) == 2); + Assert.True (r.TabIndexes.IndexOf (v1) == 1); + Assert.False (r.TabIndexes.IndexOf (v2) == 1); + Assert.True (r.TabIndexes.IndexOf (v2) == 2); + // Only the last is in the expected index + Assert.True (r.TabIndexes.IndexOf (v3) == 0); + + Assert.True (r.Subviews.IndexOf (v1) == 0); + Assert.True (r.Subviews.IndexOf (v2) == 1); + Assert.True (r.Subviews.IndexOf (v3) == 2); + } + + [Fact] + public void TabIndex_Invert_Order_Mixed () + { + var r = new View (); + var vl1 = new View () { Id = "vl1" }; + var v1 = new View () { Id = "v1", CanFocus = true }; + var vl2 = new View () { Id = "vl2" }; + var v2 = new View () { Id = "v2", CanFocus = true }; + var vl3 = new View () { Id = "vl3" }; + var v3 = new View () { Id = "v3", CanFocus = true }; + + r.Add (vl1, v1, vl2, v2, vl3, v3); + + v1.TabIndex = 2; + v2.TabIndex = 1; + v3.TabIndex = 0; + Assert.True (r.TabIndexes.IndexOf (v1) == 4); + Assert.True (r.TabIndexes.IndexOf (v2) == 2); + Assert.True (r.TabIndexes.IndexOf (v3) == 0); + + Assert.True (r.Subviews.IndexOf (v1) == 1); + Assert.True (r.Subviews.IndexOf (v2) == 3); + Assert.True (r.Subviews.IndexOf (v3) == 5); + } + [Fact] public void TabStop_And_CanFocus_Are_All_True () { @@ -1173,6 +1246,10 @@ namespace Terminal.Gui.ViewTests { Application.Run (); + // Ensures cleaning any keystroke. + // This was conflicting with the TestVKPacket unit test + Console.MockKeyPresses.Clear (); + // Shutdown must be called to safely clean up Application if Init has been called Application.Shutdown (); } diff --git a/global.json b/global.json index cf0511e14..7b2527f81 100644 --- a/global.json +++ b/global.json @@ -1,6 +1,6 @@ { "sdk":{ - "version":"7.0.200", + "version":"8.0.204", "rollForward":"latestMinor" } }