Replace single-line truncation with bareTopWrapLine for scalars and

bareTopFlattenLimited (multi-line, wider budget) for object/array values.
Narrow key column slightly to give more width to values; regenerate bundles.
This commit is contained in:
Raven Scott
2026-04-21 19:13:38 -04:00
parent 1d1e5c487e
commit ca77803198
11 changed files with 176 additions and 61 deletions
+34 -11
View File
@@ -983,21 +983,44 @@ function bareTopTruncateMiddle(text, maxLen) {
function bareTopFeaturesTableLines(features, cols) {
if (!features || typeof features !== 'object') return [' N/A']
const o = /** @type {Record<string, unknown>} */ (features)
const kw = Math.min(34, Math.max(10, Math.floor(cols * 0.36)))
const c = Math.max(40, cols | 0)
const kw = Math.min(30, Math.max(8, Math.floor(c * 0.26)))
const rowPrefix = ' '
const gap = ' '
const valWidth = Math.max(16, c - rowPrefix.length - kw - gap.length)
const contPad = ' '.repeat(rowPrefix.length + kw + gap.length)
/** @type {string[]} */
const out = [' Features (flattened booleans and scalars)']
/**
* @param {string} keyCol
* @param {string} text
*/
function pushWrappedScalar(keyCol, text) {
const wrapped = bareTopWrapLine(text, valWidth)
for (let i = 0; i < wrapped.length; i++) {
const pad = i === 0 ? rowPrefix + keyCol + gap : contPad
const maxCell = Math.max(4, c - pad.length)
out.push(pad + bareTopTruncateCell(wrapped[i], maxCell, false))
}
}
for (const k of Object.keys(o).sort().slice(0, 200)) {
const v = o[k]
let cell = ''
if (v === true) cell = 'on'
else if (v === false) cell = 'off'
else if (v == null) cell = ''
else if (typeof v !== 'object') cell = String(v)
else cell = bareTopJsonSnippet(v, Math.max(12, cols - kw - 6))
const kl = bareTopTruncateCell(k, kw, true).padEnd(kw)
out.push(
' ' + kl + ' ' + bareTopTruncateCell(cell, cols - kw - 6, false)
)
const keyCol = bareTopTruncateCell(k, kw, true).padEnd(kw)
if (v === true) pushWrappedScalar(keyCol, 'on')
else if (v === false) pushWrappedScalar(keyCol, 'off')
else if (v == null) pushWrappedScalar(keyCol, '')
else if (typeof v !== 'object') pushWrappedScalar(keyCol, String(v))
else {
const nested = bareTopFlattenLimited('', v, 1, 10, 120, 80)
nested.forEach((nl, i) => {
const pad = i === 0 ? rowPrefix + keyCol + gap : contPad
const maxCell = Math.max(8, c - pad.length)
out.push(pad + bareTopTruncateCell(nl, maxCell, false))
})
}
}
return out
}
+34 -11
View File
@@ -4546,21 +4546,44 @@ function bareTopTruncateMiddle(text, maxLen) {
function bareTopFeaturesTableLines(features, cols) {
if (!features || typeof features !== 'object') return [' N/A']
const o = /** @type {Record<string, unknown>} */ (features)
const kw = Math.min(34, Math.max(10, Math.floor(cols * 0.36)))
const c = Math.max(40, cols | 0)
const kw = Math.min(30, Math.max(8, Math.floor(c * 0.26)))
const rowPrefix = ' '
const gap = ' '
const valWidth = Math.max(16, c - rowPrefix.length - kw - gap.length)
const contPad = ' '.repeat(rowPrefix.length + kw + gap.length)
/** @type {string[]} */
const out = [' Features (flattened booleans and scalars)']
/**
* @param {string} keyCol
* @param {string} text
*/
function pushWrappedScalar(keyCol, text) {
const wrapped = bareTopWrapLine(text, valWidth)
for (let i = 0; i < wrapped.length; i++) {
const pad = i === 0 ? rowPrefix + keyCol + gap : contPad
const maxCell = Math.max(4, c - pad.length)
out.push(pad + bareTopTruncateCell(wrapped[i], maxCell, false))
}
}
for (const k of Object.keys(o).sort().slice(0, 200)) {
const v = o[k]
let cell = ''
if (v === true) cell = 'on'
else if (v === false) cell = 'off'
else if (v == null) cell = ''
else if (typeof v !== 'object') cell = String(v)
else cell = bareTopJsonSnippet(v, Math.max(12, cols - kw - 6))
const kl = bareTopTruncateCell(k, kw, true).padEnd(kw)
out.push(
' ' + kl + ' ' + bareTopTruncateCell(cell, cols - kw - 6, false)
)
const keyCol = bareTopTruncateCell(k, kw, true).padEnd(kw)
if (v === true) pushWrappedScalar(keyCol, 'on')
else if (v === false) pushWrappedScalar(keyCol, 'off')
else if (v == null) pushWrappedScalar(keyCol, '')
else if (typeof v !== 'object') pushWrappedScalar(keyCol, String(v))
else {
const nested = bareTopFlattenLimited('', v, 1, 10, 120, 80)
nested.forEach((nl, i) => {
const pad = i === 0 ? rowPrefix + keyCol + gap : contPad
const maxCell = Math.max(8, c - pad.length)
out.push(pad + bareTopTruncateCell(nl, maxCell, false))
})
}
}
return out
}
+34 -11
View File
@@ -4546,21 +4546,44 @@ function bareTopTruncateMiddle(text, maxLen) {
function bareTopFeaturesTableLines(features, cols) {
if (!features || typeof features !== 'object') return [' N/A']
const o = /** @type {Record<string, unknown>} */ (features)
const kw = Math.min(34, Math.max(10, Math.floor(cols * 0.36)))
const c = Math.max(40, cols | 0)
const kw = Math.min(30, Math.max(8, Math.floor(c * 0.26)))
const rowPrefix = ' '
const gap = ' '
const valWidth = Math.max(16, c - rowPrefix.length - kw - gap.length)
const contPad = ' '.repeat(rowPrefix.length + kw + gap.length)
/** @type {string[]} */
const out = [' Features (flattened booleans and scalars)']
/**
* @param {string} keyCol
* @param {string} text
*/
function pushWrappedScalar(keyCol, text) {
const wrapped = bareTopWrapLine(text, valWidth)
for (let i = 0; i < wrapped.length; i++) {
const pad = i === 0 ? rowPrefix + keyCol + gap : contPad
const maxCell = Math.max(4, c - pad.length)
out.push(pad + bareTopTruncateCell(wrapped[i], maxCell, false))
}
}
for (const k of Object.keys(o).sort().slice(0, 200)) {
const v = o[k]
let cell = ''
if (v === true) cell = 'on'
else if (v === false) cell = 'off'
else if (v == null) cell = ''
else if (typeof v !== 'object') cell = String(v)
else cell = bareTopJsonSnippet(v, Math.max(12, cols - kw - 6))
const kl = bareTopTruncateCell(k, kw, true).padEnd(kw)
out.push(
' ' + kl + ' ' + bareTopTruncateCell(cell, cols - kw - 6, false)
)
const keyCol = bareTopTruncateCell(k, kw, true).padEnd(kw)
if (v === true) pushWrappedScalar(keyCol, 'on')
else if (v === false) pushWrappedScalar(keyCol, 'off')
else if (v == null) pushWrappedScalar(keyCol, '')
else if (typeof v !== 'object') pushWrappedScalar(keyCol, String(v))
else {
const nested = bareTopFlattenLimited('', v, 1, 10, 120, 80)
nested.forEach((nl, i) => {
const pad = i === 0 ? rowPrefix + keyCol + gap : contPad
const maxCell = Math.max(8, c - pad.length)
out.push(pad + bareTopTruncateCell(nl, maxCell, false))
})
}
}
return out
}
@@ -1,7 +1,7 @@
{
"schema": 2,
"profileId": "bare-os-posix-like",
"generatedAt": "2026-04-21T23:00:58.659Z",
"generatedAt": "2026-04-21T23:08:29.149Z",
"note": "Sparse POSIX Issue 7 coverage hints for /bin utilities. Omitted command names are not yet profiled here.",
"commandIndex": [
{
@@ -1,6 +1,6 @@
{
"schema": 1,
"atMs": 1776812458658,
"atMs": 1776812909149,
"commands": [
"arch",
"awk",
File diff suppressed because one or more lines are too long