public inbox for pve-devel@lists.proxmox.com
 help / color / mirror / Atom feed
From: Arthur Bied-Charreton <a.bied-charreton@proxmox.com>
To: Thomas Lamprecht <t.lamprecht@proxmox.com>
Cc: pve-devel@lists.proxmox.com
Subject: Re: [PATCH manager 1/2] ui: vCPU flag selector: replace radio group with segmented button
Date: Tue, 26 May 2026 08:02:45 +0200	[thread overview]
Message-ID: <4pz6g7yxdignq2jram76cwbzld5vayimlos3zydqvofbsq7tou@mxmnc7koetkr> (raw)
In-Reply-To: <20260525131839.1720731-2-t.lamprecht@proxmox.com>

On Mon, May 25, 2026 at 03:15:25PM +0200, Thomas Lamprecht wrote:
> The per-flag state used a radio group of three single-character
> options (- force-off, = default, + force-on) alongside a separate
> read-only "State" column that re-rendered the same value as Off,
> Default, or On. That was a bit cramped and also not the best UX.
> 
> Use one segmented button labeled Off/Default/On that both shows and
> sets the state, and drop the now-superfluous text column. A segmented
> button also reports a plain value to its change listener instead of
> the radio group's keyed object, simplifying the dirty-tracking
> handler.
> 
> The classic Ext.button.Segmented already existed in ExtJS 6.0.1, the
> version PVE shipped when I added this selector back in 06064872c
> ("gui: vm: add CPU flag selector with tri-state awareness"), not
> really sure though why I did not favor it over the radio group
> approach.
> 
> Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
Looks good! I also profiled this with the Bitwarden extension enabled 
[0] and it looks like it works a lot better with segmented buttons. 

One comment inline, with that addressed consider this:

Reviewed-by: Arthur Bied-Charreton <a.bied-charreton@proxmox.com>
Tested-by: Arthur Bied-Charreton <a.bied-charreton@proxmox.com>

[0] https://share.firefox.dev/4tYqt21
> ---
>  www/manager6/form/VMCPUFlagSelector.js | 66 +++++++-------------------
>  1 file changed, 18 insertions(+), 48 deletions(-)
> 
> diff --git a/www/manager6/form/VMCPUFlagSelector.js b/www/manager6/form/VMCPUFlagSelector.js
> index d4adbc0f5..5972ee678 100644
> --- a/www/manager6/form/VMCPUFlagSelector.js
> +++ b/www/manager6/form/VMCPUFlagSelector.js
> @@ -216,68 +216,38 @@ Ext.define('PVE.form.VMCPUFlagSelector', {
>          return res;
>      },
>      columns: [
> -        {
> -            text: gettext('State'),
> -            dataIndex: 'state',
> -            renderer: function (v) {
> -                switch (v) {
> -                    case '=':
> -                        return 'Default';
> -                    case '-':
> -                        return 'Off';
> -                    case '+':
> -                        return 'On';
> -                    default:
> -                        return 'Unknown';
> -                }
> -            },
> -            width: 65,
> -        },
>          {
>              text: gettext('Value'),
>              xtype: 'widgetcolumn',
>              dataIndex: 'state',
As mentioned in my answer to your other commit [1], we would need a
sortable: true here if we want the flags to be sortable by state, which
I think would be helpful. 

[1] https://lore.proxmox.com/pve-devel/g745uimm7nvpgvwomleawpklz2qst4saexjvd6syxv67s2jxa4@vhmlqwx5q6yb/
> -            width: 95,
> +            width: 200,
>              onWidgetAttach: function (column, widget, record) {
> -                let val = record.get('state') || '=';
> -                widget.down('[inputValue=' + val + ']').setValue(true);
> +                widget.setValue(record.get('state') || '=');
>                  // TODO: disable if selected CPU model and flag are incompatible
>              },
[...]




  reply	other threads:[~2026-05-26  6:03 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-05-25 13:15 [PATCH manager 0/2] ui: vCPU flag editor: switch radio group approach to segmented button Thomas Lamprecht
2026-05-25 13:15 ` [PATCH manager 1/2] ui: vCPU flag selector: replace radio group with " Thomas Lamprecht
2026-05-26  6:02   ` Arthur Bied-Charreton [this message]
2026-05-25 13:15 ` [PATCH manager 2/2] ui: vCPU flag selector: re-enable sortable columns Thomas Lamprecht
2026-05-26  5:49   ` Arthur Bied-Charreton

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4pz6g7yxdignq2jram76cwbzld5vayimlos3zydqvofbsq7tou@mxmnc7koetkr \
    --to=a.bied-charreton@proxmox.com \
    --cc=pve-devel@lists.proxmox.com \
    --cc=t.lamprecht@proxmox.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal