From 5485d61390fc486d08e8c9b13d028880c35344c3 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: Sat, 12 Sep 2026 19:41:49 +0300 Subject: [PATCH] ui: sort the file manager tree by FID or symbolic name - pysimFsSortChildren() groups DFs above EFs, then sorts each group by FID (default) or case-insensitive symbolic name; missing names fall back to the FID as the sort key; deterministic tie-break; the input array is not mutated - render uses the sorted copy, so lazily loaded directories and custom file injections are sorted too - FID / Name pills above the tree (pysimFsSetSort) persist the choice in localStorage (otaman_fs_sort) and re-render without refetching - tests for the comparator (DF priority, both keys, fallbacks, custom entries, no mutation) and the pill wiring; help/README updated; SW cache v108 -> v109. --- README.md | 1 + README_RUS.md | 1 + frontend/help-ru.html | 2 +- frontend/help.html | 2 +- frontend/index.html | 48 ++++++++++++++++++++++++- frontend/sw.js | 2 +- frontend/tests/fs_sort.test.js | 66 ++++++++++++++++++++++++++++++++++ frontend/tests/html.test.js | 6 ++++ 8 files changed, 124 insertions(+), 4 deletions(-) create mode 100644 frontend/tests/fs_sort.test.js diff --git a/README.md b/README.md index 1e1aba3..cb895e1 100644 --- a/README.md +++ b/README.md @@ -486,6 +486,7 @@ Connects to the bundled [`pysim-otaman-server`](pysim_otaman_server/) for live c Browse the UICC filesystem in a tree view. Files are shown with names, FIDs, and AIDs (for ADFs). Click to read contents. +- Entries are grouped with DFs above EFs and sorted by **FID** or symbolic **Name** (pills above the tree, remembered in `localStorage`) - **Read** — reads the selected file (auto-detects transparent vs record files) - **Edit** — switch to edit mode, modify hex data, click **Save** to write back - **Raw / Decoded** — toggle between hex dump and pysim-decoded JSON view diff --git a/README_RUS.md b/README_RUS.md index ec4b68d..d30e9c4 100644 --- a/README_RUS.md +++ b/README_RUS.md @@ -460,6 +460,7 @@ Delivery PoR (SPI2 `01`) проще — карта возвращает PoR на Дерево файлов UICC. Отображаются имена, FID и AID (для ADF). Клик для чтения содержимого. +- Элементы сгруппированы (DF выше EF) и отсортированы по **FID** или символьному **имени** (пиллы над деревом, выбор сохраняется в `localStorage`) - **Read** — чтение файла (автоопределение transparent/record) - **Edit** — режим редактирования, измените hex-данные и нажмите **Save** для записи - **Raw / Decoded** — переключение между hex-дампом и декодированным JSON diff --git a/frontend/help-ru.html b/frontend/help-ru.html index 58c6a24..45be55c 100644 --- a/frontend/help-ru.html +++ b/frontend/help-ru.html @@ -317,7 +317,7 @@
Подключение к локальному pysim-otaman-server для работы с картой: введите URL сервера (по умолчанию http://127.0.0.1:8080) и нажмите Подключиться. Область статуса показывает состояние ридера/карты, а Подключить карту (пере)инициализирует карту после вставки. Подвкладки: Файловый менеджер, Командная строка pySim и Отправка APDU. «Профайлер» и «Симулятор телефона» — отдельные вкладки верхнего уровня.
Дерево файловой системы отображается слева; выбор файла открывает панель деталей справа.
+Дерево файловой системы отображается слева; выбор файла открывает панель деталей справа. Элементы сгруппированы: DF выше EF, сортировка по FID или символьному имени (пиллы над деревом; выбор сохраняется в localStorage).
Connects to a local pysim-otaman-server for live card operations: enter the server URL (default http://127.0.0.1:8080) and press Connect. The status area shows the reader/card state, and Equip card (re)initializes the card after insertion. Sub-tabs: File manager, pySim command line, and Raw APDU. The Profiler and Phone simulator are separate top-level tabs.
The file system tree is displayed on the left; selecting a file opens its detail pane on the right.
+The file system tree is displayed on the left; selecting a file opens its detail pane on the right. Entries are grouped with DFs above EFs and sorted by FID or symbolic Name (pills above the tree; the choice is remembered in localStorage).