Skip to content

Commit 5fc15b6

Browse files
Show deployed version on the web viewer (#257)
Reads PlanViewer.Web assembly version at runtime and renders it in two places so Joe (and anyone else giving feedback) can tell at a glance what version is deployed: - Landing page: small badge appended to the "Powered by Performance Studio" line - Toolbar (when a plan is loaded): badge on the right side next to the SQL Server build info deploy-web.yml now auto-syncs src/PlanViewer.Web/PlanViewer.Web.csproj Version with src/PlanViewer.App/PlanViewer.App.csproj Version before publishing, so the displayed version always matches the App release tag without needing manual csproj bumps in two places. Also widened the deploy-web path trigger to include App.csproj so version-only releases still redeploy the web. Version bump 1.7.2 -> 1.7.3. Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent 3a40ada commit 5fc15b6

5 files changed

Lines changed: 40 additions & 3 deletions

File tree

.github/workflows/deploy-web.yml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ on:
66
paths:
77
- 'src/PlanViewer.Core/**'
88
- 'src/PlanViewer.Web/**'
9+
- 'src/PlanViewer.App/PlanViewer.App.csproj'
910
- '.github/workflows/deploy-web.yml'
1011
workflow_dispatch:
1112

@@ -36,6 +37,17 @@ jobs:
3637
- name: Install WASM workload
3738
run: dotnet workload install wasm-tools
3839

40+
- name: Sync web version with app version
41+
shell: pwsh
42+
run: |
43+
$appVersion = ([xml](Get-Content src/PlanViewer.App/PlanViewer.App.csproj)).Project.PropertyGroup.Version | Where-Object { $_ }
44+
Write-Host "App version: $appVersion"
45+
$webCsproj = 'src/PlanViewer.Web/PlanViewer.Web.csproj'
46+
$content = Get-Content $webCsproj -Raw
47+
$content = [regex]::Replace($content, '<Version>[^<]+</Version>', "<Version>$appVersion</Version>")
48+
Set-Content -Path $webCsproj -Value $content -NoNewline
49+
Write-Host "Synced web csproj to $appVersion"
50+
3951
- name: Publish Blazor WASM
4052
run: dotnet publish src/PlanViewer.Web/PlanViewer.Web.csproj -c Release -o publish
4153

src/PlanViewer.App/PlanViewer.App.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
<ApplicationManifest>app.manifest</ApplicationManifest>
77
<ApplicationIcon>EDD.ico</ApplicationIcon>
88
<AvaloniaUseCompiledBindingsByDefault>true</AvaloniaUseCompiledBindingsByDefault>
9-
<Version>1.7.2</Version>
9+
<Version>1.7.3</Version>
1010
<Authors>Erik Darling</Authors>
1111
<Company>Darling Data LLC</Company>
1212
<Product>Performance Studio</Product>

src/PlanViewer.Web/Pages/Index.razor

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
<div class="landing-content">
88
<h2>Free SQL Server Query Plan Analysis</h2>
99
<p class="privacy">Paste or upload a .sqlplan file. Your plan XML never leaves your browser.</p>
10-
<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>
10+
<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>
1111

1212
@if (errorMessage != null)
1313
{
@@ -57,6 +57,7 @@ else
5757
{
5858
<span class="toolbar-version">@result.SqlServerBuild</span>
5959
}
60+
<span class="toolbar-app-version" title="Performance Studio web viewer version">@AppVersion</span>
6061
@if (shareUrl != null)
6162
{
6263
<span class="share-url"><a href="@shareUrl" target="_blank">@shareUrl</a></span>
@@ -1664,6 +1665,13 @@ else
16641665
@code {
16651666
private const string ShareApiBase = "https://stats.erikdarling.com";
16661667

1668+
private static readonly string AppVersion = GetAppVersion();
1669+
private static string GetAppVersion()
1670+
{
1671+
var v = typeof(Index).Assembly.GetName().Version;
1672+
return v == null ? "?" : $"v{v.Major}.{v.Minor}.{v.Build}";
1673+
}
1674+
16671675
private string activeTab = "paste";
16681676
private string planXml = "";
16691677
private string? errorMessage;

src/PlanViewer.Web/PlanViewer.Web.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<ImplicitUsings>enable</ImplicitUsings>
66
<Nullable>enable</Nullable>
77
<RootNamespace>PlanViewer.Web</RootNamespace>
8-
<Version>1.4.0</Version>
8+
<Version>1.7.3</Version>
99
<Authors>Erik Darling</Authors>
1010
<Company>Darling Data LLC</Company>
1111
<Product>SQL Performance Studio</Product>

src/PlanViewer.Web/wwwroot/css/app.css

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -451,6 +451,23 @@ textarea::placeholder {
451451
color: var(--text-muted);
452452
}
453453

454+
.toolbar-app-version {
455+
font-size: 0.75rem;
456+
font-weight: 600;
457+
color: var(--text-muted);
458+
padding: 0.1rem 0.4rem;
459+
border-radius: 3px;
460+
background: rgba(0, 0, 0, 0.05);
461+
margin-left: auto;
462+
}
463+
464+
.app-version {
465+
font-size: 0.8rem;
466+
font-weight: 600;
467+
color: var(--text-muted);
468+
margin-left: 0.25rem;
469+
}
470+
454471
/* === Statement Tabs === */
455472
.statement-tabs {
456473
display: flex;

0 commit comments

Comments
 (0)