Skip to content

Commit e6a7cf6

Browse files
author
web3blind
committed
Reorder home actions and character notes
1 parent cb06bc2 commit e6a7cf6

6 files changed

Lines changed: 29 additions & 17 deletions

File tree

app/index.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -186,8 +186,8 @@
186186
<script src="js/ui/screens/landing.js"></script>
187187
<script src="js/ui/screens/login.js?v=20260711a"></script>
188188
<script src="js/ui/screens/onboarding.js"></script>
189-
<script src="js/ui/screens/home.js?v=20260713a"></script>
190-
<script src="js/ui/screens/character.js?v=20260713a"></script>
189+
<script src="js/ui/screens/home.js?v=20260713b"></script>
190+
<script src="js/ui/screens/character.js?v=20260713b"></script>
191191
<script src="js/ui/screens/hunt.js?v=20260713b"></script>
192192
<script src="js/ui/screens/inventory.js?v=20260621l"></script>
193193
<script src="js/ui/screens/chronicle.js?v=20260712a"></script>

app/js/ui/screens/character.js

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -39,13 +39,11 @@ var CharacterScreen = (function() {
3939
'<p>' + t('class_' + ch.className) + ' \u2022 ' + t('home_level') + ' ' + ch.level + '</p></div>' +
4040
'</div>' +
4141
ProgressBar.create({id:'char-hp-bar', label:'❤️ HP', value:ch.hp, max:ch.maxHp, displayValue:hpShown, displayMax:CHARACTER_HP_DISPLAY_MAX, color:'#e53935'}) +
42+
'<p class="quest-desc character-vital-note">' + t('char_hp_explainer') + '</p>' +
4243
ProgressBar.create({id:'char-xp-bar', label:'⭐ XP', value:xpCurrent, max:xpNeeded, displayValue:xpShown, displayMax:CHARACTER_XP_DISPLAY_MAX, color:'#ffc107'}) +
44+
'<p class="quest-desc character-vital-note">' + t('char_xp_explainer') + '</p>' +
4345
ProgressBar.create({id:'char-mana-bar', label:'⚡ ' + t('home_mana'), value:0, max:100, color:'#2196f3'}) +
44-
'<div class="character-growth-notes">' +
45-
'<p class="quest-desc">' + t('char_hp_explainer') + '</p>' +
46-
'<p class="quest-desc">' + t('char_xp_explainer') + '</p>' +
47-
'<p class="quest-desc">' + t('char_mana_explainer') + '</p>' +
48-
'</div>' +
46+
'<p class="quest-desc character-vital-note">' + t('char_mana_explainer') + '</p>' +
4947
'<h2>' + t('char_stats') + '</h2>' +
5048
'<div class="stats-list">' +
5149
_statRow(t('char_potency'), totalPot) +

app/js/ui/screens/home.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@
55
var HomeScreen = (function() {
66
'use strict';
77

8-
var PRIMARY_HOME_SCREENS = ['home', 'hunt', 'map', 'chronicle', 'guild', 'marketplace', 'crafting', 'character', 'temple', 'leaderboard'];
9-
var SECONDARY_HOME_SCREENS = ['inventory', 'arena', 'quests', 'world-boss', 'settings', 'help'];
8+
var PRIMARY_HOME_SCREENS = ['home', 'hunt', 'map', 'inventory', 'arena', 'quests', 'guild', 'marketplace', 'crafting', 'temple'];
9+
var SECONDARY_HOME_SCREENS = ['chronicle', 'character', 'leaderboard', 'world-boss', 'settings', 'help'];
1010
var HOME_HP_DISPLAY_MAX = 5000;
1111
var HOME_XP_DISPLAY_MAX = 3000;
1212

app/manifest.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"short_name": "VizMagic",
44
"description": "Viz Magic — accessible browser RPG on the VIZ blockchain",
55
"id": "https://vizmagic.web3blind.xyz/",
6-
"start_url": "/?pwa=viz-magic-v50",
6+
"start_url": "/?pwa=viz-magic-v51",
77
"scope": "/",
88
"display": "standalone",
99
"display_override": ["standalone", "minimal-ui"],

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-v50';
2+
var CACHE_NAME = 'viz-magic-v51';
33
var ASSETS = [
44
'/',
55
'/index.html',

tests/player-bug-regressions.test.js

Lines changed: 20 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -345,7 +345,7 @@ test('high-traffic UI narration, screen announcements, and inventory stat labels
345345

346346
test('service worker updates quickly and keeps navigations network-first', function () {
347347
const swJs = read('app/sw.js');
348-
assert.ok(/viz-magic-v50/.test(swJs), 'service worker cache version should be bumped');
348+
assert.ok(/viz-magic-v51/.test(swJs), 'service worker cache version should be bumped');
349349
assert.ok(/self\.skipWaiting\(\)/.test(swJs), 'service worker should activate new cache without waiting for all tabs to close');
350350
assert.ok(/self\.clients\.claim\(\)/.test(swJs), 'service worker should claim clients after activation');
351351
assert.ok(/event\.request\.mode === 'navigate'[\s\S]*fetch\(event\.request\)/.test(swJs), 'navigation requests should prefer network to avoid stale cached index');
@@ -381,7 +381,7 @@ test('mobile entry helpers cover keyboard paste, home-screen shortcut, nav parit
381381
assert.ok(/beforeinstallprompt/.test(appJs), 'app should listen for PWA install prompt');
382382
assert.ok(/function installShortcut/.test(appJs), 'app should expose an install shortcut action');
383383
assert.ok(/home_install_shortcut/.test(homeJs + ruJs + enJs), 'home screen should offer install-shortcut guidance');
384-
assert.ok(/var PRIMARY_HOME_SCREENS = \['home', 'hunt', 'map', 'chronicle', 'guild', 'marketplace', 'crafting', 'character', 'temple', 'leaderboard'\]/.test(homeJs), 'home primary grid should put Chronicle in the first visible row');
384+
assert.ok(/var PRIMARY_HOME_SCREENS = \['home', 'hunt', 'map', 'inventory', 'arena', 'quests', 'guild', 'marketplace', 'crafting', 'temple'\]/.test(homeJs), 'home primary grid should put bag, arena and quests in the first visible sections');
385385
assert.ok(/nav_bazaar/.test(homeJs) && /nav_crafting/.test(homeJs), 'home primary labels should reuse bottom-nav translation keys');
386386
assert.ok(/prophecy-mini-button/.test(homeJs), 'daily prophecy card should be an active navigation button');
387387
assert.ok(/Helpers.EventBus.emit\('navigate', 'quests'\)/.test(homeJs), 'daily prophecy should navigate to quests');
@@ -394,7 +394,7 @@ test('mobile entry helpers cover keyboard paste, home-screen shortcut, nav parit
394394
assert.ok(/SoundManager\.setVolume\(sfxVolume \/ 100\)/.test(read('app/js/ui/screens/settings.js')), 'settings should apply stored SFX volume on render');
395395
assert.ok(/localStorage\.setItem\(STORAGE_PREFIX \+ 'sfx_volume'/.test(read('app/js/ui/sound.js')), 'sound manager should persist SFX volume');
396396
assert.ok(/var volume = _getStoredNumber\('sfx_volume', 0\.5\)/.test(read('app/js/ui/sound.js')), 'sound manager should restore persisted SFX volume');
397-
assert.ok(/viz-magic-v50/.test(read('app/sw.js')), 'service worker cache should be bumped for UI changes');
397+
assert.ok(/viz-magic-v51/.test(read('app/sw.js')), 'service worker cache should be bumped for UI changes');
398398
});
399399

400400

@@ -458,7 +458,7 @@ test('magical weather is labelled and affects hunts', function () {
458458
assert.ok(/festival_today_prefix/.test(homeJs + ruJs + enJs), 'forecast holidays should have localized copy');
459459
assert.ok(/i18n\/ru.js\?v=20260713c/.test(indexHtml), 'Russian weather copy must be cache-busted');
460460
assert.ok(/i18n\/en.js\?v=20260713c/.test(indexHtml), 'English weather copy must be cache-busted');
461-
assert.ok(/home.js\?v=20260713a/.test(indexHtml), 'home forecast layout must be cache-busted');
461+
assert.ok(/home.js\?v=20260713b/.test(indexHtml), 'home forecast layout must be cache-busted');
462462
assert.ok(/quests.js\?v=20260712a/.test(indexHtml), 'quest-limit UX must be cache-busted');
463463
assert.ok(/nav.js\?v=20260712b/.test(indexHtml), 'bottom tray nav must be cache-busted');
464464
assert.ok(/leaderboard.js\?v=20260712c/.test(indexHtml), 'leaderboard narrator fix must be cache-busted');
@@ -524,13 +524,13 @@ test('reported mobile UX issues have explicit fixes', function () {
524524

525525
test('PWA icon and HP heart use expressive color accents', function () {
526526
assert.ok(/viz-magic-192\.png\?v=20260713a/.test(indexHtml), 'PWA icon link should be cache-busted after plus placement/color update');
527-
assert.ok(/viz-magic-v50/.test(read('app/manifest.json')), 'manifest start URL should change so launchers can refresh icons');
527+
assert.ok(/viz-magic-v51/.test(read('app/manifest.json')), 'manifest start URL should change so launchers can refresh icons');
528528
assert.ok(/label:' HP'/.test(homeJs), 'HP label should use a red heart emoji variant');
529529
});
530530

531531

532532
test('character screen uses current home-scale vitals and growth explainers', function () {
533-
assert.ok(/character.js\?v=20260713a/.test(indexHtml), 'character screen should be cache-busted');
533+
assert.ok(/character.js\?v=20260713b/.test(indexHtml), 'character screen should be cache-busted');
534534
assert.ok(/CHARACTER_HP_DISPLAY_MAX = 5000/.test(characterScreenJs), 'character HP should use the same 5000 display scale as Home');
535535
assert.ok(/label:' HP'/.test(characterScreenJs), 'character HP should have the red heart icon');
536536
assert.ok(/label:' XP'/.test(characterScreenJs), 'character XP should have an icon and visible bar');
@@ -566,6 +566,20 @@ test('narrator voice preferences support gender and timbre', function () {
566566
assert.ok(/narrator_voice_hint/.test(settingsJs + ruJs + enJs), 'settings should explain browser voice limitations');
567567
});
568568

569+
570+
test('home action tiles reflect Denis priority order', function () {
571+
assert.ok(/home.js\?v=20260713b/.test(indexHtml), 'home screen should be cache-busted for action order');
572+
assert.ok(/PRIMARY_HOME_SCREENS = \['home', 'hunt', 'map', 'inventory', 'arena', 'quests', 'guild', 'marketplace', 'crafting', 'temple'\]/.test(homeJs), 'primary row should include bag, arena and quests');
573+
assert.ok(/SECONDARY_HOME_SCREENS = \['chronicle', 'character', 'leaderboard', 'world-boss', 'settings', 'help'\]/.test(homeJs), 'secondary sections should hold chronicle, character and leaderboard');
574+
});
575+
576+
577+
test('character vital explainers are placed immediately after their bars', function () {
578+
assert.ok(/character.js\?v=20260713b/.test(indexHtml), 'character screen should be cache-busted for vital layout');
579+
assert.ok(/char-hp-bar[\s\S]*char_hp_explainer[\s\S]*char-xp-bar[\s\S]*char_xp_explainer[\s\S]*char-mana-bar[\s\S]*char_mana_explainer/.test(characterScreenJs), 'character vital explanations should follow HP, XP and Mana bars respectively');
580+
assert.ok(!/character-growth-notes/.test(characterScreenJs), 'vital explanations should not be grouped away from their bars');
581+
});
582+
569583
if (process.exitCode) {
570584
process.exit(process.exitCode);
571585
}

0 commit comments

Comments
 (0)