Forge
deeb25a2
1<UserControl xmlns="https://github.com/avaloniaui"
2 xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
3 xmlns:chat="using:CascadeIDE.Features.Chat"
4 xmlns:uikit="using:CascadeIDE.Views.UiKit"
5 xmlns:views="using:CascadeIDE.Views"
6 x:Class="CascadeIDE.Views.ChatPanelView"
7 x:DataType="chat:ChatPanelViewModel"
8 Background="{DynamicResource CascadeTheme.ChatPanelBackground}">
9 <UserControl.Styles>
10 <Style Selector="TextBox.chatPanelInput">
11 <Setter Property="Foreground" Value="{DynamicResource CascadeTheme.ChatMessageContentForeground}"/>
12 <Setter Property="Background" Value="{DynamicResource CascadeTheme.ChatPanelBackground}"/>
13 <Setter Property="BorderBrush" Value="{DynamicResource CascadeTheme.ButtonBorderBrush}"/>
14 <Setter Property="BorderThickness" Value="1.5"/>
15 <Setter Property="CornerRadius" Value="6"/>
16 <Setter Property="MinHeight" Value="32"/>
17 <Setter Property="Padding" Value="8,6"/>
18 <Setter Property="CaretBrush" Value="{DynamicResource CascadeTheme.ChatMessageContentForeground}"/>
19 </Style>
20 <Style Selector="TextBox.chatPanelInput /template/ TextBlock#PART_Watermark">
21 <Setter Property="Foreground" Value="{DynamicResource CascadeTheme.ChatLabelForeground}"/>
22 </Style>
23 </UserControl.Styles>
24
25 <Panel Background="{DynamicResource CascadeTheme.ChatPanelBackground}">
26 <views:IntercomSkiaSurface x:Name="IntercomSkiaSurface"
27 ToolTip.Tip="{Binding IntercomSlashPreviewToolTip}"
28 HorizontalAlignment="Stretch"
29 VerticalAlignment="Stretch"
30 Snapshot="{Binding ChatSurfaceSnapshot}"
31 SelectedMessageIndex="{Binding SelectedMessageIndex, Mode=TwoWay}"
32 DetailThreadId="{Binding SelectedChatThreadId, Mode=TwoWay}"
33 OverviewMode="{Binding IsChatOverviewMode, Mode=TwoWay}"
34 ForwardHost="{Binding IntercomForwardChrome}"
35 CompactSideHost="{Binding IsCompactPanelIntercomLayout}"
36 ComfortableFeed="{Binding IntercomComfortableFeed}"
37 TopicNavigatorVisible="{Binding IntercomTopicNavigatorVisible}"
38 TopicNavigatorSearchQuery="{Binding TopicNavigatorSearchQuery, Mode=TwoWay}"
39 IntercomFonts="{Binding IntercomFonts}"
40 ChromeTitle="Intercom"
41 IsChatLoading="{Binding IsChatLoading}"
42 LoadingStatusText="{Binding ChatLoadingStatusText}"
43 FmUsageSubtitle="{Binding FmUsageSubtitle}"
44 ShowIntercomComposer="True"
45 ComposerPlaceholder="{Binding IntercomComposerPlaceholder}"
46 ComposerText="{Binding ChatInput, Mode=TwoWay}"
47 IsComposerEnabled="{Binding !IsChatLoading}"
48 IsSlashAutocompleteVisible="{Binding IsComposerAutocompleteVisible}"
49 SelectedSlashSuggestionIndex="{Binding SelectedComposerAutocompleteIndex, Mode=TwoWay}"
50 SlashSuggestions="{Binding ComposerPopupSuggestions}"
51 SlashAutocompletePathPrefix="{Binding ChatSlashPathPrefix}"
52 SlashAutocompleteNextStep="{Binding ChatSlashNextStepLabel}"
53 SlashAutocompleteBreadcrumb="{Binding ChatSlashBreadcrumb}"
54 ComposerCaretIndex="{Binding ChatComposerCaretIndex, Mode=TwoWay}"
55 ComposerPreview="{Binding ComposerSlashPreview}"
56 ComposerPreviewKind="{Binding ComposerSlashPreviewKind}"
57 ShowCockpitCommandLine="{Binding ShowIntercomCockpitCommandLine}"
58 CommandLineText="{Binding CockpitCommandLineText, Mode=TwoWay}"
59 CommandLinePreview="{Binding CommandLineSlashPreview}"
60 CommandLinePreviewKind="{Binding CommandLineSlashPreviewKind}"
61 CommandLineCaretIndex="{Binding CockpitCommandLineCaretIndex, Mode=TwoWay}"/>
62
63 <Border IsVisible="{Binding HasActiveClarificationBatch}"
64 ZIndex="40"
65 Background="#B0000000">
66 <Border MaxWidth="520"
67 Margin="16"
68 VerticalAlignment="Center"
69 HorizontalAlignment="Stretch"
70 Classes="cascadeSection">
71 <StackPanel Spacing="8">
72 <DockPanel LastChildFill="False">
73 <TextBlock DockPanel.Dock="Left" Text="{Binding ActiveClarificationTitle}"
74 Classes="chatPanelTitle"
75 FontWeight="SemiBold"
76 Foreground="{DynamicResource CascadeTheme.ChatMessageContentForeground}"/>
77 <Button DockPanel.Dock="Right"
78 Content="Закрыть"
79 Command="{Binding DismissClarificationBatchCommand}"
80 Padding="8,3"/>
81 </DockPanel>
82 <ItemsControl ItemsSource="{Binding ClarificationDraftItems}">
83 <ItemsControl.ItemTemplate>
84 <DataTemplate DataType="chat:ClarificationDraftItemViewModel">
85 <Border Classes="cascadeInset" Margin="0,0,0,6">
86 <StackPanel Spacing="6">
87 <TextBlock Text="{Binding Prompt}" TextWrapping="Wrap"
88 Classes="chatPanelBody"
89 Foreground="{DynamicResource CascadeTheme.ChatMessageContentForeground}"/>
90 <TextBox Text="{Binding Answer, Mode=TwoWay}"
91 Classes="chatPanelInput"
92 IsVisible="{Binding IsFreeText}"
93 AcceptsReturn="True"
94 MinHeight="56"
95 TextWrapping="Wrap"
96 PlaceholderText="Ответ..."/>
97 <ComboBox ItemsSource="{Binding ChoiceOptions}"
98 Classes="chatPanelInput"
99 SelectedItem="{Binding Answer, Mode=TwoWay}"
100 IsVisible="{Binding IsChoice}"/>
101 </StackPanel>
102 </Border>
103 </DataTemplate>
104 </ItemsControl.ItemTemplate>
105 </ItemsControl>
106 <StackPanel Orientation="Horizontal" Spacing="8">
107 <Button Content="Отправить уточнения"
108 Command="{Binding SubmitClarificationResponseCommand}"
109 Padding="10,4"/>
110 <TextBlock Text="{Binding ClarificationStatusText}"
111 VerticalAlignment="Center"
112 TextWrapping="Wrap"
113 Foreground="{DynamicResource CascadeTheme.ChatLabelForeground}"/>
114 </StackPanel>
115 </StackPanel>
116 </Border>
117 </Border>
118 </Panel>
119</UserControl>
120
View only · write via MCP/CIDE