[yew-devel] [PATCH yew-comp] token panel: ask for confirmation when removing a token

Maximiliano Sandoval m.sandoval at proxmox.com
Thu Oct 23 15:23:57 CEST 2025


Shannon Sterz <s.sterz at proxmox.com> writes:

> by using a `ConfirmButton` instead of just a `Button`.
>
> Signed-off-by: Shannon Sterz <s.sterz at proxmox.com>
> ---
>  src/token_panel.rs | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
>
> diff --git a/src/token_panel.rs b/src/token_panel.rs
> index 55795a6..d61063a 100644
> --- a/src/token_panel.rs
> +++ b/src/token_panel.rs
> @@ -190,7 +190,9 @@ impl LoadableComponent for ProxmoxTokenView {
>                      .on_activate(link.change_view_callback(|_| Some(ViewState::EditToken))),
>              )
>              .with_child(
> -                Button::new(tr!("Remove"))
> +                ConfirmButton::new(tr!("Remove"))
> +                    .confirm_message(tr!("Are you sure you want to remove the API token? \
> +                        All current usage sites will lose access!"))

I know this label is used already in other places and this is
pre-existing, but I am not sure if "usage sites" is easy to understand.

Perhaps something along the lines of "All users of the token will lose
access" is more straightforward.

>                      .disabled(disabled)
>                      .on_activate(link.callback(|_| Msg::Remove)),
>              )

-- 
Maximiliano




More information about the yew-devel mailing list