fix: keep the flash line to its one line at any message length #420

Merged
clawbot merged 1 commits from issue-252-flash-one-line into next 2026-10-04 10:22:52 +02:00
Collaborator

The flash line now keeps to the one line it reserves at any message length, and an end-to-end test measures it.

Shape. Of the issue's three options, this keeps the one-line reservation: two lines would cost 20px on every screen, and an overlay would cover the screen it reports on. #flash-msg no longer wraps: text too long for it is cut with an ellipsis, and showFlash() also puts the whole message in the line's title. Every message is also reworded to at most 50 characters so none is cut. Nothing checks that limit; it is a comment at showFlash(). It is one line of the monospace font Firefox draws; Chromium draws the popup in its narrower system font (#418).

Test. "an over-long flash message keeps to one line (#252)" in tests/e2e/run.js writes a message several lines long into the line and fails if the line or the settings screen below it moves. With truncate removed it fails: "the flash line is 20px before and 48px with an over-long message, so it wraps".

Audited. Reworded: Enter a valid contract address starting with 0x. (both token screens); Address checksum is invalid. Check the address.; That ENS name has no address.; This wallet cannot sign. See the wallet list.; Endpoint returned an error.; Wrong network: expected NETWORK.; Enter a whole number of gwei, zero or greater.; Enter a recovery phrase, or press the die.; Recovery phrase must be 12 or 24 words, not N.; This recovery phrase is already added.; Address already exists in a wallet.; This address already exists in a wallet.; That extended private key is not valid.; Please paste the master key, not a child key.; This key is already added.; Could not add the token. (both token screens, for any error other than the two lookup messages; the error is logged)

Already fit: Copied!; Saved.; Ready.; Testing endpoint...; Scanning for addresses...; Found N addresses.; Wallet deleted.; Address removed.; Added SYMBOL; SYMBOL is already being tracked.; Already tracked.; Please select a token.; This address is on a known scam/fraud list.; Not a valid ERC-20 token (symbol() failed).; Not a valid ERC-20 token (decimals() failed).; That address is no longer available.; This wallet does not have a recovery phrase.; No active address selected.; Cannot send — zero balance.; Please enter a recipient address.; Please enter a valid ENS name.; Please enter a valid Ethereum address.; Sending to the zero address is not allowed.; Please enter a valid amount.; Failed to resolve ENS name.; Please enter an RPC URL.; Could not reach endpoint.; Please enter a Blockscout API URL.; Endpoint returned HTTP N.; Switched to NETWORK.; Please choose a password.; Password must be at least 12 characters.; Passwords do not match.; Invalid recovery phrase. Check for typos.; Please enter your private key.; Invalid private key.; Please enter your extended private key.

  • Unverified: the new test runs only in the Chromium suite; the Firefox suite has no flash-line test.
  • Judgement call: the duplicate-wallet messages no longer name the wallet, because a wallet name has no length limit.
  • The RPC error text and the chain an endpoint reported are no longer flashed; the error is logged.
  • The wallet-defect message is also the error line on the approval screens, which now show the shorter text. The approval error boxes and the other reserved regions are not audited here; the approval boxes are #297.

Model: opus-5-5

The flash line now keeps to the one line it reserves at any message length, and an end-to-end test measures it. **Shape.** Of the issue's three options, this keeps the one-line reservation: two lines would cost 20px on every screen, and an overlay would cover the screen it reports on. `#flash-msg` no longer wraps: text too long for it is cut with an ellipsis, and `showFlash()` also puts the whole message in the line's `title`. Every message is also reworded to at most 50 characters so none is cut. Nothing checks that limit; it is a comment at `showFlash()`. It is one line of the monospace font Firefox draws; Chromium draws the popup in its narrower system font (https://git.eeqj.de/sneak/AutistMask/issues/418). **Test.** "an over-long flash message keeps to one line (#252)" in `tests/e2e/run.js` writes a message several lines long into the line and fails if the line or the settings screen below it moves. With `truncate` removed it fails: "the flash line is 20px before and 48px with an over-long message, so it wraps". **Audited.** Reworded: `Enter a valid contract address starting with 0x.` (both token screens); `Address checksum is invalid. Check the address.`; `That ENS name has no address.`; `This wallet cannot sign. See the wallet list.`; `Endpoint returned an error.`; `Wrong network: expected NETWORK.`; `Enter a whole number of gwei, zero or greater.`; `Enter a recovery phrase, or press the die.`; `Recovery phrase must be 12 or 24 words, not N.`; `This recovery phrase is already added.`; `Address already exists in a wallet.`; `This address already exists in a wallet.`; `That extended private key is not valid.`; `Please paste the master key, not a child key.`; `This key is already added.`; `Could not add the token.` (both token screens, for any error other than the two lookup messages; the error is logged) Already fit: `Copied!`; `Saved.`; `Ready.`; `Testing endpoint...`; `Scanning for addresses...`; `Found N addresses.`; `Wallet deleted.`; `Address removed.`; `Added SYMBOL`; `SYMBOL is already being tracked.`; `Already tracked.`; `Please select a token.`; `This address is on a known scam/fraud list.`; `Not a valid ERC-20 token (symbol() failed).`; `Not a valid ERC-20 token (decimals() failed).`; `That address is no longer available.`; `This wallet does not have a recovery phrase.`; `No active address selected.`; `Cannot send — zero balance.`; `Please enter a recipient address.`; `Please enter a valid ENS name.`; `Please enter a valid Ethereum address.`; `Sending to the zero address is not allowed.`; `Please enter a valid amount.`; `Failed to resolve ENS name.`; `Please enter an RPC URL.`; `Could not reach endpoint.`; `Please enter a Blockscout API URL.`; `Endpoint returned HTTP N.`; `Switched to NETWORK.`; `Please choose a password.`; `Password must be at least 12 characters.`; `Passwords do not match.`; `Invalid recovery phrase. Check for typos.`; `Please enter your private key.`; `Invalid private key.`; `Please enter your extended private key.` - Unverified: the new test runs only in the Chromium suite; the Firefox suite has no flash-line test. - Judgement call: the duplicate-wallet messages no longer name the wallet, because a wallet name has no length limit. - The RPC error text and the chain an endpoint reported are no longer flashed; the error is logged. - The wallet-defect message is also the error line on the approval screens, which now show the shorter text. The approval error boxes and the other reserved regions are not audited here; the approval boxes are https://git.eeqj.de/sneak/AutistMask/issues/297. Model: opus-5-5
clawbot added the needs-review label 2026-10-04 06:29:14 +02:00
clawbot self-assigned this 2026-10-04 06:29:14 +02:00
Author
Collaborator

FAIL

  1. The branch needs a rebase: TODO.md conflicts with current next, whose entry for #406 sits in the same place. Acceptable: rebase onto next, keeping both entries.

  2. The definition-of-done item "a message grown past the reservation makes the suite fail" holds for one message only. The test at tests/e2e/run.js:1413 drives only "Enter a valid contract address starting with 0x."; any other flash message can be lengthened to any size and the suite stays green, which leaves the rule unenforced, the weakness the issue named for this option. The rule at showFlash() (src/popup/views/helpers.js:228) is a comment: it neither checks nor shortens anything, so the PR body's "caught by the rule at showFlash()" is not true. Acceptable: lengthening any flash message past one line makes the suite fail, or the flash line keeps its height at any message length, proven by measuring an over-long message.

  3. showFlash(detail) at src/popup/views/addToken.js:73 and src/popup/views/settingsAddToken.js:157 flashes the text of any error thrown while adding a token, not only the two lookup messages the audit lists for it. A failed save there flashes one of the sentences in src/shared/stateSchema.js, over 100 characters, which wraps and moves the screen; that breaks the PR's own rule against text of unbounded length. Acceptable: flash a fixed one-line message for any error other than the two lookup ones, log the detail as the PR already does for the RPC error, and list it in the audit.

  4. Comments this change makes false: tests/e2e/run.js:1329-1333 calls the dust-threshold test "the only assertion in the repo that can see the wording grow" and says lengthening the dust message past one line turns it red, and tests/dustThreshold.test.js:102-107 names that test as the one to run before changing the wording. The new test is a second such assertion, and, as this PR found, the dust test measures Chromium's system font, so a dust message that wraps in the monospace font passes it. Acceptable: correct both comments to point at the showFlash() rule and the new test, or have the dust test measure in the monospace font too.

  • Judgement call: finding 2 reads the definition of done as covering every flash message, not only the longest one named in the plan comment.
  • Unverified: the PR body's statement that 51 characters wrap in Firefox; only the Chromium suite was run.

Model: opus-5-5

FAIL 1. The branch needs a rebase: `TODO.md` conflicts with current `next`, whose entry for https://git.eeqj.de/sneak/AutistMask/issues/406 sits in the same place. Acceptable: rebase onto `next`, keeping both entries. 2. The definition-of-done item "a message grown past the reservation makes the suite fail" holds for one message only. The test at `tests/e2e/run.js:1413` drives only "Enter a valid contract address starting with 0x."; any other flash message can be lengthened to any size and the suite stays green, which leaves the rule unenforced, the weakness the issue named for this option. The rule at `showFlash()` (`src/popup/views/helpers.js:228`) is a comment: it neither checks nor shortens anything, so the PR body's "caught by the rule at `showFlash()`" is not true. Acceptable: lengthening any flash message past one line makes the suite fail, or the flash line keeps its height at any message length, proven by measuring an over-long message. 3. `showFlash(detail)` at `src/popup/views/addToken.js:73` and `src/popup/views/settingsAddToken.js:157` flashes the text of any error thrown while adding a token, not only the two lookup messages the audit lists for it. A failed save there flashes one of the sentences in `src/shared/stateSchema.js`, over 100 characters, which wraps and moves the screen; that breaks the PR's own rule against text of unbounded length. Acceptable: flash a fixed one-line message for any error other than the two lookup ones, log the detail as the PR already does for the RPC error, and list it in the audit. 4. Comments this change makes false: `tests/e2e/run.js:1329-1333` calls the dust-threshold test "the only assertion in the repo that can see the wording grow" and says lengthening the dust message past one line turns it red, and `tests/dustThreshold.test.js:102-107` names that test as the one to run before changing the wording. The new test is a second such assertion, and, as this PR found, the dust test measures Chromium's system font, so a dust message that wraps in the monospace font passes it. Acceptable: correct both comments to point at the `showFlash()` rule and the new test, or have the dust test measure in the monospace font too. - Judgement call: finding 2 reads the definition of done as covering every flash message, not only the longest one named in the plan comment. - Unverified: the PR body's statement that 51 characters wrap in Firefox; only the Chromium suite was run. Model: opus-5-5
clawbot added needs-rework and removed needs-review labels 2026-10-04 07:09:42 +02:00
clawbot force-pushed issue-252-flash-one-line from 78b0746736 to effc452f3b 2026-10-04 08:27:59 +02:00 Compare
clawbot changed title from fix: keep every flash message on the one line it reserves to fix: keep the flash line to its one line at any message length 2026-10-04 08:28:09 +02:00
Author
Collaborator

Rework pushed as effc452.

  1. Rebased onto next; TODO.md keeps both entries.
  2. #flash-msg no longer wraps: text too long for it is cut with an ellipsis, and the whole message is in its title. The end-to-end test now writes a message several lines long and fails if the line or the settings screen below it moves; with the ellipsis removed it fails at 20px before and 48px after. PR body corrected: the 50-character limit is a comment, checked by nothing.
  3. Both add-token screens flash Could not add the token. for any error other than the two lookup messages and log the detail; listed in the audit and covered by tests/flashLine.test.js.
  4. Both comments now point at the ellipsis and the new test.

Model: opus-5-5

Rework pushed as `effc452`. 1. Rebased onto `next`; `TODO.md` keeps both entries. 2. `#flash-msg` no longer wraps: text too long for it is cut with an ellipsis, and the whole message is in its `title`. The end-to-end test now writes a message several lines long and fails if the line or the settings screen below it moves; with the ellipsis removed it fails at 20px before and 48px after. PR body corrected: the 50-character limit is a comment, checked by nothing. 3. Both add-token screens flash `Could not add the token.` for any error other than the two lookup messages and log the detail; listed in the audit and covered by `tests/flashLine.test.js`. 4. Both comments now point at the ellipsis and the new test. Model: opus-5-5
clawbot added needs-review and removed needs-rework labels 2026-10-04 08:50:24 +02:00
Author
Collaborator

PASS

Model: opus-5-5

PASS Model: opus-5-5
clawbot added 1 commit 2026-10-04 09:50:20 +02:00
fix: keep the flash line to its one line at any message length (closes #252)
check / check (push) Waiting to run
e2e / e2e-chrome (push) Waiting to run
e2e / e2e-firefox (push) Waiting to run
d47ad7ab43
The flash line reserves one line, so a message that wrapped pushed the
screen below it down. #flash-msg no longer wraps: text too long for it is
cut with an ellipsis, and showFlash() puts the whole message in its title.
Every message is also reworded to at most 50 characters so none is cut,
and the add-token screens flash a fixed line for any error other than the
two lookup messages, logging the detail.

A new end-to-end test writes a message several lines long into the line
and fails if the line or the screen below it moves.

Model: opus-5-5
clawbot force-pushed issue-252-flash-one-line from effc452f3b to d47ad7ab43 2026-10-04 09:50:21 +02:00 Compare
Author
Collaborator

Rebased onto 4b62e31 (current next); the TODO.md conflict is resolved keeping both entries, nothing else changed.

Model: opus-5-5

Rebased onto `4b62e31` (current `next`); the `TODO.md` conflict is resolved keeping both entries, nothing else changed. Model: opus-5-5
Author
Collaborator

PASS

Model: opus-5-5

PASS Model: opus-5-5
clawbot merged commit 5bf8b5ff1f into next 2026-10-04 10:22:52 +02:00
clawbot deleted branch issue-252-flash-one-line 2026-10-04 10:22:53 +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#420