v3.23.3: the low-counter notice polish
The two buttons under a cntr_low verdict shared the red warning style, and the notice only ever rendered in the RAM pill: an SCP80 send wrote it into the hidden RAM container, so the plain-send view showed the verdict text but offered no way to act on it. - The counter probe button is amber and the preset jump green (the warning text stays red). - The probe renders the inline throbber the RAM operations use (animate-spin, no modal) while it runs; its result replaces it in the same box. - Each pill carries its own notice box (#ram-cntr-low / #sp-cntr-low): ramShowCntrLow/ramSyncCounter target the originating view's box and clear the other, the SCP80 send passes 'sp' explicitly (it used to rely on the keyset-view heuristic), and a new send attempt clears the stale verdict (ramClearResults clears both boxes). - The prebuilt Tailwind output was regenerated (npm run build): border-amber-300/-700 and border-emerald-300/-700 were absent from style.css (the stale-style trap). Tests: the button classes, the spinner and the box targeting pinned in ram.test.js. 846 frontend + 830 Python; sw cache simple-v416.
This commit is contained in:
@@ -28,6 +28,7 @@ const FNS = ['berLenStr', 'buildApdu', 'escHtml', 'esc', 'chainInit', 'chainRamB
|
||||
'_parseRawElfEntry', '_parseRawAppEntry', 'ramParseElfStatus', 'ramParseAppStatus', 'ramParseModuleAids', 'parseTLV', '_parseE3Entry', '_parseMenuEntries',
|
||||
'ramExpandedReport', 'ramExpandedMore', 'ramPageFormats', 'ramAppsMissingDetails', 'ramExpandedTags', 'ramExpandedGroups', 'ramExpandedElfForm', 'ramElfVersionHint', 'cardEtsiRelease', 'ramChainGetResponse', 'ramDeriveElfVersions', 'ramElfAppletCandidate', 'ramElfAppMatch',
|
||||
'spCntrLow', 'ramCntrLowHtml', 'ramCntrLowPresetIdx', 'ramCntrLowView', 'ramShowCntrLow',
|
||||
'ramCntrLowBox', 'ramCntrLowClear',
|
||||
'spKeysetKvnOf', 'spKeysetList', 'spKeysetFor', 'spKeysetCheck',
|
||||
'spKeysetOptionsHtml', 'spPresetIdx', 'tarPresetIdx',
|
||||
'cardsKeysetsFromForm', 'spKeysetSync', 'spKeysetApply', 'spKeysetChanged',
|
||||
@@ -913,6 +914,18 @@ test('ramCntrLowHtml states the facts without a fabricated counter', () => {
|
||||
assert.ok(noPreset.includes('onclick="ramGoToPreset(-1)"'), noPreset);
|
||||
assert.ok(noPreset.includes('onclick="ramSyncCounter(-1, \'ram\')"'), noPreset);
|
||||
assert.ok(spView.includes('onclick="ramSyncCounter(1, \'sp\')"'), spView);
|
||||
// v3.23.3: the probe button is amber, the preset jump green
|
||||
const syncBtn = out.match(/<button[^>]*ramSyncCounter[^>]*>/)[0];
|
||||
assert.ok(syncBtn.includes('border-amber-300'), syncBtn);
|
||||
assert.ok(!syncBtn.includes('border-red-300'), syncBtn);
|
||||
const goBtn = out.match(/<button[^>]*ramGoToPreset[^>]*>/)[0];
|
||||
assert.ok(goBtn.includes('border-emerald-300'), goBtn);
|
||||
// the notice targets the originating view's box; the probe renders the
|
||||
// inline throbber (the RAM inline-progress spinner, no modal)
|
||||
assert.match(extractFunc(html, 'ramShowCntrLow'), /ramCntrLowBox\(v\)/);
|
||||
assert.match(extractFunc(html, 'ramSyncCounter'), /animate-spin/);
|
||||
assert.match(extractFunc(html, 'ramSyncCounter'), /ramCntrLowBox\(/);
|
||||
assert.match(html, /id="sp-cntr-low"/);
|
||||
});
|
||||
|
||||
test('the explorer shows versions on app and ISD rows too', () => {
|
||||
@@ -963,7 +976,8 @@ test('every SCP80/RAM flow checks the low counter and stops', () => {
|
||||
const explore = extractFunc(html, 'ramExplore');
|
||||
assert.ok(explore.includes('spCntrLow(res)'), 'the Explore must check every send');
|
||||
assert.ok(explore.includes('if (cntrLow) break;'), 'the loops must stop');
|
||||
assert.ok(explore.includes('ramShowCntrLow()'), 'the verdict must be shown');
|
||||
assert.ok(explore.includes("ramShowCntrLow(undefined, 'ram')"),
|
||||
'the verdict must be shown in the RAM view');
|
||||
// the delete flow and the plain send check it too
|
||||
assert.ok(extractFunc(html, 'ramDeleteFromExplorer').includes('spCntrLow(res)'),
|
||||
'the delete flow must stop');
|
||||
|
||||
@@ -32,6 +32,7 @@ for (const fn of ['berLenStr', 'ramDeleteApdu', 'ramIncrementCntr', 'ramSaveCntr
|
||||
'spPresetIdx', 'spPresetCounterValue', 'spCntrPlaceholder', 'spCntrAhead',
|
||||
'ramHideProgress', 'ramDeleteFromExplorer',
|
||||
'spCntrLow', 'ramCntrLowHtml', 'ramCntrLowPresetIdx', 'ramCntrLowView', 'ramShowCntrLow',
|
||||
'ramCntrLowBox', 'ramCntrLowClear',
|
||||
'escHtml', 'esc',
|
||||
'spKeysetKvnOf', 'spKeysetList', 'spKeysetFor', 'spKeysetCheck',
|
||||
'spKeysetOptionsHtml', 'cardsKeysetRowHtml', 'cardsKeysetRowsRender',
|
||||
|
||||
Reference in New Issue
Block a user