From 1035bf069d565c9580f60d004232ec911d549469 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=90=D0=BD=D1=82=D0=BE=D0=BD=20=D0=A2=D1=80=D0=BE=D1=88?= =?UTF-8?q?=D0=B8=D0=BD?= Date: Wed, 23 Sep 2026 08:30:12 +0300 Subject: [PATCH] =?UTF-8?q?ui:=20show=20SELECT=20picker=20paths=20from=20t?= =?UTF-8?q?he=20root=20instead=20of=20"fid=20=E2=80=94=20parent"?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The picker option label read backwards, e.g. "EF.IMSI — 6F07 — 7F20". It now shows the path within the optgroup's root with the FIDs in order, matching the path-field convention: "EF.IMSI — 7F20/6F07", "EF.ICCID — 2FE2", "EF.PSC — 5F3A/4F22" (ADF session). Switch markers and the filter (which also matches the symbolic path) are unchanged. sw cache -> simple-v243; version stays 3.4.0. --- frontend/index.html | 6 ++++-- frontend/sw.js | 2 +- frontend/tests/uicc_files.test.js | 17 +++++++++++++++++ 3 files changed, 22 insertions(+), 3 deletions(-) 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' })]);