@yomotech/view-toolkit 1.0.68 → 1.0.70

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,3 +1,9 @@
1
+ // Faramarz Yousefian and Agent Toni (Claude Opus 5.5) 2026-11-17
2
+ // - new: data type "duration" (hours and minutes, HH:mm in every language) - a basic type, typed with the time picker
3
+ // and the time keyboard, travels as text
4
+ // Faramarz Yousefian and Agent Toni (Claude Opus 5.5) 2026-11-17
5
+ // - new: combobox and autocomplete settings openOnFocus (a tap into the field opens the whole list) and search
6
+ // (startsWith - default - or contains): the app sets them, the selection list follows (tm-guided B4)
1
7
  // Faramarz Yousefian and Agent Toni (Claude Opus 5.5) 2026-11-09
2
8
  // - new: control price for a text field - a price as data (option.amount, currency, from; 213/36)
3
9
  // - new: control map for a text field - where the business is (option.lat, option.lon, option.address, option.zoom;
@@ -56,7 +62,7 @@ function resolveProperty(root, reference) {
56
62
  return root?.[objectName]?.[name] ?? root?.[objectName]?.properties?.[name] ?? root?.properties?.[name] ?? {};
57
63
  }
58
64
  function normalizeFormat(value) {
59
- return { date: 'iso-date', time: 'iso-time', 'date-time': 'iso-datetime', datetime: 'iso-datetime', 'date&time': 'iso-datetime', bigdecimal: 'decimal' }[String(value).toLowerCase()] || value || '';
65
+ return { date: 'iso-date', time: 'iso-time', duration: 'iso-time', 'date-time': 'iso-datetime', datetime: 'iso-datetime', 'date&time': 'iso-datetime', bigdecimal: 'decimal' }[String(value).toLowerCase()] || value || '';
60
66
  }
61
67
  function baseType(schema, fallback) {
62
68
  const t = String(schema.type || fallback || '').toLowerCase();
@@ -64,11 +70,11 @@ function baseType(schema, fallback) {
64
70
  return 'string';
65
71
  if (t === 'quantity')
66
72
  return 'integer';
67
- return ['date', 'time', 'datetime', 'date-time', 'date&time'].includes(t) ? 'string' : ['decimal', 'bigdecimal'].includes(t) ? 'string' : t;
73
+ return ['date', 'time', 'duration', 'datetime', 'date-time', 'date&time'].includes(t) ? 'string' : ['decimal', 'bigdecimal'].includes(t) ? 'string' : t;
68
74
  }
69
75
  function effectiveFormat(schema, fallback, data) {
70
76
  const semantic = String(schema.type || fallback || '').toLowerCase();
71
- const temporal = ['date', 'time', 'datetime', 'date-time', 'date&time', 'decimal', 'bigdecimal'].includes(semantic);
77
+ const temporal = ['date', 'time', 'duration', 'datetime', 'date-time', 'date&time', 'decimal', 'bigdecimal'].includes(semantic);
72
78
  const declared = normalizeFormat(schema.format || data.format || '');
73
79
  // A date with its own display pattern (format "yy-mm-dd") is still a date.
74
80
  if (temporal && declared && !DATA_FORMATS.includes(declared))
@@ -174,11 +180,11 @@ const DATA_OBJECT_PLACES = {
174
180
  placeholder: 'option.placeholder',
175
181
  tooltip: 'option.tooltip',
176
182
  required: 'option.required',
177
- validation: 'option.required, option.fieldData.validation (minLength, maxLength, pattern, minimum, maximum)',
183
+ validation: 'option.required, option.fieldData.validation (minLength, maxLength, pattern, minimum, maximum; between fields: notBefore, notAfter, requiredWhen, minDuration, maxDuration)',
178
184
  value: 'option.fieldData.default (start value; a placeholder such as {{quantity}} or {{id}} too)',
179
185
  default: 'option.fieldData.default',
180
186
  data: 'option.fieldData.validation.enum and option.labels (a fixed list of choices)',
181
- loginUser: 'option.fromUser (the placeholder is taken from the signed-in user)',
187
+ loginUser: 'option.fieldData.default "{{user.x}}" (a field of the signed-in user\'s record, environment.login.user; option.fromUser is gone)',
182
188
  currency: 'option.numberStyle "currency" and option.fieldData.currency',
183
189
  decimalPoint: 'option.decimals',
184
190
  format: 'option.displayFormat "custom" and option.customDisplayFormat (a date pattern)',
@@ -252,7 +258,7 @@ function renameDataObject(layout, oldName, newName) {
252
258
  walk(layout);
253
259
  return changed;
254
260
  }
255
- const BASIC_TYPES = ['string', 'number', 'integer', 'bigdecimal', 'boolean', 'date', 'time', 'datetime', 'dateRange', 'media', 'array'];
261
+ const BASIC_TYPES = ['string', 'number', 'integer', 'bigdecimal', 'boolean', 'date', 'time', 'duration', 'datetime', 'dateRange', 'media', 'array'];
256
262
  /** Older or other names of a data type and the type they mean. */
257
263
  const TYPE_ALIASES = { daterange: 'dateRange', image: 'media', checkbox: 'boolean', 'date-time': 'datetime', 'date&time': 'datetime', decimal: 'bigdecimal' };
258
264
  /** The data type of a property, aliases resolved ("image" -> "media"). */
@@ -371,7 +377,8 @@ function keyboardFor(option, property = {}) {
371
377
  return 'email';
372
378
  switch (basicType(property)) {
373
379
  case 'date': return 'date';
374
- case 'time': return 'time';
380
+ case 'time':
381
+ case 'duration': return 'time';
375
382
  case 'number':
376
383
  case 'integer':
377
384
  case 'bigdecimal': return 'numeric';
@@ -437,6 +444,8 @@ function displaySettings(schema, fallback, option) {
437
444
  result.push(setting('orientation', 'Orientation', 'select', ['horizontal', 'vertical']));
438
445
  if (c === 'combobox')
439
446
  result.push(yesNo('allowCustom', 'Allow values outside the list'));
447
+ if (['combobox', 'autocomplete'].includes(c))
448
+ result.push(yesNo('openOnFocus', 'Open the whole list on a tap into the field'), setting('search', 'Typing keeps entries that', 'select', ['startsWith', 'contains'], 'startsWith (default): "02" finds 02000001, "12" nothing. contains: the text anywhere in the entry.'));
440
449
  if (c === 'autocomplete')
441
450
  result.push(setting('source', 'Suggestion source URL'), setting('minChars', 'Minimum characters', 'number'));
442
451
  if (c === 'picklist')
@@ -572,7 +581,7 @@ function validateSettings(schema, fallback, option, context) {
572
581
  fail(currencyProperty.type !== 'string', 'The currency property must exist in the property schema and have string storage.');
573
582
  }
574
583
  fail(option.checkedBooleanValue !== undefined && typeof option.checkedBooleanValue !== 'boolean', 'The active Boolean value must be true or false.');
575
- for (const k of ['required', 'readonly', 'allowCustom', 'showValue', 'grouping'])
584
+ for (const k of ['required', 'readonly', 'allowCustom', 'openOnFocus', 'showValue', 'grouping'])
576
585
  fail(option[k] !== undefined && typeof option[k] !== 'boolean', `${k} must be a Boolean.`);
577
586
  for (const k of ['minorUnits'])
578
587
  fail(d[k] !== undefined && typeof d[k] !== 'boolean', `${k} must be a Boolean.`);
@@ -616,11 +625,11 @@ function validateSettings(schema, fallback, option, context) {
616
625
  }
617
626
  if (option.messages && typeof option.messages === 'object')
618
627
  fail(Object.values(option.messages).some(v => typeof v !== 'string'), 'Validation messages must contain string captions or translation keys.');
619
- for (const [key, values] of [['labelPosition', ['left', 'right']], ['orientation', ['horizontal', 'vertical']], ['numberStyle', ['decimal', 'currency', 'percent']]])
628
+ for (const [key, values] of [['labelPosition', ['left', 'right']], ['orientation', ['horizontal', 'vertical']], ['numberStyle', ['decimal', 'currency', 'percent']], ['search', ['startsWith', 'contains']]])
620
629
  fail(option[key] !== undefined && !values.includes(option[key]), `Choose a supported ${key}.`);
621
630
  fail(option.messages !== undefined && (!option.messages || typeof option.messages !== 'object' || Array.isArray(option.messages)), 'Validation messages must be a JSON object.');
622
631
  const allowed = new Set(displaySettings(schema, fallback, option).map(s => s.key));
623
- for (const k of ['placeholder', 'rows', 'mask', 'step', 'showValue', 'labelPosition', 'labelOn', 'labelOff', 'orientation', 'allowCustom', 'source', 'minChars', 'labels', 'maxVisible', 'displayFormat', 'displayTimezone', 'customDisplayFormat', 'numberStyle', 'decimals', 'grouping', 'unit', 'unitLabel', 'checkedValue', 'uncheckedValue', 'checkedBooleanValue'])
632
+ for (const k of ['placeholder', 'rows', 'mask', 'step', 'showValue', 'labelPosition', 'labelOn', 'labelOff', 'orientation', 'allowCustom', 'openOnFocus', 'search', 'source', 'minChars', 'labels', 'maxVisible', 'displayFormat', 'displayTimezone', 'customDisplayFormat', 'numberStyle', 'decimals', 'grouping', 'unit', 'unitLabel', 'checkedValue', 'uncheckedValue', 'checkedBooleanValue'])
624
633
  fail(option[k] !== undefined && !allowed.has(k), `${k} is not applicable to this control and data meaning.`);
625
634
  for (const k of ['currency', 'currencyField', 'minorUnits'])
626
635
  fail(d[k] !== undefined && !dataSettings(schema, fallback, option).some(s => s.key === k), `${k} requires the appropriate numeric type.`);
@@ -698,6 +707,11 @@ function alignRowsOf(center) {
698
707
  return center?.option?.alignRows === true;
699
708
  }
700
709
 
710
+ // Faramarz Yousefian and Agent Toni (Claude Opus 5.5) 2026-11-14
711
+ // - new: layout rule colour - an open app keyboard or docked calendar has the page's colour (or the project's own
712
+ // keyboard colour); hotel's keyboard took the green of a Book button behind the dialog
713
+ // Faramarz Yousefian and Agent Toni (Claude Opus 5.5) 2026-11-12
714
+ // - new: pick by position (1 = first entry) and check filled - a list of live data, the entries are not known
701
715
  // Faramarz Yousefian and Agent Toni (Claude Opus 5.5) 2026-11-07
702
716
  // - new: simulatorOnly - a flow that only the simulators run, the preview leaves it out (point 204, user)
703
717
  // Faramarz Yousefian and Agent Toni (Claude Opus 5.5) 2026-11-05
@@ -776,7 +790,7 @@ const STEP_KINDS = ['open', 'menu', 'tap', 'type', 'pick', 'press', 'scroll', 'o
776
790
  /** What an expect step can check - one of them per step. */
777
791
  const EXPECT_KINDS = ['value', 'shows', 'keyboard', 'list', 'message', 'visible', 'hidden', 'locked', 'blocked', 'inFrame',
778
792
  'page', 'records', 'recordsAtLeast', 'listLoaded', 'pdf', 'samePlace', 'cartCount', 'toast', 'checked', 'unchecked', 'cardRows',
779
- 'formatted', 'translated', 'fieldVisible', 'restored', 'layout'];
793
+ 'formatted', 'translated', 'fieldVisible', 'restored', 'layout', 'filled'];
780
794
  /** How a value is shown in the language's form (expect formatted). */
781
795
  const FORMATS = ['date', 'time', 'datetime', 'number', 'currency'];
782
796
  /** Languages written right to left - not tested until right-to-left is supported (decision 2026-10-30). */
@@ -994,7 +1008,8 @@ function localeRenderings(value, as, lang, currency, dateDisplay = 'language') {
994
1008
  /**
995
1009
  * The layout rules (OFFENE-PUNKTE 143), judged on what a runner measured: beyond (an element leaves the frame
996
1010
  * sideways), sideways (the page scrolls sideways), overlap (two fields / buttons cover each other), narrow (a text
997
- * gets fewer than 3 characters a line), row (fields of one row do not stand on one line). Pixels tolerate 2.
1011
+ * gets fewer than 3 characters a line), row (fields of one row do not stand on one line), colour (an open keyboard or
1012
+ * calendar not in the page's colour). Pixels tolerate 2.
998
1013
  */
999
1014
  function layoutProblems(snap) {
1000
1015
  const problems = [];
@@ -1011,6 +1026,12 @@ function layoutProblems(snap) {
1011
1026
  if (Math.max(...tops) - Math.min(...tops) > tol)
1012
1027
  problems.push({ rule: 'align', detail: `the buttons of card row ${i + 1} do not stand on one line (${tops.map((t) => Math.round(t)).join(', ')})` });
1013
1028
  });
1029
+ // keyboard and calendar have the page's colour (or the project's own keyboard colour) - not a button's (2026-11-14)
1030
+ const rgb = (c) => (String(c).match(/[\d.]+/g) || []).slice(0, 3).map(Number).join(',');
1031
+ for (const p of snap.panels || []) {
1032
+ if (rgb(p.background) !== rgb(p.expected))
1033
+ problems.push({ rule: 'colour', detail: `${p.name} background ${p.background} differs from the page ${p.expected}` });
1034
+ }
1014
1035
  for (const s of snap.scrollers || []) {
1015
1036
  if (s.left < -tol || s.right > snap.width + tol)
1016
1037
  problems.push({ rule: 'beyond', detail: `area "${s.name}" leaves the frame (${Math.round(s.left)}–${Math.round(s.right)} of ${snap.width})` });
@@ -1202,7 +1223,7 @@ function checkTestFlow(flow, data) {
1202
1223
  add('intoMissing', n);
1203
1224
  break;
1204
1225
  case 'pick':
1205
- if (!text(step.pick))
1226
+ if (!(Number.isInteger(step.pick) && step.pick >= 1) && !text(step.pick))
1206
1227
  add('stepNameMissing', n, { kind });
1207
1228
  if (!text(step.in))
1208
1229
  add('inMissing', n);
@@ -1290,7 +1311,7 @@ function checkExpect(e, n, add) {
1290
1311
  if (e.formatted === 'currency' && !/^[A-Z]{3}$/.test(String(e.currency || '')))
1291
1312
  add('currencyMissing', n);
1292
1313
  }
1293
- if (kind === 'fieldVisible' && !text(e.fieldVisible))
1314
+ if ((kind === 'fieldVisible' || kind === 'filled') && !text(e[kind]))
1294
1315
  add('stepNameMissing', n, { kind });
1295
1316
  if ((kind === 'translated' || kind === 'restored' || kind === 'layout') && e[kind] !== true)
1296
1317
  add('notTrue', n, { kind });
@@ -2006,6 +2027,13 @@ function headerScrollOf(header) {
2006
2027
  return HEADER_SCROLLS.includes(own) ? own : 'fixed';
2007
2028
  }
2008
2029
 
2030
+ // Faramarz Yousefian and Agent Toni (Claude Opus 5.5) 2026-11-17
2031
+ // - new: keepFilter on a load from the backend - a filter page opened again shows the last filter values and its list
2032
+ // Faramarz Yousefian and Agent Toni (Claude Opus 5.5) 2026-11-13
2033
+ // - new: check "addon:<name>" on save (backend), saveAll and submit (browser and backend) - the add-on checks the record
2034
+ // before it is kept or sent (OFFENE-PUNKTE 225 B)
2035
+ // Faramarz Yousefian and Agent Toni (Claude Opus 5.5) 2026-11-12
2036
+ // - new: perUser belongs to every browser source with data_url - records kept per signed-in user (record-format.ts)
2009
2037
  // Faramarz Yousefian and Agent Toni (Claude Opus 5.5) 2026-11-10
2010
2038
  // - new: waitsForFilter - a source that names its filters (dataSource.filters) waits for them
2011
2039
  // Faramarz Yousefian and Agent Toni (Claude Opus 5.5) 2026-11-07
@@ -2048,8 +2076,8 @@ const CALL_KINDS = {
2048
2076
  does: 'A menu entry or page shows records: from the browser storage, or loaded from the backend (optionally only once the filter fields are filled).',
2049
2077
  storages: ['localstorage', 'sessionstorage', 'database'], defaultStorage: 'database', addressKey: 'data_url',
2050
2078
  methods: ['GET', 'POST'],
2051
- browser: ['data_url'],
2052
- backend: ['data_url', 'proxy', 'method', 'passToken', 'params', 'body', 'dateFormat', 'dataKey', 'loadOnFilter', 'emptyMessage', 'errorMessage'],
2079
+ browser: ['data_url', 'perUser'],
2080
+ backend: ['data_url', 'proxy', 'method', 'passToken', 'params', 'body', 'dateFormat', 'dataKey', 'loadOnFilter', 'keepFilter', 'emptyMessage', 'errorMessage'],
2053
2081
  },
2054
2082
  link: {
2055
2083
  does: 'A button opens a detail page that loads its record from the address; the button itself calls nothing.',
@@ -2070,35 +2098,35 @@ const CALL_KINDS = {
2070
2098
  does: 'A card button sends this one record to the backend, or keeps it in a browser list (data_url = its name): with key a second click takes it out again, maxRecords keeps the newest.',
2071
2099
  storages: ['localstorage', 'sessionstorage', 'database'], defaultStorage: 'database', addressKey: 'data_url',
2072
2100
  methods: ['POST', 'PUT'],
2073
- browser: ['data_url', 'key', 'maxRecords', 'deleteMessage', ...MESSAGES],
2074
- backend: ['data_url', 'proxy', 'method', 'passToken', 'params', 'body', 'dateFormat', 'transform', 'afterSuccess', ...MESSAGES],
2101
+ browser: ['data_url', 'perUser', 'key', 'maxRecords', 'deleteMessage', ...MESSAGES],
2102
+ backend: ['data_url', 'proxy', 'method', 'passToken', 'params', 'body', 'dateFormat', 'check', 'transform', 'afterSuccess', ...MESSAGES],
2075
2103
  },
2076
2104
  saveAll: {
2077
2105
  does: 'A header button sends all records of the page to the backend, one by one or in one call.',
2078
2106
  storages: ['database'], defaultStorage: 'database', addressKey: 'data_url',
2079
2107
  methods: ['POST', 'PUT'],
2080
2108
  browser: [],
2081
- backend: ['data_url', 'proxy', 'method', 'passToken', 'params', 'body', 'dateFormat', 'transform', 'sendMode', 'afterSuccess', ...MESSAGES],
2109
+ backend: ['data_url', 'proxy', 'method', 'passToken', 'params', 'body', 'dateFormat', 'check', 'transform', 'sendMode', 'afterSuccess', ...MESSAGES],
2082
2110
  },
2083
2111
  submit: {
2084
2112
  does: 'A form or dialog button keeps its record in the browser storage (with key: a record of the same key value is replaced) or sends it to the backend.',
2085
2113
  storages: ['localstorage', 'sessionstorage', 'database'], defaultStorage: 'localstorage', addressKey: 'data_url',
2086
2114
  methods: ['POST', 'PUT'],
2087
- browser: ['data_url', 'key', 'afterSuccessPage', ...MESSAGES],
2088
- backend: ['data_url', 'proxy', 'method', 'passToken', 'params', 'body', 'dateFormat', 'transform', 'afterSuccess', 'afterSuccessPage', ...MESSAGES],
2115
+ browser: ['data_url', 'perUser', 'key', 'check', 'afterSuccessPage', ...MESSAGES],
2116
+ backend: ['data_url', 'proxy', 'method', 'passToken', 'params', 'body', 'dateFormat', 'check', 'transform', 'afterSuccess', 'afterSuccessPage', ...MESSAGES],
2089
2117
  },
2090
2118
  delete: {
2091
2119
  does: 'A button deletes the record - from the browser storage or at the backend; it asks first.',
2092
2120
  storages: ['localstorage', 'sessionstorage', 'database'], defaultStorage: 'database', addressKey: 'data_url',
2093
2121
  methods: ['DELETE', 'POST'],
2094
- browser: ['data_url', 'confirmDelete', 'deleteMessage', ...MESSAGES],
2122
+ browser: ['data_url', 'perUser', 'confirmDelete', 'deleteMessage', ...MESSAGES],
2095
2123
  backend: ['data_url', 'proxy', 'method', 'passToken', 'params', 'key', 'confirmDelete', 'deleteMessage', ...MESSAGES],
2096
2124
  },
2097
2125
  rowAction: {
2098
2126
  does: 'An icon of a grid row (action column save / delete) calls its address with the row\'s fields ({{field}}) and changes only this row after success - the answer, else afterSuccessSet. A key "{{field}}" with a value shows the icon only on rows where that field has that value (hotel: "{{reservationStatus}}": "PENDING").',
2099
2127
  storages: ['localstorage', 'sessionstorage', 'database'], defaultStorage: 'database', addressKey: 'data_url',
2100
2128
  methods: ['GET', 'POST', 'PUT', 'DELETE'],
2101
- browser: ['data_url', 'key', 'maxRecords', 'deleteMessage', ...MESSAGES],
2129
+ browser: ['data_url', 'perUser', 'key', 'maxRecords', 'deleteMessage', ...MESSAGES],
2102
2130
  backend: ['data_url', 'proxy', 'method', 'passToken', 'key', 'afterSuccessSet', ...MESSAGES],
2103
2131
  },
2104
2132
  login: {
@@ -2618,6 +2646,12 @@ function translateCaptions(schema, texts, { inPlace = false, values = false } =
2618
2646
  return target;
2619
2647
  }
2620
2648
 
2649
+ // Faramarz Yousefian and Agent Toni (Claude Opus 5.5) 2026-11-14
2650
+ // - fix: "text gets N characters a line" only for a text that wraps - a short word on one line
2651
+ // ("jj", "ffff") was reported as too narrow (hotel test G-01/A-01/C-01)
2652
+ // - fix: with a dialog open only what stands in it is measured - a button of the page behind was reported as
2653
+ // covering a dialog field (hotel C-02)
2654
+ // - new: panels - background of an open app keyboard / docked calendar and the colour the page asks for
2621
2655
  // Faramarz Yousefian and Agent Toni (Claude Opus 5.5) 2026-11-01
2622
2656
  // - new: boxes say whether they stand in the top bar (inBar)
2623
2657
  // - new: cardRows - in a card list with aligned rows, per row the tops of the cards' button elements
@@ -2656,6 +2690,9 @@ function probeLayoutSnapshot() {
2656
2690
  const doc = globalThis.document;
2657
2691
  const win = globalThis;
2658
2692
  const shown = (el) => { const r = el.getBoundingClientRect(); const s = getComputedStyle(el); return r.width > 0 && r.height > 0 && s.visibility !== 'hidden' && s.display !== 'none'; };
2693
+ // an open dialog covers the page: only what stands in it is measured (the page behind is hidden by design)
2694
+ const dialog = [...doc.querySelectorAll('.p-dialog')].find((d) => shown(d));
2695
+ const measured = (el) => shown(el) && (!dialog || dialog.contains(el));
2659
2696
  const rowOf = (el) => {
2660
2697
  const parent = el.parentElement;
2661
2698
  if (!parent)
@@ -2684,24 +2721,31 @@ function probeLayoutSnapshot() {
2684
2721
  };
2685
2722
  const boxes = [];
2686
2723
  for (const el of [...doc.querySelectorAll('[data-vl-field]')]) {
2687
- if (!shown(el) || el.closest('[data-vl-record]'))
2724
+ if (!measured(el) || el.closest('[data-vl-record]'))
2688
2725
  continue;
2689
2726
  const r = el.getBoundingClientRect();
2690
2727
  boxes.push({ kind: 'field', name: el.getAttribute('data-vl-field') || '', left: r.left, top: r.top, right: r.right, bottom: r.bottom, row: rowOf(el), scroller: scrollerOf(el), inBar: !!el.closest('.vl-top-bar') });
2691
2728
  }
2692
2729
  for (const el of [...doc.querySelectorAll('[data-vl-action], button')]) {
2693
- if (!shown(el) || el.closest('[data-vl-field], section[data-vl-custom-keyboard], .left-wrap'))
2730
+ if (!measured(el) || el.closest('[data-vl-field], section[data-vl-custom-keyboard], .left-wrap'))
2694
2731
  continue;
2695
2732
  const r = el.getBoundingClientRect();
2696
2733
  boxes.push({ kind: 'button', name: el.getAttribute('data-vl-action') || String(el.innerText || '').trim().slice(0, 20), left: r.left, top: r.top, right: r.right, bottom: r.bottom, scroller: scrollerOf(el), inBar: !!el.closest('.vl-top-bar') });
2697
2734
  }
2698
2735
  for (const el of [...doc.querySelectorAll('label, .vl-control__label, .vl-control__value')]) {
2699
2736
  const t = String(el.innerText || '').trim();
2700
- if (!t || !shown(el))
2737
+ if (!t || !measured(el))
2701
2738
  continue;
2702
2739
  const r = el.getBoundingClientRect();
2703
- const size = parseFloat(getComputedStyle(el).fontSize) || 14;
2704
- boxes.push({ kind: 'text', name: t.slice(0, 20), left: r.left, top: r.top, right: r.right, bottom: r.bottom, charsPerLine: Math.floor(r.width / (size * 0.55)), scroller: scrollerOf(el) });
2740
+ const css = getComputedStyle(el);
2741
+ const size = parseFloat(css.fontSize) || 14;
2742
+ // a text on one line is never too narrow (short words like "jj" are as wide as themselves);
2743
+ // characters a line are counted only when the text wraps onto more lines
2744
+ const line = parseFloat(css.lineHeight) || size * 1.2;
2745
+ const wraps = r.height > line * 1.5;
2746
+ // no key at all on one line: an undefined value comes back from the device as null
2747
+ boxes.push({ kind: 'text', name: t.slice(0, 20), left: r.left, top: r.top, right: r.right, bottom: r.bottom,
2748
+ ...(wraps ? { charsPerLine: Math.floor(r.width / (size * 0.55)) } : {}), scroller: scrollerOf(el) });
2705
2749
  }
2706
2750
  // the top bar (header + page X): where it stands, what it should do, and whether the page is scrolled
2707
2751
  const bar = doc.querySelector('.vl-top-bar');
@@ -2724,8 +2768,34 @@ function probeLayoutSnapshot() {
2724
2768
  if (tops.length > 1)
2725
2769
  cardRows.push(tops);
2726
2770
  }
2771
+ // keyboard and calendar panel look like the page (user 2026-10-13): their background against the page's - the page
2772
+ // area (.center-wrap) or the first coloured element above it, white at last; a project's own keyboard colour
2773
+ // (--vl-keyboard-background) is what it asked for (2026-11-14: hotel's keyboard took the green of a Book button)
2774
+ const colourOf = (start) => {
2775
+ for (let e = start; e; e = e.parentElement) {
2776
+ const c = getComputedStyle(e).backgroundColor;
2777
+ if (c && c !== 'transparent' && !/rgba\(.*,\s*0\)$/.test(c))
2778
+ return c;
2779
+ }
2780
+ return 'rgb(255, 255, 255)';
2781
+ };
2782
+ let expected = colourOf(doc.querySelector('.center-wrap') || doc.body);
2783
+ const own = doc.body ? String(getComputedStyle(doc.body).getPropertyValue('--vl-keyboard-background') || '').trim() : '';
2784
+ if (own && doc.createElement) {
2785
+ const probe = doc.createElement('i');
2786
+ probe.style.backgroundColor = own;
2787
+ doc.body.appendChild(probe);
2788
+ expected = getComputedStyle(probe).backgroundColor || expected;
2789
+ probe.remove();
2790
+ }
2791
+ const panels = [];
2792
+ for (const [name, selector] of [['keyboard', 'section[data-vl-custom-keyboard]'], ['calendar', '.model-datepicker-panel--docked']]) {
2793
+ const el = [...doc.querySelectorAll(selector)].find((x) => shown(x));
2794
+ if (el)
2795
+ panels.push({ name, background: getComputedStyle(el).backgroundColor, expected });
2796
+ }
2727
2797
  return { width: win.innerWidth, height: win.innerHeight, scrollsSideways: doc.documentElement.scrollWidth > win.innerWidth + 2, boxes,
2728
- scrollers: scrollers.map(({ el, ...s }) => s), header, cardRows };
2798
+ scrollers: scrollers.map(({ el, ...s }) => s), header, cardRows, panels };
2729
2799
  }
2730
2800
  /** Whether a field (data-vl-path with a dot, else data-vl-field) stands visible above an open keyboard: '' or why not. */
2731
2801
  function probeFieldVisible(key) {