v3.28.1: the batch panel polish

- A throbber (#ram-batch-spin) next to the phase line shows while a card
  is actually being installed (active && current - the stopping-mid-
  install phase included) and hides again while waiting.
- The waiting prompt is explicit now: "Insert next card. Waiting for a
  card..." (RU "Вставьте следующую карту. Ожидание карты…"); the old
  "Waiting for a card..." key is gone.
- The notice reports only the last *finished* card: starting the next
  card's install clears it (state['notice'] = '' alongside
  current/installing in _ram_batch_handle_card), so the previous card's
  verdict never lingers over the next install.  It stays visible while
  waiting - the "report the status + ask for the next card" behavior.
- The batch operation's RU label is "Пакетная установка (.cap на
  множество карт)"; the help row's title aligned.

Tests: the render test (the new prompt, the throbber visible while
installing / stopping-mid-install and hidden while waiting, an empty
notice hiding the box) and the worker test (the notice is empty
mid-install and set again for the new outcome).  915 frontend + 925
Python; sw cache simple-v439.
This commit is contained in:
2026-10-14 18:04:22 +03:00
parent 262041795c
commit 91996a941b
7 changed files with 57 additions and 13 deletions
+21
View File
@@ -205,6 +205,27 @@ class BatchCardTests(unittest.TestCase):
self.assertEqual(st['counts']['failed'], 1)
self.assertEqual(st['seen']['8970119000004600098'], 'failed')
def test_a_new_install_clears_the_previous_notice(self):
"""The notice reports the last *finished* card: starting the next
card's install must clear it (v3.28.1)."""
st = srv._ram_batch_new_state(_plan())
srv._ram_batch_record(st, {'iccid': '8970119000004600000', 'result': 'installed'})
self.assertIn('installed', st['notice'])
preset = _preset('8970119000004600098', 'Alfa')
seen = {}
def fake_run(server, body, plan, scc):
seen['notice'] = st['notice'] # what the panel would render
seen['current'] = st['current']
return {'success': True}
with mock.patch.object(srv, '_ram_install_run', fake_run):
srv._ram_batch_handle_card(st, _fake_server('8970119000004600098',
_FakeStore([preset])))
self.assertEqual(seen['notice'], '') # cleared while installing
self.assertEqual(seen['current']['iccid'], '8970119000004600098')
self.assertIn('installed', st['notice']) # ...and set for the new outcome
def test_a_card_already_processed_is_reported_not_reinstalled(self):
st = srv._ram_batch_new_state(_plan())
preset = _preset('8970119000004600098', 'Alfa')