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
8 changes: 7 additions & 1 deletion src/PlanViewer.App/AboutWindow.axaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
x:Class="PlanViewer.App.AboutWindow"
Title="About Performance Studio"
Width="450" Height="420"
Width="450" Height="460"
CanResize="False"
WindowStartupLocation="CenterOwner"
Icon="avares://PlanViewer.App/EDD.ico"
Expand Down Expand Up @@ -63,6 +63,12 @@
<TextBlock Text="Restart the application after changing MCP settings."
FontSize="11" Foreground="{DynamicResource ForegroundMutedBrush}"
Margin="0,4,0,0"/>
<StackPanel Orientation="Horizontal" Spacing="8" Margin="0,8,0,0">
<Button x:Name="CopyMcpCommandButton" Content="Copy MCP Command"
Click="CopyMcpCommand_Click" Padding="10,4" FontSize="12"/>
<TextBlock x:Name="McpCopyStatus" FontSize="11" VerticalAlignment="Center"
Foreground="{DynamicResource ForegroundMutedBrush}"/>
</StackPanel>
</StackPanel>

<!-- Close -->
Expand Down
13 changes: 13 additions & 0 deletions src/PlanViewer.App/AboutWindow.axaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
using System.Text.Json;
using Avalonia.Controls;
using Avalonia.Input;
using Avalonia.Input.Platform;
using Avalonia.Interactivity;
using PlanViewer.App.Mcp;

Expand Down Expand Up @@ -59,6 +60,18 @@ private void SaveMcpSettings()
private void GitHubLink_Click(object? sender, PointerPressedEventArgs e) => OpenUrl(GitHubUrl);
private void ReportIssueLink_Click(object? sender, PointerPressedEventArgs e) => OpenUrl(IssuesUrl);
private void DarlingDataLink_Click(object? sender, PointerPressedEventArgs e) => OpenUrl(DarlingDataUrl);
private async void CopyMcpCommand_Click(object? sender, RoutedEventArgs e)
{
var port = int.TryParse(McpPortInput.Text, out var p) && p >= 1024 && p <= 65535 ? p : 5152;
var command = $"claude mcp add --transport streamable-http --scope user performance-studio http://localhost:{port}/";
var clipboard = TopLevel.GetTopLevel(this)?.Clipboard;
if (clipboard != null)
{
await clipboard.SetTextAsync(command);
McpCopyStatus.Text = "Copied to clipboard!";
}
}

private void CloseButton_Click(object? sender, RoutedEventArgs e) => Close();

private static void OpenUrl(string url)
Expand Down
Loading