Show max length in item tooltips

This commit is contained in:
Jage9
2026-02-22 03:50:52 -05:00
parent 82e78872d2
commit c7ba23f371
9 changed files with 21 additions and 8 deletions

View File

@@ -68,6 +68,7 @@ export type ItemPropertyValueType = 'boolean' | 'text' | 'number' | 'list' | 'so
export type ItemPropertyMetadata = {
valueType?: ItemPropertyValueType;
tooltip?: string;
maxLength?: number;
range?: {
min: number;
max: number;
@@ -140,6 +141,12 @@ function normalizePropertyMetadataRecord(raw: Record<string, unknown> | undefine
if (typeof valueObj.tooltip === 'string' && valueObj.tooltip.trim().length > 0) {
metadata.tooltip = valueObj.tooltip.trim();
}
if (valueObj.maxLength !== undefined) {
const maxLength = Number(valueObj.maxLength);
if (Number.isFinite(maxLength) && maxLength > 0) {
metadata.maxLength = Math.floor(maxLength);
}
}
const range = valueObj.range;
if (range && typeof range === 'object') {
const rangeObj = range as Record<string, unknown>;