파일 경로가 있는 권한 요청과 도구 결과 transcript 카드에 프리뷰 열기 액션을 추가했습니다. 미리보기 권장 상태나 파일 기반 결과에서 사용자가 카드에서 바로 preview panel로 이동할 수 있게 연결했습니다. README와 DEVELOPMENT 문서를 갱신했고 dotnet build 기준 경고 0 / 오류 0을 확인했습니다.
This commit is contained in:
@@ -117,6 +117,52 @@ public partial class ChatWindow
|
||||
};
|
||||
}
|
||||
|
||||
private Border CreateAgentInlineActionButton(string text, string icon, Brush foreground, Brush borderBrush, Action onClick)
|
||||
{
|
||||
var button = new Border
|
||||
{
|
||||
Background = Brushes.Transparent,
|
||||
BorderBrush = borderBrush,
|
||||
BorderThickness = new Thickness(1),
|
||||
CornerRadius = new CornerRadius(999),
|
||||
Padding = new Thickness(6, 2.5, 6, 2.5),
|
||||
Margin = new Thickness(11, 3, 0, 0),
|
||||
Cursor = Cursors.Hand,
|
||||
Child = new StackPanel
|
||||
{
|
||||
Orientation = Orientation.Horizontal,
|
||||
Children =
|
||||
{
|
||||
new TextBlock
|
||||
{
|
||||
Text = icon,
|
||||
FontFamily = new FontFamily("Segoe MDL2 Assets"),
|
||||
FontSize = 8,
|
||||
Foreground = foreground,
|
||||
VerticalAlignment = VerticalAlignment.Center,
|
||||
},
|
||||
new TextBlock
|
||||
{
|
||||
Text = text,
|
||||
FontSize = 8.15,
|
||||
Foreground = foreground,
|
||||
Margin = new Thickness(4, 0, 0, 0),
|
||||
VerticalAlignment = VerticalAlignment.Center,
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
button.MouseEnter += (_, _) => button.Background = new SolidColorBrush(Color.FromArgb(0x10, 0xFF, 0xFF, 0xFF));
|
||||
button.MouseLeave += (_, _) => button.Background = Brushes.Transparent;
|
||||
button.MouseLeftButtonUp += (_, e) =>
|
||||
{
|
||||
e.Handled = true;
|
||||
onClick();
|
||||
};
|
||||
return button;
|
||||
}
|
||||
|
||||
private static string GetPermissionKindLabel(string kind)
|
||||
{
|
||||
return kind switch
|
||||
@@ -294,6 +340,20 @@ public partial class ChatWindow
|
||||
|
||||
if (chipRow.Children.Count > 0)
|
||||
stack.Children.Add(chipRow);
|
||||
|
||||
if (!string.IsNullOrWhiteSpace(evt.FilePath) &&
|
||||
System.IO.File.Exists(evt.FilePath) &&
|
||||
((permissionPresentation?.RequiresPreview ?? false)
|
||||
|| toolResultPresentation != null))
|
||||
{
|
||||
var previewPath = evt.FilePath!;
|
||||
stack.Children.Add(CreateAgentInlineActionButton(
|
||||
"프리뷰 열기",
|
||||
"\uE8A1",
|
||||
BrushFromHex("#2563EB"),
|
||||
BrushFromHex("#BFDBFE"),
|
||||
() => ShowPreviewPanel(previewPath)));
|
||||
}
|
||||
}
|
||||
|
||||
private void AddAgentEventBanner(AgentEvent evt)
|
||||
|
||||
Reference in New Issue
Block a user