fix: show every password error in its own fixed-height line (closes #493)
The add wallet screen reported a missing, short or mismatched password in the flash line at the top of the popup, and the private key export, recovery phrase and delete wallet screens each wrote to a line of their own above the password field. All four now use showError() and hideError() with a fixed-height error line below the field, as the send confirmation and approval screens do. On the add wallet screen the line sits beside the Import button, which keeps its place at 360x600. The line clears when the screen is shown again and when the password is tried again. Other add wallet messages stay in the flash line. Model: opus-5-5
This commit was merged in pull request #496.
This commit is contained in:
@@ -207,7 +207,7 @@ describe("a decrypt still running when the screen is left", () => {
|
||||
});
|
||||
|
||||
// Same hole on the failure path: a wrong-password error written after
|
||||
// the wipe would restore the flash line on a screen the user has left.
|
||||
// the wipe would restore the error line on a screen the user has left.
|
||||
test("never writes the failure message either", async () => {
|
||||
const { helpers, vault, exportPrivkey } = load();
|
||||
exportPrivkey.show(0, 0);
|
||||
@@ -217,8 +217,10 @@ describe("a decrypt still running when the screen is left", () => {
|
||||
reveal.reject(new Error("decryption failed"));
|
||||
await reveal.pending;
|
||||
|
||||
expect(node("export-privkey-flash").textContent).toBe("");
|
||||
expect(node("export-privkey-flash").style.visibility).toBe("hidden");
|
||||
expect(node("export-privkey-password-error").textContent).toBe("");
|
||||
expect(node("export-privkey-password-error").style.visibility).toBe(
|
||||
"hidden",
|
||||
);
|
||||
});
|
||||
});
|
||||
|
||||
@@ -260,7 +262,7 @@ describe("a reveal that is not interrupted", () => {
|
||||
await reveal.pending;
|
||||
|
||||
expect(node("export-privkey-value").textContent).toBe("");
|
||||
expect(node("export-privkey-flash").textContent).toBe(
|
||||
expect(node("export-privkey-password-error").textContent).toBe(
|
||||
"That password is incorrect. Please try again.",
|
||||
);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user