diff --git a/frontend/index.html b/frontend/index.html index b900204..4605e63 100644 --- a/frontend/index.html +++ b/frontend/index.html @@ -3462,9 +3462,11 @@ function rfmFileOptionsHtml(chainId, idx, list) { for (const [root, items] of groups) { html += ''; for (const it of items) { - const parent = rfmParentPath(it.e.sym || it.e.path).replace(/^[^/]+\//, ''); + // Path within the root, FIDs in order (the optgroup carries the + // root) - the same convention as the path field, with slashes. + const inRoot = it.e.path.slice(it.e.root.length + 1); html += ''; } diff --git a/frontend/sw.js b/frontend/sw.js index 18fba7a..cb6daa2 100644 --- a/frontend/sw.js +++ b/frontend/sw.js @@ -1,4 +1,4 @@ -const CACHE = 'simple-v242'; +const CACHE = 'simple-v243'; const URLS = [ 'index.html', 'help.html', diff --git a/frontend/tests/uicc_files.test.js b/frontend/tests/uicc_files.test.js index 233ddaa..a20eff5 100644 --- a/frontend/tests/uicc_files.test.js +++ b/frontend/tests/uicc_files.test.js @@ -194,6 +194,23 @@ test('rfmFileEntries merges card tree, custom files and the standard list', () = pysimCustomFiles = []; }); +test('rfmFileOptionsHtml labels files with their path within the root', () => { + const list = rfmFileEntries(); + setChain('chain-usim', [row('select', { method: 'fid' })]); + const opts = rfmFileOptionsHtml('chain-usim', 0, list); + // ADF.USIM session: EF.IMSI is a direct child of the root. + assert.ok(opts.includes('>EF.IMSI — 6F07<'), opts.match(/>EF\.IMSI[^<]*')); + assert.ok(!opts.includes('6F07 — '), 'no reversed "fid — parent" label'); + // Deep file under a DF: the label reads like the path field. + rfmSetStartDf('chain-usim', 'MF'); + setChain('chain-sim', [row('select', { method: 'path', path: '7F10' })]); + const deep = rfmFileOptionsHtml('chain-sim', 1, list); + assert.ok(deep.includes('>EF.MSISDN — 7F10/6F40<'), deep.match(/>EF\.MSISDN[^<]* { const list = rfmFileEntries(); setChain('chain-sim', [row('select', { method: 'fid' })]);