Command filter: multi-select with conversation presets (v2.7.0)

- the single-command <select> becomes a checkbox dropdown: the filter is a
  set of entries (an empty set shows everything), so any number of commands
  can be shown at once instead of one
- three fixed presets select whole conversations:
  * Proactive sessions — FETCH, TERMINAL PROFILE and every command the card
    answered with SW 91xx (the proactive-session initiators)
  * Proactive + events — the same plus ENVELOPE
  * File operations — SELECT, READ BINARY, READ RECORD, UPDATE BINARY,
    UPDATE RECORD (their GET RESPONSE, which carries the data/FCP, comes
    along through the existing response_for linkage)
  presets and single commands combine as a union, and the menu lists the
  session's commands with their counts
- the button summarises the selection ("All commands" / one name /
  "{n} commands"); Escape or a click outside closes the menu; focusing an
  APDU from the Files panel/map still clears the filter first
- tests: a new filter test (the matching rules per entry kind, the GR
  linkage, the presets, the union, the summary, the menu rows, the RU keys
  and the wiring pins), and the focusMessage tests follow the new state;
  527 Python + 72 Node tests
- README/README_RUS describe the filter; PWA_VERSION/pyproject/version.py
  2.7.0, SW cache simtrace-analyser-v80
This commit is contained in:
catarrh committed 2026-10-17 23:55:28 +03:00
1 parent 009fcf2253
commit e0134c769a
9 files changed
+362 -38

No files matched your search

+9 -3
View File
@@ -15,6 +15,7 @@ let renders = [];
let focused = [];
let el = () => ({});
let showDetail = () => {};
function renderFilterMenu() {} // the real one needs the menu DOM
function renderMessages(skipScroll, forceStick) {
renders.push([skipScroll, forceStick]);
}
@@ -27,7 +28,8 @@ eval(
);
// The real focusMessage, under an alias: the stub above stays in place for
// the jumpToMessage tests.
eval('var realFocusMessage = ' + extractFunc(src, 'focusMessage') + ';');
eval(extractFunc(src, 'clearFilter') + '\n' +
'var realFocusMessage = ' + extractFunc(src, 'focusMessage') + ';');
test('jumpToMessage pages, renders without stick-to-bottom, then focuses', async () => {
renders = [];
@@ -97,7 +99,8 @@ test('focusMessage marks the record persistently and updates the detail', () =>
classList: { add: c => classes.add(c), remove: c => classes.delete(c) },
scrollIntoView: () => {},
};
STATE = { messages: [{ id: 'a' }, { id: 'b' }], selectedIdx: 0 };
STATE = { messages: [{ id: 'a' }, { id: 'b' }], selectedIdx: 0,
filter: new Set() };
el = () => ({ value: '', querySelector: () => entry });
let detailed = null;
showDetail = (msg, e) => { detailed = [msg, e]; };
@@ -116,12 +119,15 @@ test('focusMessage clears a filter before focusing', () => {
classList: { add: () => {}, remove: () => {} },
scrollIntoView: () => {},
};
STATE = { messages: {}, selectedIdx: null };
STATE = { messages: {}, selectedIdx: null,
filter: new Set(['cmd:SELECT']) };
el = () => ({ value: 'x', querySelector: () => entry });
showDetail = () => {};
realFocusMessage(3);
assert.deepEqual(renders, [[true, undefined]]);
assert.equal(STATE.selectedIdx, 3);
// The stale filter is gone, so the focused record is visible.
assert.equal(STATE.filter.size, 0);
});
test('the selection persists across renders (source pins)', () => {