Improved visuals
ADD
WalletWasabi.Fluent/ViewModels/SearchBar/SearchItem/TransactionSearchItem.cs
+using System.Collections.Generic;
+using NBitcoin;
+using WalletWasabi.Fluent.ViewModels.Wallets.Home.History.HistoryItems;
+
+namespace WalletWasabi.Fluent.ViewModels.SearchBar.SearchItem;
+
+internal class TransactionSearchItem
+{
+ public HistoryItemViewModelBase Transaction { get; }
+
+ public TransactionSearchItem(HistoryItemViewModelBase transaction)
+ {
+ Transaction = transaction;
+ Labels = transaction.Label;
+ Date = transaction.Date;
+ Id = transaction.Id.ToString();
+ Amount = transaction.IncomingAmount ?? -transaction.OutgoingAmount ?? Money.Zero;
+ Balance = transaction.Balance;
+ }
+
+ public Money Balance { get; }
+
+ public string Id { get; }
+
+ public DateTimeOffset Date { get; set; }
+
+ public List<string> Labels { get; set; }
+
+ public Money Amount { get; }
+}
\ No newline at end of file

MODIFY
WalletWasabi.Fluent/ViewModels/SearchBar/Sources/TransactionsSource.cs
WalletWasabi.Fluent/ViewModels/SearchBar/Sources/TransactionsSource.cs
@@ -15,12 +15,7 @@ public class TransactionsSource : ISearchItemSource
private static ISearchItem ToSearchItem(TransactionEntry r)
{
var transactionId = r.HistoryItem.Id.ToString().Trim('0');
- var keywords = r.HistoryItem.Label.Concat(new[] { transactionId });
-
- var labels = r.HistoryItem.Label is not null ? string.Join(" ", r.HistoryItem.Label) : "";
- return new NonActionableSearchItem(r.HistoryItem.Date.Date.ToShortDateString(), labels, "Transactions", keywords.ToList(), "normal_transaction")
- {
- IsDefault = true,
- };
+ var keywords = r.HistoryItem.Label?.Concat(new[] { transactionId }) ?? Enumerable.Empty<string>();
+ return new NonActionableSearchItem(new TransactionSearchItem(r.HistoryItem), "", "Transactions", keywords.ToList(), "normal_transaction");
}
}
\ No newline at end of file

MODIFY
WalletWasabi.Fluent/Views/SearchBar/SearchBarDropdown.axaml
WalletWasabi.Fluent/Views/SearchBar/SearchBarDropdown.axaml
xmlns:conv="clr-namespace:WalletWasabi.Fluent.Converters"
xmlns:sb="clr-namespace:WalletWasabi.Fluent.ViewModels.SearchBar"
xmlns:searchItem="clr-namespace:WalletWasabi.Fluent.ViewModels.SearchBar.SearchItem"
- xmlns:settings="clr-namespace:WalletWasabi.Fluent.ViewModels.SearchBar.Settings">
+ xmlns:settings="clr-namespace:WalletWasabi.Fluent.ViewModels.SearchBar.Settings"
+ xmlns:sources="clr-namespace:WalletWasabi.Fluent.ViewModels.SearchBar.Sources"
+ xmlns:controls="clr-namespace:WalletWasabi.Fluent.Controls">
<Design.DataContext>
<sb:SearchBarDesignViewModel />
</Design.DataContext>
</settings:SettingSelector.DataTemplates>
</settings:SettingSelector>
+ <DataTemplate DataType="searchItem:TransactionSearchItem">
+ <DockPanel ToolTip.Tip="{Binding Id}">
+ <TextBlock VerticalAlignment="Center" DockPanel.Dock="Right" Text="{Binding Amount, Converter={x:Static conv:MoneyConverters.ToFormattedString}}" Margin="10 0" />
+ <TextBlock VerticalAlignment="Center" DockPanel.Dock="Right" Text="{Binding Date, StringFormat='{}{0:d}'}" Margin="10 0" />
+ <controls:LabelsListBox Items="{Binding Labels}" Margin="10 0" />
+ </DockPanel>
+ </DataTemplate>
+
<DataTemplate DataType="searchItem:NonActionableSearchItem">
<DockPanel Background="Transparent" Margin="10">
<PathIcon Data="{Binding Icon, Converter={x:Static conv:NavBarIconConverter.Instance}}" />
<Image Source="{Binding Icon, Converter={x:Static conv:NavBarIconConverter.Instance}}" />
</Panel>
- <TextBlock Margin="10 0 10 0" Text="{Binding Name}" VerticalAlignment="Center" />
+ <TextBlock Margin="10 0 10 0" Text="{Binding Name}" VerticalAlignment="Center" IsVisible="{Binding Name, Converter={x:Static StringConverters.IsNotNullOrEmpty}}" />
<ContentControl HorizontalContentAlignment="Stretch"
VerticalContentAlignment="Stretch"
Content="{Binding Content}" />
</Button>
</DataTemplate>
+
</UserControl.DataTemplates>
<ItemsControl Items="{Binding Groups}">

Improved visuals