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
83 changes: 74 additions & 9 deletions .github/workflows/api-docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,20 @@ name: Build and publish v2 API docs
on:
push:
branches: [develop]
workflow_dispatch:
inputs:
regenerate-views:
description: Regenerate views.md and view GIF assets
type: boolean
default: true

permissions:
id-token: write
pages: write

jobs:
deploy:
name: Build and Deploy v2 API docs to github-pages ${{ github.ref_name }}
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
build:
name: Build v2 API docs ${{ github.ref_name }}
runs-on: windows-latest
steps:
- name: Checkout
Expand All @@ -27,6 +30,31 @@ jobs:
dotnet-version: 10.x
dotnet-quality: 'ga'

- name: Detect view docs changes
id: view-docs
shell: pwsh
run: |
$shouldGenerate = $false

if ("${{ github.event_name }}" -eq "workflow_dispatch") {
$shouldGenerate = "${{ inputs.regenerate-views }}" -eq "true"
} else {
$before = "${{ github.event.before }}"

if ($before -match "^0+$") {
$before = "HEAD~1"
}

$changedFiles = git diff --name-only $before "${{ github.sha }}"
$shouldGenerate = [bool]($changedFiles | Where-Object {
$_ -match "^Terminal\.Gui/Views/" -or
$_ -match "^docfx/scripts/OutputView/" -or
$_ -match "^docfx/scripts/generate-views-doc\.ps1$"
} | Select-Object -First 1)
}

"should_generate=$($shouldGenerate.ToString().ToLowerInvariant())" >> $env:GITHUB_OUTPUT

- name: Restore dependencies
run: dotnet restore

Expand All @@ -36,23 +64,60 @@ jobs:
- name: Build EditorRef (for Terminal.Gui.Editor docs)
run: dotnet build docfx/EditorRef/EditorRef.csproj --configuration Release

- name: DocFX Build
working-directory: docfx
- name: Install DocFX
run: |
dotnet tool install -g docfx

- name: Setup Go
if: steps.view-docs.outputs.should_generate == 'true'
uses: actions/setup-go@v6
with:
go-version: stable

- name: Install views docs tools
if: steps.view-docs.outputs.should_generate == 'true'
run: |
go install github.com/gui-cs/tuirec/cmd/tuirec@latest
Add-Content $env:GITHUB_PATH "$(go env GOPATH)\bin"
Install-Module powershell-yaml -Scope CurrentUser -Force

- name: Generate API metadata
working-directory: docfx
run: |
$env:DOCFX_SOURCE_BRANCH_NAME="${{ github.ref_name }}"
docfx metadata

- name: Generate views docs
if: steps.view-docs.outputs.should_generate == 'true'
working-directory: docfx
run: |
./scripts/generate-views-doc.ps1

- name: DocFX Build
working-directory: docfx
run: |
docfx build
continue-on-error: false

- name: Setup Pages
if: github.event_name == 'push' && github.ref_name == 'develop'
uses: actions/configure-pages@v6

- name: Upload artifact
if: github.event_name == 'push' && github.ref_name == 'develop'
uses: actions/upload-pages-artifact@v5
with:
path: docfx/_site


deploy:
name: Deploy v2 API docs to github-pages ${{ github.ref_name }}
if: github.event_name == 'push' && github.ref_name == 'develop'
needs: build
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: windows-latest
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v5
Expand Down
1 change: 1 addition & 0 deletions Terminal.Gui/Views/LinearRange/LinearRange.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ namespace Terminal.Gui.Views;
/// and create the view without supplying a type argument.
/// </summary>
/// <remarks>
/// <img src="../images/views/LinearRange.gif" alt="LinearRange demo"/>
/// <para>
/// To work with non-string option types, use <see cref="LinearRange{T}"/> directly.
/// </para>
Expand Down
1 change: 1 addition & 0 deletions Terminal.Gui/Views/LinearRange/LinearRangeT.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ namespace Terminal.Gui.Views;
/// </summary>
/// <typeparam name="T">The data type of the options.</typeparam>
/// <remarks>
/// <img src="../images/views/LinearRange.gif" alt="LinearRange demo"/>
/// <para>
/// To switch between left-bounded, right-bounded, and closed range modes, set
/// <see cref="RangeKind"/>. Setting <see cref="RangeKind"/> migrates the current
Expand Down
1 change: 1 addition & 0 deletions Terminal.Gui/Views/Prompt.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ namespace Terminal.Gui.Views;
/// </para>
/// </typeparam>
/// <remarks>
/// <img src="../images/views/Prompt-2.gif" alt="Prompt demo"/>
/// <para>
/// This class provides a convenient way to prompt the user with any view and get a typed result.
/// The wrapped view is displayed in the dialog, and when the user clicks Ok (or presses Enter),
Expand Down
13 changes: 8 additions & 5 deletions Terminal.Gui/Views/ScrollBar/ScrollBar.cs
Original file line number Diff line number Diff line change
Expand Up @@ -634,22 +634,25 @@ public bool EnableForDesign ()
if (args.Value == Orientation.Vertical)
{
Width = 1;
Height = Dim.Fill ();
Height = 10;
}
else
{
Width = Dim.Fill ();
Width = 30;
Height = 1;
}
};

Width = 1;
Height = Dim.Fill ();
Orientation = Orientation.Horizontal;
Width = 30;
Height = 1;
VisibleContentSize = 10;
ScrollableContentSize = 250;
Value = 80;

return true;
}

/// <inheritdoc/>
public string? GetDemoKeyStrokes () => "wait:500,CursorDown,wait:300,CursorDown,wait:300,CursorDown,wait:300,CursorDown,wait:800";
public string? GetDemoKeyStrokes () => "wait:2000";
}
3 changes: 1 addition & 2 deletions Terminal.Gui/Views/SpinnerView/SpinnerView.cs
Original file line number Diff line number Diff line change
Expand Up @@ -350,8 +350,7 @@ private void SyncProgressIndicator ()

bool IDesignable.EnableForDesign ()
{
Style = new SpinnerStyle.Points ();
SpinReverse = true;
Style = new SpinnerStyle.Dots2 ();
AutoSpin = true;

return true;
Expand Down
Binary file removed artifacts/submenu-hover-fix.gif
Binary file not shown.
Loading
Loading