more transaction tab UI refinement
MODIFY
WalletWasabi.Gui/Controls/WalletExplorer/TransactionViewerView.xaml
WalletWasabi.Gui/Controls/WalletExplorer/TransactionViewerView.xaml
xmlns:controls="clr-namespace:WalletWasabi.Gui.Controls;assembly=WalletWasabi.Gui"
xmlns:iac="clr-namespace:Avalonia.Xaml.Interactions.Custom;assembly=Avalonia.Xaml.Interactions.Custom"
xmlns:converters="clr-namespace:WalletWasabi.Gui.Converters;assembly=WalletWasabi.Gui"
- xmlns:local="clr-namespace:WalletWasabi.Gui.Controls.WalletExplorer;assembly=WalletWasabi.Gui"
- x:Class="WalletWasabi.Gui.Controls.WalletExplorer.TransactionViewerView"
- mc:Ignorable="d" d:DesignWidth="800" d:DesignHeight="450">
+ xmlns:local="clr-namespace:WalletWasabi.Gui.Controls.WalletExplorer;assembly=WalletWasabi.Gui" x:Class="WalletWasabi.Gui.Controls.WalletExplorer.TransactionViewerView" mc:Ignorable="d" d:DesignWidth="800" d:DesignHeight="450">
<UserControl.Resources>
<converters:LurkingWifeModeStringConverter x:Key="LurkingWifeModeStringConverter" />
</UserControl.Resources>
<controls:GroupBox Title="{Binding Title}" TextBlock.FontSize="30" Padding="20" Margin="10">
<Grid Classes="content">
<DockPanel LastChildFill="True">
- <StackPanel DockPanel.Dock="Bottom" HorizontalAlignment="Right" Orientation="Horizontal" Spacing="10" Margin="5,0">
- <Button Command="{Binding OpenTransactionBroadcaster}" Content="Open Transaction Broadcaster" />
- <!-- <Button Command="{Binding ExportBinaryPsbt}" Content="Export Binary PSBT" /> -->
+ <Panel DockPanel.Dock="Bottom" Height="64" Margin="0 0 0 -20">
+ <StackPanel HorizontalAlignment="Right" VerticalAlignment="Center" Orientation="Horizontal" Spacing="10">
<Button Command="{Binding CopyTransactionHex}" Content="Copy Transaction Hex" />
<Button Command="{Binding CopyBase64Psbt}" Content="Copy Base64 PSBT" />
+ <Panel Width="12"/>
+ <Button Command="{Binding OpenTransactionBroadcaster}" Content="Open Transaction Broadcaster" />
</StackPanel>
+ </Panel>
<Grid ScrollViewer.VerticalScrollBarVisibility="Auto" RowDefinitions="26,1*">
- <StackPanel Grid.Row="0" Orientation="Horizontal" Margin="0 8 0 0" Spacing="5">
+ <StackPanel Grid.Row="0" Orientation="Horizontal" Spacing="5">
<TextBlock Text="Transaction ID:" FontWeight="Bold" />
<controls:ExtendedTextBox Text="{Binding TxId, ConverterParameter=50, Converter={StaticResource LurkingWifeModeStringConverter}, Mode=OneWay}" Classes="selectableTextBlock" />
</StackPanel>
<DockPanel LastChildFill="True" Grid.Row="1" Margin="0 8 0 0">
- <TextBlock DockPanel.Dock="Top" Text="{Binding PsbtJsonTextHeader}" FontWeight="Bold" />
+ <StackPanel DockPanel.Dock="Top" Orientation="Vertical" Margin="0 8 0 0" Spacing="5">
+ <TextBlock IsVisible="{Binding IsPsbtJsonTextTruncated}" Text="The JSON text in this preview has been truncated due to its large size." FontWeight="Bold" Classes="warningMessage" />
+ <TextBlock Text="PSBT JSON Preview:" FontWeight="Bold" />
+ </StackPanel>
<controls:MultiTextBox Margin="0 8 0 0" Text="{Binding TruncatedPsbtJsonText, ConverterParameter=1536, Converter={StaticResource LurkingWifeModeStringConverter}, Mode=OneWay}" IsSelectable="False" IsReadOnly="True" TextWrapping="Wrap" AcceptsReturn="True" />
</DockPanel>
</Grid>

MODIFY
WalletWasabi.Gui/Controls/WalletExplorer/TransactionViewerViewModel.cs
WalletWasabi.Gui/Controls/WalletExplorer/TransactionViewerViewModel.cs
@@ -24,14 +24,14 @@ namespace WalletWasabi.Gui.Controls.WalletExplorer
{
public class TransactionViewerViewModel : WasabiDocumentTabViewModel
{
- private readonly int _jsonCharLimit = 5_0;
+ private readonly int _jsonCharLimit = 2_500;
private string _txId;
private string _psbtJsonText;
- private string _psbtJsonTextHeader;
private string _truncatedPsbtJsonText;
private string _psbtHexText;
private string _psbtBase64Text;
private byte[] _psbtBytes;
+ private bool _IsPsbtJsonTextTruncated;
public TransactionViewerViewModel() : base("Transaction")
{
@@ -104,7 +104,6 @@ namespace WalletWasabi.Gui.Controls.WalletExplorer
public ReactiveCommand<Unit, Unit> ExportBinaryPsbt { get; set; }
public ReactiveCommand<Unit, Unit> CopyTransactionHex { get; set; }
public ReactiveCommand<Unit, Unit> CopyBase64Psbt { get; set; }
-
public ReactiveCommand<Unit, Unit> OpenTransactionBroadcaster { get; set; }
public bool? IsLurkingWifeMode => Global.UiConfig.LurkingWifeMode;
@@ -121,20 +120,12 @@ namespace WalletWasabi.Gui.Controls.WalletExplorer
set => this.RaiseAndSetIfChanged(ref _psbtJsonText, value);
}
- public string PsbtJsonTextHeader
- {
- get => _psbtJsonTextHeader;
- set => this.RaiseAndSetIfChanged(ref _psbtJsonTextHeader, value);
- }
-
public string TruncatedPsbtJsonText
{
get => _truncatedPsbtJsonText;
set => this.RaiseAndSetIfChanged(ref _truncatedPsbtJsonText, value);
}
-
-
public string TransactionHexText
{
get => _psbtHexText;
@@ -153,6 +144,12 @@ namespace WalletWasabi.Gui.Controls.WalletExplorer
set => this.RaiseAndSetIfChanged(ref _psbtBytes, value);
}
+ public bool IsPsbtJsonTextTruncated
+ {
+ get => _IsPsbtJsonTextTruncated;
+ set => this.RaiseAndSetIfChanged(ref _IsPsbtJsonTextTruncated, value);
+ }
+
public override void OnOpen(CompositeDisposable disposables)
{
base.OnOpen(disposables);
@@ -177,10 +174,9 @@ namespace WalletWasabi.Gui.Controls.WalletExplorer
TxId = result.Transaction.GetHash().ToString();
PsbtJsonText = result.Psbt.ToString();
- var isTruncated = PsbtJsonText.Length > _jsonCharLimit;
+ IsPsbtJsonTextTruncated = PsbtJsonText.Length > _jsonCharLimit;
- TruncatedPsbtJsonText = isTruncated ? $"{PsbtJsonText[0.._jsonCharLimit]}..." : PsbtJsonText;
- PsbtJsonTextHeader = isTruncated ? "PSBT Json (Truncated)" : "PSBT Json";
+ TruncatedPsbtJsonText = IsPsbtJsonTextTruncated ? $"{PsbtJsonText[0.._jsonCharLimit]}..." : PsbtJsonText;
TransactionHexText = result.Transaction.Transaction.ToHex();
PsbtBase64Text = result.Psbt.ToBase64();

more transaction tab UI refinement