fix: Back after reopening the popup lands on a blank screen, because goBack() never re-renders #268

Closed
opened 2026-08-12 11:43:39 +02:00 by clawbot · 1 comment
Collaborator

goBack() (src/popup/views/helpers.js:132-143) calls showView(target), which only toggles hidden classes and runs the leave handler. It re-renders nothing. The sole exception is main, via _renderMain().

src/popup/index.js:266-272 renders only renderWalletList() before restoreView(), so on a freshly opened popup every view other than main and the restored one is still the blank static template from src/popup/index.html. Pressing Back onto any of them shows that blank template.

Reproduction, with no secret-bearing view involved:

  1. Address detail, then the settings gear. Stack is ["main", "address"], current view settings.
  2. Close the popup, reopen it. settings restores; the stack is unchanged, correctly.
  3. Press Back (btn-settings-back, src/popup/views/settings.js:423).
  4. showView("address") unhides view-address with address-full empty and address-balances showing  .

Same for address-token, receive, confirm-tx and transaction.

Found by the independent review of #266. Pre-existing and strictly wider than #224, which addresses only views the popup may not reopen ONTO. Filtering the stack — correctly — does not help here, because every view in the reproduction is restorable; the stack is right and the rendering is missing.

No secret leaks: the screens are blank precisely because nothing is restored into them. This is a navigation defect.

Implementation requirements

  • Route a popped view through the same per-view show() and data guards restoreView() already uses, rather than only unhiding it.
  • A popped view whose backing data is absent must fall back the way restoreView() does, not render empty.
  • Do not re-render on every showView() — forward navigation already renders, and doing it twice risks double-fetching or clobbering in-progress state. The fix belongs on the Back path.

Definition of done

  • Pressing Back after reopening the popup renders the target view, for every view reachable that way.
  • A popped view with no backing data falls back rather than showing a blank template.
  • Forward navigation is unchanged and nothing renders twice.
  • Tests cover the reproduction above and at least two of address-token, receive, confirm-tx, transaction, demonstrated failing first.
  • TODO.md updated in the same commit.
  • make check passes.
`goBack()` (`src/popup/views/helpers.js:132-143`) calls `showView(target)`, which only toggles `hidden` classes and runs the leave handler. It re-renders nothing. The sole exception is `main`, via `_renderMain()`. `src/popup/index.js:266-272` renders only `renderWalletList()` before `restoreView()`, so on a freshly opened popup every view other than `main` and the restored one is still the blank static template from `src/popup/index.html`. Pressing Back onto any of them shows that blank template. Reproduction, with no secret-bearing view involved: 1. Address detail, then the settings gear. Stack is `["main", "address"]`, current view `settings`. 2. Close the popup, reopen it. `settings` restores; the stack is unchanged, correctly. 3. Press Back (`btn-settings-back`, `src/popup/views/settings.js:423`). 4. `showView("address")` unhides `view-address` with `address-full` empty and `address-balances` showing ` `. Same for `address-token`, `receive`, `confirm-tx` and `transaction`. Found by the independent review of https://git.eeqj.de/sneak/AutistMask/pulls/266. Pre-existing and strictly wider than https://git.eeqj.de/sneak/AutistMask/issues/224, which addresses only views the popup may not reopen ONTO. Filtering the stack — correctly — does not help here, because every view in the reproduction is restorable; the stack is right and the rendering is missing. No secret leaks: the screens are blank precisely because nothing is restored into them. This is a navigation defect. ## Implementation requirements - Route a popped view through the same per-view `show()` and data guards `restoreView()` already uses, rather than only unhiding it. - A popped view whose backing data is absent must fall back the way `restoreView()` does, not render empty. - Do not re-render on every `showView()` — forward navigation already renders, and doing it twice risks double-fetching or clobbering in-progress state. The fix belongs on the Back path. ## Definition of done - [ ] Pressing Back after reopening the popup renders the target view, for every view reachable that way. - [ ] A popped view with no backing data falls back rather than showing a blank template. - [ ] Forward navigation is unchanged and nothing renders twice. - [ ] Tests cover the reproduction above and at least two of `address-token`, `receive`, `confirm-tx`, `transaction`, demonstrated failing first. - [ ] `TODO.md` updated in the same commit. - [ ] `make check` passes.
clawbot added this to the 1.0.0 milestone 2026-08-12 11:43:49 +02:00
Author
Collaborator

Fixed in #272.

The per-view dispatch and data guards move out of restoreView() into src/popup/viewRouter.js; goBack() routes a popped view through the same renderView() via a renderer index.js registers with setBackRenderer(). A popped view whose backing state is gone falls back to Home as the restore does. Views outside RESTORABLE_VIEWS are declined and still merely unhidden — the restored stack is filtered against that set, so one can only be on the stack from the current page load, where forward navigation rendered it. Forward navigation is untouched.

Verified: both new end-to-end cases demonstrated failing against the unmodified sources — the address line reads "", expected "Wallet 1 — Address 1\n0xD50e..." — then green. make check exit 0 (652 tests, script/test-verify-build 18 cases, prettier clean); make test-e2e exit 0, 29/29.

Fixed in [#272](https://git.eeqj.de/sneak/AutistMask/pulls/272). The per-view dispatch and data guards move out of `restoreView()` into `src/popup/viewRouter.js`; `goBack()` routes a popped view through the same `renderView()` via a renderer `index.js` registers with `setBackRenderer()`. A popped view whose backing state is gone falls back to Home as the restore does. Views outside `RESTORABLE_VIEWS` are declined and still merely unhidden — the restored stack is filtered against that set, so one can only be on the stack from the current page load, where forward navigation rendered it. Forward navigation is untouched. Verified: both new end-to-end cases demonstrated failing against the unmodified sources — `the address line reads "", expected "Wallet 1 — Address 1\n0xD50e..."` — then green. `make check` exit 0 (652 tests, `script/test-verify-build` 18 cases, prettier clean); `make test-e2e` exit 0, 29/29.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: sneak/AutistMask#268