Skip to content

Commit

Permalink
Add Speed Up Confirmed indicator
Browse files Browse the repository at this point in the history
  • Loading branch information
SuperJMN committed May 28, 2024
1 parent 04b8472 commit 1673cb0
Show file tree
Hide file tree
Showing 6 changed files with 22 additions and 4 deletions.
2 changes: 2 additions & 0 deletions WalletWasabi.Fluent/Icons/Icons.axaml
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@
<PathIcon Data="{StaticResource down_arrow}" />
<PathIcon Data="{StaticResource sorting}" />
<PathIcon Data="{StaticResource rocket_bolt}" />
<PathIcon Data="{StaticResource rocket_confirmed}" />
</WrapPanel>
</Design.PreviewWith>
<Style>
Expand Down Expand Up @@ -199,6 +200,7 @@
<StreamGeometry x:Key="sorting">M3.28077 0L3.21719 0.00427978C2.98846 0.0353077 2.81217 0.231366 2.81217 0.468605L2.81163 8.39866L0.79982 6.38828L0.747243 6.34292C0.563737 6.2069 0.303405 6.22214 0.137112 6.38853C-0.0458124 6.57166 -0.0456874 6.86832 0.137387 7.05126L2.95137 9.86289L3.00395 9.90826C3.18745 10.0443 3.44778 10.029 3.61408 9.86264L6.42339 7.05101L6.46869 6.9984C6.60477 6.8149 6.58953 6.55454 6.42308 6.38828L6.37053 6.34292C6.18703 6.2069 5.92667 6.22214 5.76035 6.38853L3.74884 8.40116L3.74938 0.468605L3.7451 0.405019C3.71407 0.176289 3.51801 0 3.28077 0ZM5.46706 0.312404C5.20827 0.312404 4.99846 0.522208 4.99846 0.781009C4.99846 1.03981 5.20827 1.24961 5.46706 1.24961H10.4655C10.7243 1.24961 10.9341 1.03981 10.9341 0.781009C10.9341 0.522208 10.7243 0.312404 10.4655 0.312404H5.46706ZM4.99846 2.65543C4.99846 2.39663 5.20827 2.18683 5.46706 2.18683H8.5911C8.84989 2.18683 9.0597 2.39663 9.0597 2.65543C9.0597 2.91423 8.84989 3.12404 8.5911 3.12404H5.46706C5.20827 3.12404 4.99846 2.91423 4.99846 2.65543ZM5.46706 4.06125C5.20827 4.06125 4.99846 4.27106 4.99846 4.52985C4.99846 4.78865 5.20827 4.99846 5.46706 4.99846H6.71668C6.97547 4.99846 7.18528 4.78865 7.18528 4.52985C7.18528 4.27106 6.97547 4.06125 6.71668 4.06125H5.46706Z</StreamGeometry>
<StreamGeometry x:Key="mail_unread">M16 6.5H5.25a1.75 1.75 0 0 0-1.744 1.606l-.004.1L11 12.153l6.03-3.174a3.489 3.489 0 0 0 2.97.985v6.786a3.25 3.25 0 0 1-3.066 3.245L16.75 20H5.25a3.25 3.25 0 0 1-3.245-3.066L2 16.75v-8.5a3.25 3.25 0 0 1 3.066-3.245L5.25 5h11.087A3.487 3.487 0 0 0 16 6.5Zm2.5 3.399-7.15 3.765a.75.75 0 0 1-.603.042l-.096-.042L3.5 9.9v6.85a1.75 1.75 0 0 0 1.606 1.744l.144.006h11.5a1.75 1.75 0 0 0 1.744-1.607l.006-.143V9.899ZM19.5 4a2.5 2.5 0 1 1 0 5 2.5 2.5 0 0 1 0-5Z</StreamGeometry>
<StreamGeometry x:Key="rocket_bolt">M 19.18 2.33 c -0.27 -0.87 -0.95 -1.55 -1.82 -1.82 l -0.67 -0.21 c -2.41 -0.75 -5.03 -0.1 -6.81 1.68 c -1.81 1.81 -3.61 3.62 -5.42 5.42 c -0.69 0.69 -0.69 1.8 0 2.49 l 0.5 0.5 l -1.4 0.8 c -0.36 0.21 -0.49 0.67 -0.28 1.03 c 0.03 0.06 0.07 0.11 0.12 0.16 l 3.9 3.91 c 0.29 0.29 0.77 0.29 1.07 0 c 0.05 -0.05 0.09 -0.1 0.12 -0.16 l 0.8 -1.4 l 0.5 0.5 c 0.69 0.69 1.8 0.69 2.49 0 c 0 0 0 0 0 0 c 1.81 -1.81 3.61 -3.62 5.42 -5.42 c 1.78 -1.78 2.43 -4.4 1.68 -6.81 l -0.2 -0.67 Z M 16.91 1.95 c 0.4 0.12 0.71 0.43 0.83 0.83 l 0.21 0.67 c 0.58 1.87 0.08 3.91 -1.31 5.3 l -5.42 5.42 c -0.1 0.1 -0.26 0.1 -0.35 0 l -5.33 -5.33 c -0.1 -0.1 -0.1 -0.26 0 -0.35 c 0 0 0 0 0 0 l 5.42 -5.42 c 1.38 -1.39 3.42 -1.89 5.29 -1.31 l 0.66 0.21 Z M 8.19 13.63 l -0.52 0.9 l -2.51 -2.51 l 0.9 -0.51 l 2.13 2.13 Z M 4.28 16.47 c 0.28 -0.31 0.26 -0.78 -0.04 -1.07 c -0.29 -0.27 -0.73 -0.27 -1.02 0 l -2.49 2.49 c -0.28 0.31 -0.26 0.78 0.04 1.07 c 0.29 0.27 0.73 0.27 1.02 0 l 2.49 -2.49 Z M 2.33 13.45 c 0.29 0.29 0.29 0.77 0 1.07 l -1.07 1.07 c -0.31 0.28 -0.78 0.26 -1.07 -0.04 c -0.27 -0.29 -0.27 -0.73 0 -1.02 l 1.07 -1.07 c 0.29 -0.29 0.77 -0.29 1.07 0 Z M 6.24 18.43 c 0.31 -0.28 0.33 -0.76 0.04 -1.07 c -0.28 -0.31 -0.76 -0.33 -1.07 -0.04 c -0.02 0.01 -0.03 0.03 -0.04 0.04 l -1.06 1.06 c -0.31 0.28 -0.33 0.76 -0.04 1.07 c 0.28 0.31 0.76 0.33 1.07 0.04 c 0.02 -0.01 0.03 -0.03 0.04 -0.04 l 1.06 -1.06 Z M 14.38 7.1 l -2.63 4.03 c -0.09 0.15 -0.26 0.24 -0.43 0.24 c -0.35 0 -0.6 -0.35 -0.49 -0.68 l 0.77 -2.32 h -0.78 c -0.35 0 -0.59 -0.35 -0.47 -0.68 l 1.13 -3 c 0.07 -0.19 0.26 -0.32 0.47 -0.32 h 1.43 c 0.35 0 0.59 0.35 0.47 0.68 l -0.5 1.32 h 0.63 c 0.38 0 0.6 0.41 0.4 0.73 Z</StreamGeometry>
<StreamGeometry x:Key="rocket_confirmed">M 17.28 10.23 C 16.73 10.01 16.13 9.89 15.5 9.88 C 15.45 9.87 15.39 9.87 15.34 9.87 c -2.38 0 -4.4 1.51 -5.16 3.62 c -0.21 0.56 -0.33 1.16 -0.34 1.79 v 0.09 c 0 3.04 2.46 5.5 5.5 5.5 c 3.04 0 5.5 -2.46 5.5 -5.5 c 0 -2.36 -1.48 -4.36 -3.56 -5.14 z m 0.77 3.93 l -3.13 3.13 c -0.09 0.09 -0.22 0.14 -0.35 0.14 c -0.14 0 -0.26 -0.05 -0.36 -0.14 l -1.58 -1.58 c -0.19 -0.2 -0.19 -0.51 0 -0.71 c 0.2 -0.19 0.52 -0.19 0.71 0 l 1.23 1.23 l 2.77 -2.78 c 0.19 -0.19 0.51 -0.19 0.71 0 c 0.19 0.2 0.19 0.52 0 0.71 z m -3.82 -8.7 c -0.98 -0.98 -2.57 -0.98 -3.55 0 c -0.49 0.49 -0.74 1.13 -0.74 1.77 c 0 0.64 0.25 1.29 0.74 1.78 c 0.37 0.37 0.82 0.6 1.3 0.69 c 0.72 -0.44 1.53 -0.73 2.4 -0.86 c 0.83 -0.99 0.78 -2.45 -0.15 -3.38 z m -1.06 2.49 c -0.4 0.39 -1.03 0.39 -1.42 0 c -0.4 -0.4 -0.4 -1.03 0 -1.43 c 0.39 -0.39 1.02 -0.39 1.42 0 v 0 c 0.39 0.4 0.39 1.03 0 1.43 z m 1.06 -2.49 c -0.98 -0.98 -2.57 -0.98 -3.55 0 c -0.49 0.49 -0.74 1.13 -0.74 1.77 c 0 0.64 0.25 1.29 0.74 1.78 c 0.37 0.37 0.82 0.6 1.3 0.69 c 0.72 -0.44 1.53 -0.73 2.4 -0.86 c 0.83 -0.99 0.78 -2.45 -0.15 -3.38 z m -1.06 2.49 c -0.4 0.39 -1.03 0.39 -1.42 0 c -0.4 -0.4 -0.4 -1.03 0 -1.43 c 0.39 -0.39 1.02 -0.39 1.42 0 v 0 c 0.39 0.4 0.39 1.03 0 1.43 z M 19.38 3 L 19.17 2.34 C 18.9 1.47 18.22 0.79 17.35 0.52 L 16.69 0.31 C 14.28 -0.44 11.66 0.21 9.88 1.99 l -1 1 C 7.48 1.94 5.52 2.08 4.29 3.32 L 3.04 4.57 c -0.29 0.29 -0.29 0.77 0 1.06 l 1.6 1.6 l -0.18 0.18 c -0.69 0.69 -0.69 1.8 0 2.49 l 0.5 0.5 l -1.41 0.8 c -0.36 0.21 -0.48 0.67 -0.28 1.03 c 0.04 0.06 0.08 0.11 0.13 0.16 l 3.9 3.91 c 0.29 0.29 0.77 0.29 1.07 0 c 0.04 -0.05 0.08 -0.1 0.12 -0.16 l 0.26 -0.46 c -0.01 -0.1 -0.01 -0.2 -0.01 -0.31 c 0 -0.97 0.21 -1.89 0.6 -2.72 L 5.52 8.83 C 5.43 8.74 5.43 8.58 5.52 8.48 l 5.43 -5.42 c 1.38 -1.39 3.42 -1.89 5.29 -1.31 l 0.67 0.21 c 0.39 0.12 0.7 0.43 0.82 0.82 l 0.21 0.67 c 0.58 1.87 0.08 3.91 -1.31 5.3 l -0.12 0.13 c 0.56 0.09 1.09 0.26 1.58 0.5 C 19.57 7.62 20.06 5.22 19.38 3 Z M 6.06 11.5 L 8.19 13.63 L 7.67 14.53 L 5.16 12.02 Z M 5.7 6.17 L 4.64 5.1 L 5.35 4.39 C 6 3.74 7.01 3.61 7.8 4.08 Z m 8.53 -0.71 c -0.98 -0.98 -2.57 -0.98 -3.55 0 c -0.49 0.49 -0.74 1.13 -0.74 1.77 c 0 0.64 0.25 1.29 0.74 1.78 c 0.37 0.37 0.82 0.6 1.3 0.69 c 0.72 -0.44 1.53 -0.73 2.4 -0.86 c 0.83 -0.99 0.78 -2.45 -0.15 -3.38 z m -1.06 2.49 c -0.4 0.39 -1.03 0.39 -1.42 0 c -0.4 -0.4 -0.4 -1.03 0 -1.43 c 0.39 -0.39 1.02 -0.39 1.42 0 v 0 c 0.39 0.4 0.39 1.03 0 1.43 z m 1.06 -2.49 c -0.98 -0.98 -2.57 -0.98 -3.55 0 c -0.49 0.49 -0.74 1.13 -0.74 1.77 c 0 0.64 0.25 1.29 0.74 1.78 c 0.37 0.37 0.82 0.6 1.3 0.69 c 0.72 -0.44 1.53 -0.73 2.4 -0.86 c 0.83 -0.99 0.78 -2.45 -0.15 -3.38 z m -1.06 2.49 c -0.4 0.39 -1.03 0.39 -1.42 0 c -0.4 -0.4 -0.4 -1.03 0 -1.43 c 0.39 -0.39 1.02 -0.39 1.42 0 v 0 c 0.39 0.4 0.39 1.03 0 1.43 z M 4.24 15.41 C 3.95 15.14 3.5 15.14 3.22 15.41 L 0.73 17.9 c -0.28 0.3 -0.26 0.78 0.04 1.06 c 0.29 0.27 0.74 0.27 1.02 0 L 4.28 16.48 C 4.56 16.17 4.54 15.69 4.24 15.41 Z M 2.33 13.46 c -0.3 -0.3 -0.77 -0.3 -1.07 0 L 0.2 14.52 c -0.27 0.29 -0.27 0.74 0 1.02 c 0.28 0.31 0.76 0.33 1.06 0.05 l 1.07 -1.07 c 0.29 -0.29 0.29 -0.77 0 -1.06 z m 3.95 3.91 C 6 17.06 5.52 17.04 5.21 17.32 C 5.2 17.34 5.18 17.35 5.17 17.37 l -1.06 1.06 c -0.31 0.28 -0.33 0.76 -0.05 1.06 c 0.29 0.31 0.76 0.33 1.07 0.05 c 0.01 -0.02 0.03 -0.03 0.04 -0.05 l 1.06 -1.06 c 0.31 -0.28 0.33 -0.76 0.05 -1.06 z</StreamGeometry>

<ControlTemplate x:Key="wasabi_logo_text_dynamic">
<StackPanel Margin="0,0,0,-5" TextElement.FontFamily="{StaticResource WasabiLogoTextFont}"
Expand Down
2 changes: 2 additions & 0 deletions WalletWasabi.Fluent/Models/Wallets/TransactionModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,8 @@ public partial class TransactionModel : ReactiveObject
public bool IsCancellation => Type == TransactionType.Cancellation;

public FeeRate? FeeRate { get; set; }

public bool HasBeenSpedUp { get; set; }

private Money GetAmount()
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -188,6 +188,7 @@ private TransactionModel CreateSpeedUpGroup(TransactionSummary transactionSummar
isConfirmed
? TransactionStatus.Confirmed
: TransactionStatus.Pending,
HasBeenSpedUp = true,
};

var dates = children.Select(tx => tx.Date).ToImmutableArray();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ protected HistoryItemViewModelBase(TransactionModel transaction)
Transaction = transaction;
IsChild = transaction.IsChild;
ClipboardCopyCommand = ReactiveCommand.CreateFromTask<string>(text => UiContext.Clipboard.SetTextAsync(text));
HasBeenSpedUp = transaction.HasBeenSpedUp;

this.WhenAnyValue(x => x.IsFlashing)
.Where(x => x)
Expand Down Expand Up @@ -55,6 +56,8 @@ protected HistoryItemViewModelBase(TransactionModel transaction)
.Subscribe();
}

public bool HasBeenSpedUp { get; set; }

protected HistoryItemViewModelBase(UiContext uiContext, TransactionModel transaction) : this(transaction)
{
UiContext = uiContext;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,17 +9,22 @@ namespace WalletWasabi.Fluent.ViewModels.Wallets.Home.History.HistoryItems;
public partial class TransactionHistoryItemViewModel : HistoryItemViewModelBase
{
private IWalletModel _wallet;
private readonly TransactionModel _transaction;

private TransactionHistoryItemViewModel(IWalletModel wallet, TransactionModel transaction) : base(transaction)
{
_wallet = wallet;
_transaction = transaction;

ShowDetailsCommand = ReactiveCommand.Create(() => UiContext.Navigate().To().TransactionDetails(wallet, transaction));
SpeedUpTransactionCommand = ReactiveCommand.Create(() => OnSpeedUpTransaction(transaction), Observable.Return(transaction.CanSpeedUpTransaction && !IsChild));
SpeedUpTransactionCommand = ReactiveCommand.Create(() => OnSpeedUpTransaction(transaction), Observable.Return(CanBeSpedUp));
CancelTransactionCommand = ReactiveCommand.Create(() => OnCancelTransaction(transaction), Observable.Return(transaction.CanCancelTransaction));
HasBeenSpedUp = transaction.HasBeenSpedUp;
}

public bool TransactionOperationsVisible => (Transaction.CanCancelTransaction || Transaction.CanSpeedUpTransaction) && !IsChild;
private bool CanBeSpedUp => _transaction.CanSpeedUpTransaction && !IsChild && !_transaction.HasBeenSpedUp;

public bool TransactionOperationsVisible => Transaction.CanCancelTransaction || CanBeSpedUp;

private void OnSpeedUpTransaction(TransactionModel transaction)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:viewmodel="clr-namespace:WalletWasabi.Fluent.ViewModels.Wallets.Home.History.HistoryItems"
mc:Ignorable="d" d:DesignWidth="100" d:DesignHeight="50"
mc:Ignorable="d" d:DesignWidth="200" d:DesignHeight="50"
x:Class="WalletWasabi.Fluent.Views.Wallets.Home.History.Columns.ActionsColumnView"
x:CompileBindings="True"
x:DataType="viewmodel:HistoryItemViewModelBase">
Expand All @@ -24,7 +24,12 @@
</Classes.transparent>
<InvalidatingStackPanel Orientation="Horizontal" HorizontalAlignment="Center" Spacing="15" Margin="15 0">

<!-- SpeedUp -->
<!--Speed Up Confirmed indicator-->
<PathIcon IsVisible="{Binding HasBeenSpedUp}"
ToolTip.Tip="This transaction has been sped up"
Height="16" Data="{StaticResource rocket_confirmed}" />

<!-- SpeedUp button -->
<Button Classes="plain" ToolTip.Tip="Speed Up Transaction"
Command="{Binding SpeedUpTransactionCommand}"
IsVisible="{Binding $self.IsEffectivelyEnabled}">
Expand Down

0 comments on commit 1673cb0

Please sign in to comment.