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
12 changes: 12 additions & 0 deletions .github/workflows/deploy-web.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ on:
paths:
- 'src/PlanViewer.Core/**'
- 'src/PlanViewer.Web/**'
- 'src/PlanViewer.App/PlanViewer.App.csproj'
- '.github/workflows/deploy-web.yml'
workflow_dispatch:

Expand Down Expand Up @@ -36,6 +37,17 @@ jobs:
- name: Install WASM workload
run: dotnet workload install wasm-tools

- name: Sync web version with app version
shell: pwsh
run: |
$appVersion = ([xml](Get-Content src/PlanViewer.App/PlanViewer.App.csproj)).Project.PropertyGroup.Version | Where-Object { $_ }
Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

([xml]...).Project.PropertyGroup.Version | Where-Object { $_ } assumes PlanViewer.App.csproj has exactly one <PropertyGroup> carrying <Version>. If a conditional second PropertyGroup is ever added (common when adding <PropertyGroup Condition="..."> blocks), .PropertyGroup becomes an array, .Version becomes a collection, and $appVersion interpolates as a space-separated string into the regex replace — producing an invalid <Version>1.7.3 </Version> or similar. Safer: Select-Xml -Path ... -XPath '/Project/PropertyGroup/Version[1]/text()' | ForEach-Object { $_.Node.Value }.


Generated by Claude Code

Write-Host "App version: $appVersion"
$webCsproj = 'src/PlanViewer.Web/PlanViewer.Web.csproj'
$content = Get-Content $webCsproj -Raw
$content = [regex]::Replace($content, '<Version>[^<]+</Version>', "<Version>$appVersion</Version>")
Set-Content -Path $webCsproj -Value $content -NoNewline
Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Set-Content -NoNewline strips the trailing newline the csproj currently has. Harmless in CI since the file isn't committed back, but if anyone ever commits the rewritten file (e.g. a future step that does git add), they'll see a spurious EOL-only diff. Drop -NoNewline or append [Environment]::NewLine to $content.


Generated by Claude Code

Write-Host "Synced web csproj to $appVersion"

- name: Publish Blazor WASM
run: dotnet publish src/PlanViewer.Web/PlanViewer.Web.csproj -c Release -o publish

Expand Down
2 changes: 1 addition & 1 deletion src/PlanViewer.App/PlanViewer.App.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<ApplicationManifest>app.manifest</ApplicationManifest>
<ApplicationIcon>EDD.ico</ApplicationIcon>
<AvaloniaUseCompiledBindingsByDefault>true</AvaloniaUseCompiledBindingsByDefault>
<Version>1.7.2</Version>
<Version>1.7.3</Version>
<Authors>Erik Darling</Authors>
<Company>Darling Data LLC</Company>
<Product>Performance Studio</Product>
Expand Down
10 changes: 9 additions & 1 deletion src/PlanViewer.Web/Pages/Index.razor
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<div class="landing-content">
<h2>Free SQL Server Query Plan Analysis</h2>
<p class="privacy">Paste or upload a .sqlplan file. Your plan XML never leaves your browser.</p>
<p class="powered-by">Powered by the same analysis engine in the <a href="https://github.com/erikdarlingdata/PerformanceStudio" target="_blank" rel="noopener">Performance Studio</a> app.</p>
<p class="powered-by">Powered by the same analysis engine in the <a href="https://github.com/erikdarlingdata/PerformanceStudio" target="_blank" rel="noopener">Performance Studio</a> app. <span class="app-version">@AppVersion</span></p>

@if (errorMessage != null)
{
Expand Down Expand Up @@ -57,6 +57,7 @@ else
{
<span class="toolbar-version">@result.SqlServerBuild</span>
}
<span class="toolbar-app-version" title="Performance Studio web viewer version">@AppVersion</span>
@if (shareUrl != null)
{
<span class="share-url"><a href="@shareUrl" target="_blank">@shareUrl</a></span>
Expand Down Expand Up @@ -1664,6 +1665,13 @@ else
@code {
private const string ShareApiBase = "https://stats.erikdarling.com";

private static readonly string AppVersion = GetAppVersion();
private static string GetAppVersion()
{
var v = typeof(Index).Assembly.GetName().Version;
return v == null ? "?" : $"v{v.Major}.{v.Minor}.{v.Build}";
Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

v.Build is the third component of System.Version (Major.Minor.Build.Revision), which for a <Version>1.7.3</Version> csproj resolves to AssemblyVersion 1.7.3.0 and renders v1.7.3 — correct. Worth noting: if the csproj ever uses a 4-part <Version> (e.g. 1.7.3.4), the Revision is silently dropped. Probably fine given the sync script writes 3-part versions, but flag if that assumption ever loosens.


Generated by Claude Code

}

private string activeTab = "paste";
private string planXml = "";
private string? errorMessage;
Expand Down
2 changes: 1 addition & 1 deletion src/PlanViewer.Web/PlanViewer.Web.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<RootNamespace>PlanViewer.Web</RootNamespace>
<Version>1.4.0</Version>
<Version>1.7.3</Version>
<Authors>Erik Darling</Authors>
<Company>Darling Data LLC</Company>
<Product>SQL Performance Studio</Product>
Expand Down
17 changes: 17 additions & 0 deletions src/PlanViewer.Web/wwwroot/css/app.css
Original file line number Diff line number Diff line change
Expand Up @@ -451,6 +451,23 @@ textarea::placeholder {
color: var(--text-muted);
}

.toolbar-app-version {
font-size: 0.75rem;
font-weight: 600;
color: var(--text-muted);
padding: 0.1rem 0.4rem;
border-radius: 3px;
background: rgba(0, 0, 0, 0.05);
margin-left: auto;
Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

margin-left: auto on .toolbar-app-version pushes the badge right, but .toolbar is display: flex with .share-url and .delete-share-btn rendered after the badge in the markup (Index.razor:60-71). Those siblings get carried along to the right edge too, so the badge ends up left-of the share URL rather than solo on the right. If the intent (per PR body: "badge on the right when a plan is loaded") is for the badge to be the rightmost element, move the <span class="toolbar-app-version"> after the share-url/delete-btn blocks in the razor, or put margin-left: auto on whichever element should be the left edge of the right-aligned group.


Generated by Claude Code

}

.app-version {
font-size: 0.8rem;
font-weight: 600;
color: var(--text-muted);
margin-left: 0.25rem;
}

/* === Statement Tabs === */
.statement-tabs {
display: flex;
Expand Down
Loading