mirror of
https://github.com/EchoSixHIYA/WebSpeak-client-for-TeamSpeak.git
synced 2026-12-03 12:02:50 +08:00
fix: return floating host controls home only after a screen change
Live re-test of a1c8329 on open-voice-surface desktop: toasts no longer pull the application-library launcher back, but opening the audio-settings modal did. Its backdrop hid "Share accompaniment", the default bottom-right corner looked free, the launcher went home, and right after Esc it still covered the button. 854a488's return-home rule is meant for a stale spot picked for the previous screen, so apply it only within the screen-change window (home <-> voice page, skin switch); on the same screen a free-looking default corner may just be hidden for a moment. The ts3-classic home-return case still passes (it goes through screenChanged()). Browser fixture: modal dialog over the corner (fails on a1c8329 and 854a488).
This commit is contained in:
1 parent
8ca33fd77d
commit
cc36bc4c64
4 files changed
+32
-9
No files matched your search
+17
-3
@@ -57,8 +57,9 @@ try {
|
||||
const accompaniment = document.getElementById("accompaniment");
|
||||
|
||||
// A. A toast keeps passing over the accompaniment button (every mic/output
|
||||
// toggle shows one). The launcher must not take the "free" default corner
|
||||
// while the toast hides the button, and must never end up covering it.
|
||||
// toggle shows one), then a modal dialog hides it. The launcher must not
|
||||
// take the "free" default corner while the button is hidden, and must never
|
||||
// end up covering it.
|
||||
{
|
||||
const { lib, binding } = makeLauncher();
|
||||
binding.revalidate(); await sleep(1400); binding.revalidate(); await sleep(50);
|
||||
@@ -77,7 +78,20 @@ try {
|
||||
}
|
||||
}
|
||||
await sleep(1500);
|
||||
results.push({ name: "toast-transient", settled, positions: [...positions], coveredSamples, samples, final: binding.position, finalCovered: coveredByLib(accompaniment) });
|
||||
// A modal dialog (audio settings) opens over everything: its backdrop
|
||||
// hides the accompaniment button, so the default corner looks free. On the
|
||||
// same screen that is no reason to go back there.
|
||||
const modalPositions = new Set();
|
||||
document.body.insertAdjacentHTML("beforeend", '<div id="backdrop" style="position:fixed;inset:0;z-index:20;background:#0006"></div>'
|
||||
+ '<div id="settings" role="dialog" aria-modal="true" style="position:fixed;left:440px;top:200px;width:400px;height:300px;z-index:21;background:#fff">'
|
||||
+ '<button type="button" id="close-settings" style="margin:16px">Close</button></div>');
|
||||
for (let i = 0; i < 20; i++) { binding.revalidate(); modalPositions.add(binding.position); await sleep(100); }
|
||||
document.getElementById("backdrop").remove();
|
||||
document.getElementById("settings").remove();
|
||||
binding.revalidate();
|
||||
await sleep(100);
|
||||
const afterModal = { positions: [...modalPositions], position: binding.position, accompanimentCovered: coveredByLib(accompaniment) };
|
||||
results.push({ name: "toast-transient", afterModal, settled, positions: [...positions], coveredSamples, samples, final: binding.position, finalCovered: coveredByLib(accompaniment) });
|
||||
binding.dispose();
|
||||
lib.remove();
|
||||
}
|
||||
|
||||
@@ -396,13 +396,17 @@ test("floating host controls see through toasts and still step off a control whi
|
||||
const byName = Object.fromEntries(payload.results.map((result) => [result.name, result]));
|
||||
t.diagnostic(JSON.stringify(payload.results));
|
||||
|
||||
// open-voice-surface desktop: toasts passing over "Share accompaniment" no
|
||||
// longer make the default bottom-right corner look free.
|
||||
// open-voice-surface desktop: toasts passing over "Share accompaniment" (or
|
||||
// the audio-settings modal) no longer make the default corner look free.
|
||||
const toast = byName["toast-transient"];
|
||||
assert.notEqual(toast.settled, "bottom-right", JSON.stringify(toast));
|
||||
assert.ok(!toast.positions.includes("bottom-right"), JSON.stringify(toast));
|
||||
assert.equal(toast.coveredSamples, 0, JSON.stringify(toast));
|
||||
assert.equal(toast.finalCovered, false, JSON.stringify(toast));
|
||||
// Same screen, modal backdrop over the corner: no return home, so the
|
||||
// button is usable the moment the dialog closes.
|
||||
assert.ok(!toast.afterModal.positions.includes("bottom-right"), JSON.stringify(toast));
|
||||
assert.equal(toast.afterModal.accompanimentCovered, false, JSON.stringify(toast));
|
||||
|
||||
// Parked at the default corner by the flap freeze on top of a control: one
|
||||
// escape about 1 s after the freeze (inside the 3 s pin), then still for the rest of it.
|
||||
|
||||
Reference in new issue
Block a user