An open popup keeps showing the previous network after the background saves a switch #650

Closed
opened 2026-10-20 21:24:50 +02:00 by clawbot · 2 comments
Collaborator

Seen by the worker on #648.

Where

The popup's live state, src/popup/index.js and src/shared/state.js. The popup loads the stored record when it opens and does not follow changes another page or the background makes to it afterwards.

What happens

With the popup open, the user approves a site's request to switch the network in the approval window, and the background saves the new network. The open popup still shows the previous network: its title bar, the testnet banner, its balances and its tokens. After #648 its balance refreshes are all dropped, so those balances also stop updating, until the popup is closed and opened again.

What should happen

The popup shows the active network. When the stored network changes while the popup is open, the popup takes the new network and draws the screen it is on for it, as a switch made in Settings does.

Severity: minor

Definition of done

  • An open popup follows a network switch saved by the background, showing the new network and its balances.
  • A test with the popup open while the background switches the network, failing on next.

Model: opus-5-5

Seen by the worker on https://git.eeqj.de/sneak/AutistMask/pulls/648. ## Where The popup's live state, `src/popup/index.js` and `src/shared/state.js`. The popup loads the stored record when it opens and does not follow changes another page or the background makes to it afterwards. ## What happens With the popup open, the user approves a site's request to switch the network in the approval window, and the background saves the new network. The open popup still shows the previous network: its title bar, the testnet banner, its balances and its tokens. After https://git.eeqj.de/sneak/AutistMask/pulls/648 its balance refreshes are all dropped, so those balances also stop updating, until the popup is closed and opened again. ## What should happen The popup shows the active network. When the stored network changes while the popup is open, the popup takes the new network and draws the screen it is on for it, as a switch made in Settings does. Severity: minor ## Definition of done - [ ] An open popup follows a network switch saved by the background, showing the new network and its balances. - [ ] A test with the popup open while the background switches the network, failing on `next`. Model: opus-5-5
clawbot self-assigned this 2026-10-20 21:24:50 +02:00
Author
Collaborator

Plan: one PR to next. The popup notices when the stored network changes and it did not change it (the browser's storage change event for the record, comparing its networkId with the popup's own), and then takes the new network as a switch in Settings would leave the page: its live state takes the new network's fields from the stored record, the stack is cut as the Settings handler cuts it, every screen counts as not yet rendered, and the screen on top is drawn again for the new network, banner included. The Settings handler's steps after onChainSwitch() become one function in src/popup/views/settings.js (or the router) that both call, so the two cannot drift. A Jest test with the popup open on AddressDetail while the background saves a switch, failing on next.

Model: opus-5-5

Plan: one PR to `next`. The popup notices when the stored network changes and it did not change it (the browser's storage change event for the record, comparing its `networkId` with the popup's own), and then takes the new network as a switch in Settings would leave the page: its live state takes the new network's fields from the stored record, the stack is cut as the Settings handler cuts it, every screen counts as not yet rendered, and the screen on top is drawn again for the new network, banner included. The Settings handler's steps after `onChainSwitch()` become one function in `src/popup/views/settings.js` (or the router) that both call, so the two cannot drift. A Jest test with the popup open on AddressDetail while the background saves a switch, failing on `next`. Model: opus-5-5
Author
Collaborator

Built in #654. An open popup now takes a network switch that the background, or another popup page, saved, from the stored record, and draws the screen it is on for the new network. The switch in Settings and this one share the same stack cut and redraw.

Model: opus-5-5

Built in https://git.eeqj.de/sneak/AutistMask/pulls/654. An open popup now takes a network switch that the background, or another popup page, saved, from the stored record, and draws the screen it is on for the new network. The switch in Settings and this one share the same stack cut and redraw. Model: opus-5-5
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: sneak/AutistMask#650