ui: content-sized label column in decoded field tables (v2.7.14)
The decoded view used a fixed 10rem right-aligned label column, so short labels pushed the values ~168px to the right — for transparent files the block looked like indented record data. efRenderFieldsHtml now uses a grid with grid-template-columns: max-content 1fr: labels stay right aligned and values stay aligned, but the column is only as wide as the widest label of the block. Applies to the file manager decoded view and the snapshot Decoded block (transparent and per-record fields alike). - tests: efRenderFieldsHtml markup (grid, no w-40) and decoded view.
This commit is contained in:
@@ -214,12 +214,25 @@ test('file manager decoded view renders fields, not JSON', () => {
|
||||
assert.match(out, /228062800000208/);
|
||||
assert.match(out, /pySim JSON \(server\)/);
|
||||
assert.doesNotMatch(out, /\{"imsi"/);
|
||||
// the label column is content-sized, not a fixed 10rem block
|
||||
assert.match(out, /grid-template-columns:max-content 1fr/);
|
||||
assert.doesNotMatch(out, /w-40/);
|
||||
// no decoder -> raw fallback with a note
|
||||
const raw = pysimFsDecodedHtml({ name: 'EF.NOPE', fid: 'abcd' }, { success: true, data: '0011' });
|
||||
assert.match(raw, /No decoder for this file/);
|
||||
assert.match(raw, /0011/);
|
||||
});
|
||||
|
||||
test('efRenderFieldsHtml sizes the label column to its content', () => {
|
||||
const out = efRenderFieldsHtml([['ICCID', '8988'], ['Very long label', 'x']]);
|
||||
assert.match(out, /style="display:grid;grid-template-columns:max-content 1fr/);
|
||||
assert.doesNotMatch(out, /w-40/);
|
||||
assert.ok(out.includes('>ICCID</span>'));
|
||||
assert.ok(out.includes('>8988</span>'));
|
||||
assert.ok(out.includes('>Very long label</span>'));
|
||||
assert.match(efRenderFieldsHtml([]), /No decodable fields/);
|
||||
});
|
||||
|
||||
test('profilerRenderReport shows decoded field diffs and the raw-only note', () => {
|
||||
const res = {
|
||||
path: 'ADF.USIM/6F07', name: 'EF.IMSI', status: 'fail',
|
||||
|
||||
Reference in New Issue
Block a user