fix: an open popup follows a network switch the background saves (closes #650)
check / check (push) Canceled after 0s
e2e / e2e-chrome (push) Canceled after 0s
e2e / e2e-firefox (push) Canceled after 0s

When the background saves a network switch after the user approves a
site's request, an open popup now notices the stored record change and
takes the new network from it, holding the lock, inside a save. It then
leaves the page as a switch in Settings does: the stack is cut, every
screen counts as not yet rendered, and the screen on top is drawn again.
The cut and the redraw are now two functions in the Settings view that
both paths call. A record already on the popup's network, such as its
own Settings switch, changes nothing. The popup never switches the
network itself.

Model: opus-5-5
This commit is contained in:
2026-10-20 21:25:53 +00:00
parent e517219038
commit 7ae7cef2b3
15 changed files with 396 additions and 61 deletions
+4 -1
View File
@@ -446,7 +446,10 @@ describe("switching the network in Settings tells every open tab", () => {
global.chrome.runtime.sendMessage = (msg) => {
bg.send(msg, POPUP);
};
await require("../src/shared/state").loadState();
const { state, loadState } = require("../src/shared/state");
await loadState();
// Set by showView(), which is mocked above.
state.currentView = "settings";
require("../src/popup/views/settings").init({
pageClosed: new AbortController().signal,
});