From de60bd239d7235af8f5fb9f101b08b5770b628d1 Mon Sep 17 00:00:00 2001 From: TekH Date: Mon, 8 Jun 2026 13:18:52 +0200 Subject: [PATCH] Add reset button to PDF toolbar for signature reset Added a reset button to the PDF toolbar in `EnvelopeViewer.razor` to allow users to reset all signatures and state. The button is conditionally displayed when there are signed signatures (`_signedSignatures > 0`). Implemented the `RestartSigning` method to reload the page and reset all signatures by navigating to the current URI with `forceLoad: true`. Introduced new styles in `envelope-viewer.css` for the reset button, including hover effects, background gradients, border colors, and transitions for a polished user experience. Updated the reset button to include an SVG icon with hover effects for better visual feedback and consistency with the application's design. --- .../Pages/EnvelopeViewer.razor | 21 +++++++++++++++++ .../wwwroot/css/envelope-viewer.css | 23 +++++++++++++++++++ 2 files changed, 44 insertions(+) diff --git a/EnvelopeGenerator.ReceiverUI/Pages/EnvelopeViewer.razor b/EnvelopeGenerator.ReceiverUI/Pages/EnvelopeViewer.razor index c1f50ae5..f983a507 100644 --- a/EnvelopeGenerator.ReceiverUI/Pages/EnvelopeViewer.razor +++ b/EnvelopeGenerator.ReceiverUI/Pages/EnvelopeViewer.razor @@ -256,6 +256,22 @@ + +
+ + @* Reset button - only show when signatures are signed *@ + @if (_signedSignatures > 0) { +
+ +
+ } } } @@ -777,6 +793,11 @@ const int MaxThumbnailWidth = 400; await JSRuntime.InvokeVoidAsync("pdfViewer.goToNextSignature", _dotNetRef); } + void RestartSigning() { + // Force page reload to reset all signatures and state + Navigation.NavigateTo(Navigation.Uri, forceLoad: true); + } + record SignatureNavState(int Total, int Signed, int Unsigned, int CurrentIndex, bool CanGoPrev, bool CanGoNext); // Signature popup methods diff --git a/EnvelopeGenerator.ReceiverUI/wwwroot/css/envelope-viewer.css b/EnvelopeGenerator.ReceiverUI/wwwroot/css/envelope-viewer.css index 6c2a46d3..43c39bc2 100644 --- a/EnvelopeGenerator.ReceiverUI/wwwroot/css/envelope-viewer.css +++ b/EnvelopeGenerator.ReceiverUI/wwwroot/css/envelope-viewer.css @@ -461,6 +461,29 @@ body.resizing { color: #059669; } +/* Reset Button Styles */ +.pdf-toolbar__btn--reset { + background: linear-gradient(135deg, rgba(239, 68, 68, 0.08) 0%, rgba(220, 38, 38, 0.08) 100%); + border-color: rgba(239, 68, 68, 0.3); + color: #dc2626; +} + +.pdf-toolbar__btn--reset:hover:not(:disabled) { + background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%); + border-color: transparent; + color: white; + transform: translateY(-1px); + box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3); +} + +.pdf-toolbar__btn--reset svg { + transition: color 0.2s ease; +} + +.pdf-toolbar__btn--reset:hover:not(:disabled) svg { + color: white; +} + .pdf-frame { background: white; border-radius: 16px;