From 9589c3a37efe4db619c89086e10a1a933ce9cc52 Mon Sep 17 00:00:00 2001 From: Erik Darling <2136037+erikdarlingdata@users.noreply.github.com> Date: Mon, 9 Mar 2026 22:25:32 -0400 Subject: [PATCH] Pass AnalysisResult through to AdviceContentBuilder Thread analysis data to ShowAdviceWindow so triage cards and other structured features have access to parsed statement results. Co-Authored-By: Claude Opus 4.6 --- src/PlanViewer.App/Controls/QuerySessionControl.axaml.cs | 6 +++--- src/PlanViewer.App/MainWindow.axaml.cs | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/PlanViewer.App/Controls/QuerySessionControl.axaml.cs b/src/PlanViewer.App/Controls/QuerySessionControl.axaml.cs index d0f0fd4..fadeed6 100644 --- a/src/PlanViewer.App/Controls/QuerySessionControl.axaml.cs +++ b/src/PlanViewer.App/Controls/QuerySessionControl.axaml.cs @@ -694,7 +694,7 @@ private void HumanAdvice_Click(object? sender, RoutedEventArgs e) if (analysis == null) { SetStatus("No plan to analyze", autoClear: false); return; } var text = TextFormatter.Format(analysis); - ShowAdviceWindow("Advice for Humans", text); + ShowAdviceWindow("Advice for Humans", text, analysis); } private void RobotAdvice_Click(object? sender, RoutedEventArgs e) @@ -706,9 +706,9 @@ private void RobotAdvice_Click(object? sender, RoutedEventArgs e) ShowAdviceWindow("Advice for Robots", json); } - private void ShowAdviceWindow(string title, string content) + private void ShowAdviceWindow(string title, string content, AnalysisResult? analysis = null) { - var styledContent = AdviceContentBuilder.Build(content); + var styledContent = AdviceContentBuilder.Build(content, analysis); var scrollViewer = new ScrollViewer { diff --git a/src/PlanViewer.App/MainWindow.axaml.cs b/src/PlanViewer.App/MainWindow.axaml.cs index e586162..d01fd56 100644 --- a/src/PlanViewer.App/MainWindow.axaml.cs +++ b/src/PlanViewer.App/MainWindow.axaml.cs @@ -444,7 +444,7 @@ private DockPanel CreatePlanTabContent(PlanViewerControl viewer) { if (viewer.CurrentPlan == null) return; var analysis = ResultMapper.Map(viewer.CurrentPlan, "file", viewer.Metadata); - ShowAdviceWindow("Advice for Humans", TextFormatter.Format(analysis)); + ShowAdviceWindow("Advice for Humans", TextFormatter.Format(analysis), analysis); }; robotBtn.Click += (_, _) => @@ -566,9 +566,9 @@ private DockPanel CreatePlanTabContent(PlanViewerControl viewer) return panel; } - private void ShowAdviceWindow(string title, string content) + private void ShowAdviceWindow(string title, string content, AnalysisResult? analysis = null) { - var styledContent = AdviceContentBuilder.Build(content); + var styledContent = AdviceContentBuilder.Build(content, analysis); var scrollViewer = new ScrollViewer {