Keep Scope opacity at half or more, and ignore a value that is not a number

A fainter mask reads as Scope off while labels still fade outside the
keyhole and the HUD gets no backplates.

Co-authored-by: Manjunath Paparaju <[email protected]>
This commit is contained in:
Sameh KhamisandManjunath Paparaju committed 2026-11-14 15:31:33 -08:00
1 parent a1e7b2a394
commit 2fd8d32a5d
7 files changed
+106 -42

No files matched your search

+7 -6
View File
@@ -246,7 +246,7 @@ test('the Visual panel’s scope opacity, reset and presets call their actions',
],
});
await nextTick();
input($('scope-opacity-slider'), 40);
input($('scope-opacity-slider'), 60);
document.querySelector('#pp-toggles .pp-reset-btn').click();
const presets = document.querySelector('#pp-toggles .visual-presets');
presets.querySelector('[data-style="noir"]').click();
@@ -254,7 +254,7 @@ test('the Visual panel’s scope opacity, reset and presets call their actions',
chips[0].click();
chips[1].click();
assert.deepEqual(calls, [
['setScopeOpacity', 40],
['setScopeOpacity', 60],
['resetVisual'],
['setStyle', 'noir'],
]);
@@ -290,7 +290,8 @@ test('DisplayBindings sets the scope opacity and resets Visual to its defaults',
elements: { _locationSearch: document.createElement('input') },
operations: {
setStyle: (style, options) => calls.push(['style', style, options]),
_applyGlobalPostDefaults: () => calls.push(['postDefaults']),
_applyGlobalPostDefaults: (options) =>
calls.push(['postDefaults', options]),
_setDetectionAllocation: (value) => calls.push(['allocation', value]),
_setScope: (scope) => calls.push(['scope', scope]),
_setModels3dEnabled: (on) => calls.push(['models3d', on]),
@@ -310,10 +311,10 @@ test('DisplayBindings sets the scope opacity and resets Visual to its defaults',
bindings._initUI();
t.after(() => bindings.destroy());
calls.length = 0;
input($('scope-opacity-slider'), 35);
input($('scope-opacity-slider'), 65);
assert.deepEqual(calls, [
['claim', 'visual'],
['scope', { opacityPct: 35 }],
['scope', { opacityPct: 65 }],
['share'],
]);
calls.length = 0;
@@ -321,7 +322,7 @@ test('DisplayBindings sets the scope opacity and resets Visual to its defaults',
assert.deepEqual(calls, [
['claim', 'visual'],
['style', 'normal', { userInitiated: true }],
['postDefaults'],
['postDefaults', { keepHudVariant: true }],
['allocation', 'ELASTIC'],
['scope', { enabled: true, featherPct: 100, opacityPct: 100 }],
['models3d', true],