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:
OddTurtleHead committed 2026-11-16 00:37:46 +08:00
1 parent 8ca33fd77d
commit cc36bc4c64
4 files changed
+32 -9

No files matched your search

+17 -3
View File
@@ -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();
}