From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from gate001.proxmox.com (gate001.proxmox.com [IPv6:2a0f:8001:1:32::40]) by lore.proxmox.com (Postfix) with ESMTPS id 68F391FF09B for ; Mon, 26 Oct 2026 23:05:30 +0100 (CET) Received: from gate001.proxmox.com (localhost.localdomain [127.0.0.1]) by gate001.proxmox.com (Proxmox) with ESMTP id CC0882169C; Mon, 26 Oct 2026 23:04:53 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=datenzelt.de; s=MBO0001; t=1793052277; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=QxYfa4ltUZBlfxHLcluaXvmZ0ddZ7jrKiPx3YYAdbFY=; b=xYeOaDsUI8PRcKta0B+mSljbm8jlvuiq419J6A0+tyLBF6icQCJA6BsbGbJ5cbX+LZ6pB1 ZXzsjydCGi9tklGlonUUUNVmaLHcEXmcUlk5X81aEf6tLY8a4dv70Q7B1s2wmGCzGkc6SM PxD//DD4f1sFDA1G715QoRzFLw+/65bE1qjlnOPPhLYA/eAlv4N4VSwfk8Jve2cotWHCUt OKhxBC8V39SMRbQVuwJ9XYHZe2RMfwzC8UIwh/SgjL//xoVewYqCJK/hVGsZJG4VhhXMkR UytrVbPRRbN5I02NkdE2B4fkz+OD+TkUEZ+9CANUGvMwTbJY/wu9wYSmRhRi2Q== Authentication-Results: outgoing_mbo_mout; dkim=none; spf=pass (outgoing_mbo_mout: domain of timo.meschkat@datenzelt.de designates 2001:67c:2050:b231:465::1 as permitted sender) smtp.mailfrom=timo.meschkat@datenzelt.de From: Timo Meschkat To: pve-devel@lists.proxmox.com Subject: [RFC PATCH widget-toolkit 3/3] form: size field: add optional field description Date: Mon, 26 Oct 2026 23:04:19 +0100 Message-ID: <20261026220423.127776-4-timo.meschkat@datenzelt.de> X-Mailer: git-send-email 2.47.3 In-Reply-To: <20261026220423.127776-1-timo.meschkat@datenzelt.de> References: <20261026220423.127776-1-timo.meschkat@datenzelt.de> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 4jD72Y19FZzMlNF X-SPAM-LEVEL: Spam detection results: 0 AWL -0.250 Adjusted score from AWL reputation of From: address DKIM_SIGNED 0.1 Message has a DKIM or DK signature, not necessarily valid DKIM_VALID -0.1 Message has at least one valid DKIM or DK signature DKIM_VALID_AU -0.1 Message has a valid DKIM or DK signature from author's domain DKIM_VALID_EF -0.1 Message has a valid DKIM or DK signature from envelope-from domain DMARC_PASS -0.1 DMARC pass policy RCVD_IN_DNSWL_LOW -0.7 Sender listed at https://www.dnswl.org/, low trust SPF_HELO_PASS -0.001 SPF: HELO matches SPF record SPF_PASS -0.001 SPF: sender matches SPF record Message-ID-Hash: VNHA26UCMTADHLSIU5Z47CEL5GA5RGLP X-Message-ID-Hash: VNHA26UCMTADHLSIU5Z47CEL5GA5RGLP X-MailFrom: timo.meschkat@datenzelt.de X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; loop; banned-address; emergency; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header X-Mailman-Version: 3.3.10 Precedence: list List-Id: Proxmox VE development discussion List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: The label alone, e.g. 'Memory', does not always tell what the value is for. Allow describing it, e.g. as the memory of a VM. The description is shown as tooltip together with the suffix hint and read by screen readers. Signed-off-by: Timo Meschkat --- src/form/SizeUnitField.js | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/src/form/SizeUnitField.js b/src/form/SizeUnitField.js index 9fd7308..4e9aef9 100644 --- a/src/form/SizeUnitField.js +++ b/src/form/SizeUnitField.js @@ -28,6 +28,9 @@ Ext.define('Proxmox.form.SizeUnitField', { emptyText: '', + // shown as tooltip and read by screen readers + fieldDescription: undefined, + decimalPrecision: 2, // otherwise round to whole backend units @@ -43,9 +46,13 @@ Ext.define('Proxmox.form.SizeUnitField', { // e.g. '512M, 8G' let examples = me.units.slice(0, 2).map((unit, i) => `${i === 0 ? 512 : 8}${unit[0]}`); - let hint = Ext.htmlEncode( - Ext.String.format(gettext('Also accepts a unit suffix, e.g. {0}'), examples.join(', ')), + let hint = Ext.String.format( + gettext('Also accepts a unit suffix, e.g. {0}'), + examples.join(', '), ); + let descriptions = [me.fieldDescription, hint].filter((text) => !!text); + let qtip = descriptions.map((text) => Ext.htmlEncode(text)).join('
'); + let ariaDescription = Ext.htmlEncode(descriptions.join('. ')); me.items = [ { @@ -56,7 +63,7 @@ Ext.define('Proxmox.form.SizeUnitField', { flex: 1, // the field label belongs to the container, not the inputs ariaLabel: me.fieldLabel, - inputAttrTpl: `data-qtip="${hint}" aria-description="${hint}"`, + inputAttrTpl: `data-qtip="${qtip}" aria-description="${ariaDescription}"`, fieldStyle: 'text-align: right', allowBlank: me.allowBlank, emptyText: me.emptyText, -- 2.47.3