fix: flash messages longer than one line wrap and shift the layout, defeating the reserved-space policy #252
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
src/popup/index.html:34-37reservesmin-h-[1.25rem]for#flash-msg— 20px, exactly ONE line attext-xs(12px/16px). Any flash string long enough to wrap renders at 32px and pushes the view below it down 12px, which is precisely what the README No Layout Shift policy exists to prevent.Measured in the repo's own pinned Playwright container at 360x600 against the built popup, during the independent review of #243:
Please enter an RPC URL.(24 chars) → 20px, no shift#view-settingsand#settings-dust-thresholddown 12pxPre-existing, not introduced by that PR: the longest existing flash string — the invalid-xprv message in
src/popup/views/addWallet.js, 70 chars — shifts by the identical 12px today. #243 is shortening its own message to fit rather than waiving the policy, which leaves this repo-wide gap open.The reservation is also unenforced. Nothing in the suite can see wrapping: the only assertion that claims to pin it regex-matches
min-h-\[in the class attribute, which passes at any message length.Implementation requirements
addWallet.jsis known to violate the current one.Definition of done
TODO.mdupdated in the same commit.make checkpasses.Another reserved region with the same unenforced reservation, found while measuring for #172. Adding it here rather than filing separately, since auditing the other regions is already in this issue's scope.
#approve-tx-errorand#approve-sign-error(src/popup/index.html:1512,:1589) carryborder border-dashed p-1on top ofmin-h-[1.25rem]. Underbox-sizing: border-boxthat 20px reservation has to cover 8px of padding and 2px of border, leaving 10px for a 16px line, so any message overflows it — no wrapping required.Measured in the pinned Playwright container at 360x600 against the built popup, on
nextatc6a1f97:This is live today with the existing
"Please enter your password."on an empty field, so it is not specific to any one string. Fix shape differs from the wrapping case: these need the reservation to account for padding and border, not a longer reservation.