This repository has been archived on 2026-07-19. You can view files and clone it. You cannot open issues or pull requests or push a commit.
Files
OutlookAddin/src/OutlookAddin.UI/Views/ReadingPaneView.xaml
T
PointStar 017f10e60b feat(sidebar): inline candidate picker, per-case file action, back navigation
- Ambiguous lookups (2+ contacts on one email) now dedupe by Contact Id
  and fetch each candidate's full record so the picker shows
  name + account + email instead of just the bare search payload.
- Per-row "תייק" button on each linked case lets the user pick the
  correct case to file to when a contact has multiple cases; bottom
  "תייק לתיק הזה" button is hidden in that scenario.
- "→ חזור לרשימת אנשי קשר" link restores the candidate list after
  drilling into one of them.
- Contact name + case rows in the sidebar are now hyperlinks that
  open the entity in Klear.
- AddInHost.LaunchFileToCaseAsync accepts an optional MatchResult and
  auto-files when the sidebar resolved a single linked case, skipping
  the manual search dialog.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-20 12:57:51 +03:00

184 lines
11 KiB
XML

<UserControl x:Class="MarcusLaw.OutlookAddin.UI.Views.ReadingPaneView"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:conv="clr-namespace:MarcusLaw.OutlookAddin.UI.Converters"
FlowDirection="RightToLeft"
Background="White"
FontFamily="Segoe UI"
FontSize="12">
<UserControl.Resources>
<conv:CaseStatusToHebrewConverter x:Key="HebrewStatus" />
<Style TargetType="TextBlock">
<Setter Property="TextWrapping" Value="Wrap" />
</Style>
<Style x:Key="LabelStyle" TargetType="TextBlock">
<Setter Property="Foreground" Value="Gray" />
<Setter Property="FontSize" Value="10" />
<Setter Property="Margin" Value="0,4,0,2" />
</Style>
<Style x:Key="LinkButtonStyle" TargetType="Button">
<Setter Property="Background" Value="Transparent" />
<Setter Property="BorderThickness" Value="0" />
<Setter Property="Foreground" Value="#0066CC" />
<Setter Property="Padding" Value="0" />
<Setter Property="Cursor" Value="Hand" />
<Setter Property="HorizontalAlignment" Value="Right" />
</Style>
</UserControl.Resources>
<Grid Margin="10">
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
<RowDefinition Height="*" />
<RowDefinition Height="Auto" />
</Grid.RowDefinitions>
<TextBlock Grid.Row="0" Text="פרטי תיק" FontWeight="Bold" FontSize="14" Margin="0,0,0,8" />
<ScrollViewer Grid.Row="1" VerticalScrollBarVisibility="Auto">
<Grid>
<!-- Loading -->
<StackPanel Visibility="{Binding LoadingVisibility}" HorizontalAlignment="Center" VerticalAlignment="Center">
<ProgressBar IsIndeterminate="True" Width="120" Height="6" Margin="0,0,0,8" />
<TextBlock Text="טוען…" Foreground="Gray" HorizontalAlignment="Center" />
</StackPanel>
<!-- Empty / no selection -->
<TextBlock Visibility="{Binding EmptyVisibility}"
Text="סמן מייל כדי לראות את פרטי התיק"
Foreground="Gray" HorizontalAlignment="Center" VerticalAlignment="Center"
TextAlignment="Center" />
<!-- No match -->
<StackPanel Visibility="{Binding NoMatchVisibility}">
<TextBlock Text="לא נמצא איש קשר ל-" Foreground="Gray" />
<TextBlock Text="{Binding SenderEmail}" FontWeight="Bold" />
<Button Content="חפש ידנית ב-Klear"
Command="{Binding OpenManualSearchCommand}"
Style="{StaticResource LinkButtonStyle}"
Margin="0,12,0,0" />
</StackPanel>
<!-- Ambiguous -->
<StackPanel Visibility="{Binding AmbiguousVisibility}">
<TextBlock Text="{Binding AmbiguousMessage}" Foreground="DarkOrange" />
<TextBlock Style="{StaticResource LabelStyle}" Text="בחר איש קשר:" Margin="0,8,0,2" />
<ItemsControl ItemsSource="{Binding Candidates}">
<ItemsControl.ItemTemplate>
<DataTemplate>
<Border BorderBrush="#EEE" BorderThickness="0,0,0,1" Padding="0,4">
<Button Command="{Binding DataContext.SelectCandidateCommand, RelativeSource={RelativeSource AncestorType=ItemsControl}}"
CommandParameter="{Binding}"
Background="Transparent"
BorderThickness="0"
Padding="0"
Cursor="Hand"
HorizontalContentAlignment="Right"
HorizontalAlignment="Stretch">
<StackPanel HorizontalAlignment="Stretch">
<TextBlock Text="{Binding Name}" FontWeight="SemiBold" Foreground="#0066CC" />
<TextBlock Text="{Binding AccountName}" Foreground="DimGray" FontSize="11" />
<TextBlock Text="{Binding EmailAddress}" Foreground="Gray" FontSize="10" />
</StackPanel>
</Button>
</Border>
</DataTemplate>
</ItemsControl.ItemTemplate>
</ItemsControl>
<Button Content="פתח חיפוש ידני"
Command="{Binding OpenManualSearchCommand}"
Style="{StaticResource LinkButtonStyle}"
Margin="0,12,0,0" />
</StackPanel>
<!-- Match -->
<StackPanel Visibility="{Binding MatchVisibility}">
<Button Content="→ חזור לרשימת אנשי קשר"
Command="{Binding BackToCandidatesCommand}"
Style="{StaticResource LinkButtonStyle}"
HorizontalAlignment="Right"
Margin="0,0,0,4"
Visibility="{Binding BackToCandidatesVisibility}" />
<TextBlock Style="{StaticResource LabelStyle}" Text="איש קשר" />
<TextBlock FontSize="14" FontWeight="Bold">
<Hyperlink Command="{Binding OpenInEspoCrmCommand}"
TextDecorations="{x:Null}"
Foreground="#0066CC">
<Run Text="{Binding Match.Contact.Name, Mode=OneWay}" />
</Hyperlink>
</TextBlock>
<TextBlock Text="{Binding Match.Contact.EmailAddress}" Foreground="Gray" />
<TextBlock Style="{StaticResource LabelStyle}" Text="לקוח/חברה" Visibility="{Binding AccountVisibility}" />
<TextBlock Text="{Binding Match.Account.Name}" Visibility="{Binding AccountVisibility}" />
<TextBlock Style="{StaticResource LabelStyle}" Text="תיקים מקושרים" Margin="0,12,0,2" />
<ItemsControl ItemsSource="{Binding RecentCases}">
<ItemsControl.ItemTemplate>
<DataTemplate>
<Border BorderBrush="#EEE" BorderThickness="0,0,0,1" Padding="0,4">
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*" />
<ColumnDefinition Width="Auto" />
</Grid.ColumnDefinitions>
<StackPanel Grid.Column="0">
<TextBlock>
<Hyperlink Command="{Binding DataContext.OpenCaseInCrmCommand, RelativeSource={RelativeSource AncestorType=ItemsControl}}"
CommandParameter="{Binding}"
TextDecorations="{x:Null}"
Foreground="#0066CC">
<Run Text="["/><Run Text="{Binding Number, Mode=OneWay}"/><Run Text="] " />
<Run Text="{Binding Name, Mode=OneWay}" FontWeight="SemiBold" />
</Hyperlink>
</TextBlock>
<TextBlock Text="{Binding Status, Converter={StaticResource HebrewStatus}}"
Foreground="Gray" FontSize="10" />
</StackPanel>
<Button Grid.Column="1"
Content="תייק"
Command="{Binding DataContext.FileToCaseCommand, RelativeSource={RelativeSource AncestorType=ItemsControl}}"
CommandParameter="{Binding}"
Padding="8,2"
Margin="6,0,0,0"
VerticalAlignment="Top"
ToolTip="תייק את המייל הנוכחי לתיק הזה" />
</Grid>
</Border>
</DataTemplate>
</ItemsControl.ItemTemplate>
</ItemsControl>
<TextBlock Text="(אין תיקים פתוחים)" Foreground="Gray" FontStyle="Italic"
Visibility="{Binding NoCasesVisibility}" Margin="0,4,0,0" />
</StackPanel>
<!-- Error -->
<TextBlock Visibility="{Binding ErrorVisibility}"
Text="{Binding ErrorMessage}"
Foreground="Firebrick" TextWrapping="Wrap" />
</Grid>
</ScrollViewer>
<StackPanel Grid.Row="2" Margin="0,8,0,0" Visibility="{Binding ActionsVisibility}">
<Button Content="תייק לתיק הזה"
Command="{Binding FileToThisCommand}"
Padding="8,4" Margin="0,0,0,4"
HorizontalAlignment="Stretch"
Visibility="{Binding SingleCaseFileVisibility}" />
<TextBlock Text="יש כמה תיקים מקושרים — בחר תיק מהרשימה למעלה."
Foreground="Gray" FontStyle="Italic" FontSize="10"
Margin="0,0,0,4"
Visibility="{Binding MultiCaseHintVisibility}" />
<Button Content="תייק למקום אחר…"
Command="{Binding FileElsewhereCommand}"
Padding="8,4" Margin="0,0,0,4"
HorizontalAlignment="Stretch" />
<Button Content="פתח ב-Klear"
Command="{Binding OpenInEspoCrmCommand}"
Padding="8,4"
HorizontalAlignment="Stretch" />
</StackPanel>
</Grid>
</UserControl>