fix: the private key export screen opens again in the same popup session #478

Merged
clawbot merged 1 commits from issue-460-export-privkey-reopen into next 2026-10-06 19:43:08 +02:00
Collaborator

Fixes #460.

show() in src/popup/views/exportPrivkey.js found the address line as the parent of #export-privkey-dot, then replaced the line's contents with renderAddressHtml(), which deleted #export-privkey-dot. The next open in the same popup session threw before it navigated.

The address line's div in src/popup/index.html now carries the export-privkey-address id itself, and show() looks it up by that id. That id used to sit on a placeholder span inside the line; both placeholder spans are gone, since the first open always replaced them.

Other views that call renderAddressHtml(): none finds its container through a child, so no other view changed.

Tests:

  • tests/exportPrivkey.test.js: the DOM stub now takes an element out of the document when its parent's contents are replaced, as a browser does. A new test opens the screen, goes Back, and opens it for another address. Against current next it fails with the error from the issue, and so does the existing "never writes it after the screen is re-entered" test, which already opened the screen twice but was hidden by the old stub.
  • tests/e2e/run.js: the #253 case "leaving while the decrypt is in flight reveals no private key" no longer reopens the popup before its second open.

The Back-stack behaviour of #461 is untouched.

Model: opus-5-5

Fixes https://git.eeqj.de/sneak/AutistMask/issues/460. `show()` in `src/popup/views/exportPrivkey.js` found the address line as the parent of `#export-privkey-dot`, then replaced the line's contents with `renderAddressHtml()`, which deleted `#export-privkey-dot`. The next open in the same popup session threw before it navigated. The address line's `div` in `src/popup/index.html` now carries the `export-privkey-address` id itself, and `show()` looks it up by that id. That id used to sit on a placeholder span inside the line; both placeholder spans are gone, since the first open always replaced them. Other views that call `renderAddressHtml()`: none finds its container through a child, so no other view changed. Tests: - `tests/exportPrivkey.test.js`: the DOM stub now takes an element out of the document when its parent's contents are replaced, as a browser does. A new test opens the screen, goes Back, and opens it for another address. Against current `next` it fails with the error from the issue, and so does the existing "never writes it after the screen is re-entered" test, which already opened the screen twice but was hidden by the old stub. - `tests/e2e/run.js`: the `#253` case "leaving while the decrypt is in flight reveals no private key" no longer reopens the popup before its second open. The Back-stack behaviour of https://git.eeqj.de/sneak/AutistMask/issues/461 is untouched. Model: opus-5-5
clawbot added the needs-review label 2026-10-06 17:31:52 +02:00
clawbot self-assigned this 2026-10-06 17:31:52 +02:00
clawbot added 1 commit 2026-10-06 17:31:52 +02:00
fix: the private key export screen opens again in the same session (closes #460)
check / check (push) Waiting to run
e2e / e2e-chrome (push) Waiting to run
e2e / e2e-firefox (push) Waiting to run
64a9850d97
show() found the address line through the element inside it, then
replaced the line's contents with renderAddressHtml(), which deleted
that element, so the next show() in the same popup session threw
before it navigated. The line now carries the export-privkey-address
id itself and is looked up by it. No other view that renders an
address finds its container through a child.

The jest DOM stub now takes an element out of the document when its
parent's contents are replaced, and a new test opens the screen
twice. The #253 e2e case no longer reopens the popup before its
second open.

Model: opus-5-5
Author
Collaborator

PASS

Model: opus-5-5

PASS Model: opus-5-5
clawbot merged commit cb23611a17 into next 2026-10-06 19:43:08 +02:00
clawbot deleted branch issue-460-export-privkey-reopen 2026-10-06 19:43:09 +02:00
Sign in to join this conversation.
No Reviewers
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: sneak/AutistMask#478