Updating Wallets Label managment page
What changed, and why it matters
This commit is a routine UI rename and tidy-up. It changes the wallet label deletion page from saying 'Remove' to 'Delete', renames the underlying action method from RemoveWalletLabel to DeleteWalletLabel, and updates the matching URL from /remove to /delete. It also adds a breadcrumb navigation bar and fixes some indentation. There is no security-relevant change.
No security action required; this is a non-functional UI/UX refactor.
Security signals we found
No strong security signals were identified.
Evidence from the diff
The diff renames an MVC action and route segment in UIWalletsController.cs (RemoveWalletLabel -> DeleteWalletLabel, /remove -> /delete) and updates localized strings and Razor view references in WalletLabels.cshtml accordingly. It also adds a sticky breadcrumb header and reformats markup. No authorization, validation, input handling, or data-access logic is altered.
Changed components
BTCPayServer/Controllers/UIWalletsController.csBTCPayServer/Views/UIWallets/WalletLabels.cshtmlInspect captured patch +46 / −27
diff --git a/BTCPayServer/Controllers/UIWalletsController.cs b/BTCPayServer/Controllers/UIWalletsController.cs
index 48fdcce..c36d019 100644
--- a/BTCPayServer/Controllers/UIWalletsController.cs
+++ b/BTCPayServer/Controllers/UIWalletsController.cs
@@ -1917,20 +1917,20 @@ namespace BTCPayServer.Controllers
return View(vm);
}
- [HttpPost("{walletId}/labels/{id}/remove")]
- public async Task<IActionResult> RemoveWalletLabel(
+ [HttpPost("{walletId}/labels/{id}/delete")]
+ public async Task<IActionResult> DeleteWalletLabel(
[ModelBinder(typeof(WalletIdModelBinder))]
WalletId walletId, string id)
{
var labels = new[] { id };
- ;
+
if (await WalletRepository.RemoveWalletLabels(walletId, labels))
{
- TempData[WellKnownTempData.SuccessMessage] = StringLocalizer["The label has been successfully removed."].Value;
+ TempData[WellKnownTempData.SuccessMessage] = StringLocalizer["The label has been successfully deleted."].Value;
}
else
{
- TempData[WellKnownTempData.ErrorMessage] = StringLocalizer["The label could not be removed."].Value;
+ TempData[WellKnownTempData.ErrorMessage] = StringLocalizer["The label could not be deleted."].Value;
}
return RedirectToAction(nameof(WalletLabels), new { walletId });
diff --git a/BTCPayServer/Views/UIWallets/WalletLabels.cshtml b/BTCPayServer/Views/UIWallets/WalletLabels.cshtml
index 88fa08f..87135a8 100644
--- a/BTCPayServer/Views/UIWallets/WalletLabels.cshtml
+++ b/BTCPayServer/Views/UIWallets/WalletLabels.cshtml
@@ -8,11 +8,24 @@
@section PageFootContent {
<script>
- delegate('click', '.btn-delete', event => { event.preventDefault() })
+ delegate('click', '.btn-delete', event => {
+ event.preventDefault()
+ })
</script>
}
-<h2 class="mb-2 mb-lg-3">@ViewData["Title"]</h2>
+<div class="sticky-header">
+ <nav aria-label="breadcrumb">
+ <ol class="breadcrumb">
+ <li class="breadcrumb-item">
+ <a asp-action="WalletTransactions" asp-controller="UIWallets" asp-route-walletId="@walletId" text-translate="true">Transactions</a>
+ </li>
+ <li class="breadcrumb-item active" aria-current="page">Labels</li>
+ </ol>
+ <h2>@ViewData["Title"]</h2>
+ </nav>
+</div>
+
<partial name="_StatusMessage" />
@if (Model.Labels.Any())
@@ -28,35 +41,41 @@
<tbody>
@foreach (var label in Model.Labels)
{
- <tr>
- <td>
- <div class="transaction-label" style="--label-bg:@label.Color;--label-fg:@label.TextColor">
- <span>@label.Label</span>
- </div>
- </td>
+ <tr>
+ <td>
+ <div class="transaction-label" style="--label-bg:@label.Color;--label-fg:@label.TextColor">
+ <span>@label.Label</span>
+ </div>
+ </td>
- <td class="text-end">
- <a class="btn btn-link p-0 me-3"
- href="@Url.Action("ReservedAddresses", "UIWallets", new { walletId = Model.WalletId.ToString(), filter = label.Label })"
- title="View Reserved Addresses with this label">
- Addresses
- </a>
- <form method="post" asp-action="RemoveWalletLabel" asp-route-walletId="@Model.WalletId" asp-route-id="@label.Label" class="d-inline">
- <button class="btn btn-link btn-delete p-0 me-3" type="submit" data-bs-toggle="modal" data-bs-target="#ConfirmModal" data-description="@StringLocalizer["The label {0} will be removed from this wallet and its associated transactions.", Html.Encode(label.Label)]" data-confirm-input="@StringLocalizer["DELETE"]" text-translate="true">Remove</button>
- </form>
- </td>
- </tr>
+ <td class="text-end">
+ <a class="btn btn-link p-0 me-3"
+ href="@Url.Action("ReservedAddresses", "UIWallets", new { walletId = Model.WalletId.ToString(), filter = label.Label })"
+ title="View Reserved Addresses with this label">
+ Addresses
+ </a>
+ <form method="post" asp-action="DeleteWalletLabel" asp-route-walletId="@Model.WalletId" asp-route-id="@label.Label"
+ class="d-inline">
+ <button class="btn btn-link btn-delete p-0 me-3" type="submit" data-bs-toggle="modal" data-bs-target="#ConfirmModal"
+ data-description="@StringLocalizer["The label {0} will be deleted from this wallet and its associated transactions.", Html.Encode(label.Label)]"
+ data-confirm-input="@StringLocalizer["DELETE"]" text-translate="true">Delete
+ </button>
+ </form>
+ </td>
+ </tr>
}
</tbody>
</table>
</div>
- <partial name="_Confirm" model="@(new ConfirmModel(StringLocalizer["Remove label"], StringLocalizer["This label will be removed from this wallet and its associated transactions."], StringLocalizer["Delete"]))" />
+ <partial name="_Confirm"
+ model="@(new ConfirmModel(StringLocalizer["Delete label"],
+ StringLocalizer["This label will be deleted from this wallet and its associated transactions."], StringLocalizer["Delete"]))" />
}
else
{
<p class="text-secondary mt-3">
@ViewLocalizer["There are no custom labels yet. You can create custom labels by assigning them to your {0}.",
- Html.ActionLink(StringLocalizer["transactions"], "WalletTransactions", "UIWallets", new { walletId })]
+ Html.ActionLink(StringLocalizer["transactions"],
+ "WalletTransactions", "UIWallets", new { walletId })]
</p>
}
-
Why this scored 15/100
Community notes
Notes can correct, qualify, or add evidence to the AI analysis. Every note shown here has been validated by a human moderator.
The AI analysis stands alone for now. Submit a note if you can add evidence or important context.