Skip to content

Commit d54dc2d

Browse files
author
web3blind
committed
Fix mobile overflow and narrator regressions
1 parent 3165808 commit d54dc2d

4 files changed

Lines changed: 10 additions & 4 deletions

File tree

app/index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,7 @@
170170

171171
<!-- UI Components -->
172172
<script src="js/ui/sound.js?v=20260711c"></script>
173-
<script src="js/ui/components/progress-bar.js?v=20260711d"></script>
173+
<script src="js/ui/components/progress-bar.js?v=20260712b"></script>
174174
<script src="js/ui/components/toast.js?v=20260711b"></script>
175175
<script src="js/ui/components/modal.js"></script>
176176
<script src="js/ui/components/nav.js"></script>

app/js/ui/components/progress-bar.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,11 @@ var ProgressBar = (function() {
4040
var shownMax = (typeof displayMax !== 'undefined') ? displayMax : max;
4141
el.setAttribute('aria-valuenow', shownValue);
4242
el.setAttribute('aria-valuemax', shownMax);
43+
var label = el.getAttribute('aria-label') || '';
44+
var labelName = label.split(' ')[0] || '';
45+
if (labelName) {
46+
el.setAttribute('aria-label', labelName + ' ' + shownValue + ' of ' + shownMax);
47+
}
4348
var fill = el.querySelector('.progress-fill');
4449
if (fill) fill.style.width = pct + '%';
4550
var text = el.querySelector('.progress-text');

app/sw.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// Viz Magic — Service Worker
2-
var CACHE_NAME = 'viz-magic-v34';
2+
var CACHE_NAME = 'viz-magic-v35';
33
var ASSETS = [
44
'/',
55
'/index.html',

tests/player-bug-regressions.test.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -335,7 +335,7 @@ test('high-traffic UI narration, screen announcements, and inventory stat labels
335335

336336
test('service worker updates quickly and keeps navigations network-first', function () {
337337
const swJs = read('app/sw.js');
338-
assert.ok(/viz-magic-v34/.test(swJs), 'service worker cache version should be bumped');
338+
assert.ok(/viz-magic-v35/.test(swJs), 'service worker cache version should be bumped');
339339
assert.ok(/self\.skipWaiting\(\)/.test(swJs), 'service worker should activate new cache without waiting for all tabs to close');
340340
assert.ok(/self\.clients\.claim\(\)/.test(swJs), 'service worker should claim clients after activation');
341341
assert.ok(/event\.request\.mode === 'navigate'[\s\S]*fetch\(event\.request\)/.test(swJs), 'navigation requests should prefer network to avoid stale cached index');
@@ -382,7 +382,7 @@ test('mobile entry helpers cover keyboard paste, home-screen shortcut, nav parit
382382
assert.ok(/SoundManager\.setVolume\(sfxVolume \/ 100\)/.test(read('app/js/ui/screens/settings.js')), 'settings should apply stored SFX volume on render');
383383
assert.ok(/localStorage\.setItem\(STORAGE_PREFIX \+ 'sfx_volume'/.test(read('app/js/ui/sound.js')), 'sound manager should persist SFX volume');
384384
assert.ok(/var volume = _getStoredNumber\('sfx_volume', 0\.5\)/.test(read('app/js/ui/sound.js')), 'sound manager should restore persisted SFX volume');
385-
assert.ok(/viz-magic-v34/.test(read('app/sw.js')), 'service worker cache should be bumped for UI changes');
385+
assert.ok(/viz-magic-v35/.test(read('app/sw.js')), 'service worker cache should be bumped for UI changes');
386386
});
387387

388388

@@ -393,6 +393,7 @@ test('home dashboard uses Denis-approved visual scales and keeps real mana perce
393393
assert.ok(/displayMax:HOME_XP_DISPLAY_MAX/.test(homeJs), 'XP bar should show the visual XP scale');
394394
assert.ok(/ProgressBar\.update\('mana-bar', currentEnergy \/ 100, 100\)/.test(homeJs), 'mana should remain real VIZ energy as 0-100 percent');
395395
assert.ok(/displayValue/.test(read('app/js/ui/components/progress-bar.js')), 'progress bar should separate real ratio from displayed scale');
396+
assert.ok(/setAttribute\('aria-label'/.test(read('app/js/ui/components/progress-bar.js')), 'progress update should refresh aria label for screen readers');
396397
});
397398

398399
test('narrator and install instructions are actionable, not silent toggles or transient toasts', function () {

0 commit comments

Comments
 (0)