fix: harden turn flow interaction UX
This commit is contained in:
@@ -141,12 +141,21 @@ function validateCampInteractionUxGuards() {
|
||||
);
|
||||
checkedGuardCount += 1;
|
||||
|
||||
const navigationLockIndex = navigationMethod.indexOf('this.navigationPending = true;');
|
||||
const navigationBlockerIndex = navigationMethod.indexOf('this.showCampNavigationBlocker();');
|
||||
const lazySceneReadyIndex = navigationMethod.indexOf('await ensureLazyScene(this.game, key);');
|
||||
const stateCommitIndex = navigationMethod.indexOf('commitState();');
|
||||
const sceneStartIndex = navigationMethod.indexOf('this.scene.start(key, data);');
|
||||
expectCampUx(
|
||||
navigationMethod.includes('if (this.navigationPending)') &&
|
||||
navigationMethod.includes('this.navigationPending = true;') &&
|
||||
navigationMethod.includes('startLazyScene(this, key, data)') &&
|
||||
navigationMethod.includes('this.navigationPending = false;'),
|
||||
'lazy camp navigation must lock before loading and unlock after a failed transition'
|
||||
navigationLockIndex >= 0 &&
|
||||
navigationBlockerIndex > navigationLockIndex &&
|
||||
lazySceneReadyIndex > navigationBlockerIndex &&
|
||||
stateCommitIndex > lazySceneReadyIndex &&
|
||||
sceneStartIndex > stateCommitIndex &&
|
||||
navigationMethod.includes('this.navigationPending = false;') &&
|
||||
navigationMethod.includes('this.hideCampNavigationBlocker();'),
|
||||
'lazy camp navigation must lock the screen, finish loading, commit state, and then start the scene'
|
||||
);
|
||||
checkedGuardCount += 1;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user