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
13 changes: 13 additions & 0 deletions .config/dotnet-tools.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"version": 1,
"isRoot": true,
"tools": {
"dotnet-reportgenerator-globaltool": {
"version": "5.5.12",
"commands": [
"reportgenerator"
],
"rollForward": false
}
}
}
44 changes: 35 additions & 9 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ name: CI
on:
push:
branches: [main]
paths-ignore: ["**.md", "LICENSE"]
paths-ignore: ["**.md", "docs/**", "LICENSE"]
pull_request:
paths-ignore: ["**.md", "LICENSE"]
paths-ignore: ["**.md", "docs/**", "LICENSE"]
workflow_call:

permissions:
Expand All @@ -16,10 +16,10 @@ concurrency:
cancel-in-progress: ${{ github.event_name == 'pull_request' }}

jobs:
build:
name: Build, test and pack
lint:
name: Lint
runs-on: ubuntu-26.04
timeout-minutes: 15
timeout-minutes: 10
steps:
- name: Check out
uses: actions/checkout@v7
Expand All @@ -30,11 +30,19 @@ jobs:
- name: Check C# formatting
run: dotnet format Enfilade.slnx --verify-no-changes

- name: Build
run: dotnet build Enfilade.slnx -c Release
test:
name: Tests
runs-on: ubuntu-26.04
timeout-minutes: 15
steps:
- name: Check out
uses: actions/checkout@v7

- name: Set up .NET
uses: ./.github/actions/dotnet

- name: Test
run: dotnet test --project tests/Enfilade.Tests -c Release --no-build --results-directory "$GITHUB_WORKSPACE/TestResults" --report-xunit-junit --coverage --coverage-output-format cobertura
run: dotnet test --project tests/Enfilade.Tests -c Release --results-directory "$GITHUB_WORKSPACE/TestResults" --report-xunit-junit --coverage --coverage-output-format cobertura

- name: Publish test report
if: ${{ !cancelled() }}
Expand All @@ -46,8 +54,26 @@ jobs:
require_tests: true
include_time_in_summary: true

- name: Summarize coverage
if: ${{ !cancelled() }}
run: |
dotnet tool restore
dotnet reportgenerator -reports:"TestResults/**/*.cobertura.xml" -targetdir:coverage -reporttypes:MarkdownSummaryGithub
cat coverage/SummaryGithub.md >> "$GITHUB_STEP_SUMMARY"

pack:
name: Pack
runs-on: ubuntu-26.04
timeout-minutes: 15
steps:
- name: Check out
uses: actions/checkout@v7

- name: Set up .NET
uses: ./.github/actions/dotnet

- name: Pack
run: dotnet pack Enfilade.slnx -c Release --no-build -o artifacts/packages
run: dotnet pack Enfilade.slnx -c Release -o artifacts/packages

- name: Upload packages
uses: actions/upload-artifact@v7
Expand Down
2 changes: 1 addition & 1 deletion Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
</PropertyGroup>

<PropertyGroup>
<Version>0.2.1</Version>
<Version>0.2.2</Version>
<Authors>Echways</Authors>
<PackageLicenseExpression>GPL-3.0-only</PackageLicenseExpression>
<PackageProjectUrl>https://github.com/Echways/Enfilade</PackageProjectUrl>
Expand Down
2 changes: 2 additions & 0 deletions docs/en/components.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@
| `Meter` | `Used / Limit` with a bar that turns ochre at 90% and red at 100%. |
| `Crumb` | Removable filter chip that links to the address without the filter. |
| `CopyLine`, `CopyButton` | A value with a copy button. |
| `Output` | A bordered box for logs and command output: `Text` and `Empty`, the line shown when there is no text. |
| `Adder` | A one-line add form: `Placeholder`, `OnAdd` with the trimmed text, `Done`, and the button label as content. Enter adds too. |
| `KeyField` | A secret token in groups, with a copy button. |
| `EntranceLayout` | Full-screen layout without navigation, for sign-in pages: `@layout EntranceLayout`. |
| `LanguageLink` | Link to the next language, for pages outside the shell. |
Expand Down
2 changes: 2 additions & 0 deletions docs/ru/components.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@
| `Meter` | `Used / Limit` с полосой, которая желтеет на 90% и краснеет на 100%. |
| `Crumb` | Снимаемая метка фильтра, ссылка на адрес без этого фильтра. |
| `CopyLine`, `CopyButton` | Значение с кнопкой копирования. |
| `Output` | Блок с рамкой для логов и вывода команд: `Text` и `Empty` — строка, когда текста нет. |
| `Adder` | Однострочная форма добавления: `Placeholder`, `OnAdd` с обрезанным текстом, `Done` и подпись кнопки в содержимом. Enter тоже добавляет. |
| `KeyField` | Секретный токен группами с кнопкой копирования. |
| `EntranceLayout` | Полноэкранный макет без навигации для страниц входа: `@layout EntranceLayout`. |
| `LanguageLink` | Ссылка на следующий язык для страниц вне оболочки. |
Expand Down
46 changes: 46 additions & 0 deletions src/Enfilade/Components/Adder.razor
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
@namespace Enfilade
@inject Act Act

<div class="adder">
<MudTextField T="string" @bind-Value="_text" Immediate="true" Placeholder="@Placeholder" aria-label="@Placeholder" Disabled="Disabled"
OnKeyDown="KeyAsync" />
<Button OnClick="AddAsync" Done="@Done" Refresh="Refresh" Disabled="@(Disabled || string.IsNullOrWhiteSpace(_text))">@ChildContent</Button>
</div>

@code {
private string? _text;

[Parameter, EditorRequired]
public string Placeholder { get; set; } = "";

[Parameter, EditorRequired]
public EventCallback<string> OnAdd { get; set; }

[Parameter]
public string? Done { get; set; }

[Parameter]
public bool Refresh { get; set; } = true;

[Parameter]
public bool Disabled { get; set; }

[Parameter, EditorRequired]
public RenderFragment ChildContent { get; set; } = default!;

private async Task AddAsync()
{
var value = _text?.Trim();
if (string.IsNullOrEmpty(value))
return;

await OnAdd.InvokeAsync(value);
_text = null;
}

private async Task KeyAsync(KeyboardEventArgs args)
{
if (args.Key == "Enter" && !Disabled && !string.IsNullOrWhiteSpace(_text))
await Act.RunAsync(AddAsync, Done, null, Refresh);
}
}
20 changes: 20 additions & 0 deletions src/Enfilade/Components/Output.razor
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
@namespace Enfilade

<div class="output" role="log" tabindex="0">
@if (string.IsNullOrEmpty(Text))
{
<p class="output-empty">@Empty</p>
}
else
{
<pre>@Text</pre>
}
</div>

@code {
[Parameter]
public string? Text { get; set; }

[Parameter, EditorRequired]
public string Empty { get; set; } = "";
}
42 changes: 42 additions & 0 deletions src/Enfilade/wwwroot/enfilade.css
Original file line number Diff line number Diff line change
Expand Up @@ -2630,3 +2630,45 @@ a.crumb:hover {
letter-spacing: normal;
color: var(--mist);
}

.output {
box-sizing: border-box;
max-height: 480px;
overflow: auto;
padding: 16px 20px;
border-radius: var(--round);
background: var(--deep);
box-shadow: inset 0 0 0 1px var(--rule), var(--edge);
color: var(--light);
scrollbar-width: thin;
scrollbar-color: var(--rule) transparent;
transition: box-shadow 0.3s var(--spring);
}

.output:hover {
box-shadow: inset 0 0 0 1px var(--line), var(--edge);
}

.output pre, .output .output-empty {
margin: 0;
font: 400 13px/20px var(--mono);
font-stretch: 87%;
letter-spacing: -0.01em;
white-space: pre-wrap;
overflow-wrap: anywhere;
}

.output .output-empty {
color: var(--mist);
}

.adder {
display: flex;
align-items: flex-end;
gap: 16px;
}

.adder .mud-input-control {
flex: 1 1 auto;
min-width: 0;
}