fix: the two dApp approval error containers shift 6px when an error appears #297
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?
Problem
#approve-tx-errorand#approve-sign-errorinsrc/popup/index.htmlreservemin-h-[1.25rem](20px) but are the only two error containers that also carryborder border-dashed p-1. With the Tailwind preflight'sbox-sizing: border-box, the reserved 20px is consumed by 2px of border plus8px of padding, leaving 10px of content box for a 16px line. Showing any error
grows the container to 26px and pushes the button row below it down by 6px.
The other four password error containers (
#export-privkey-flash,#show-phrase-flash,#delete-wallet-flash,#confirm-tx-password-error) haveno border and no padding, so 20px fits a 16px line exactly and they hold still.
RULES.mdNo Layout Shift requires that no UI element move when the reservedarea is filled.
Measurement
Built popup at a 360x600 viewport in the pinned Playwright container
(
mcr.microsoft.com/playwright@sha256:35246d87..., the digestscript/test-e2epins), one view visible at a time. Container height and the
topof the elementdirectly below it:
Independent of which sentence is shown — the same 6px for every string
measured, including the one those screens display on
nexttoday.Found
While discharging the layout requirement of
#265, which measured all six
password error containers. Out of scope there (strings only) and not touched by
it: the shift predates that change and is unaffected by it.
Implementation requirements
min-h-[1.875rem](30px = 16px line + 8px padding + 2px border + the 4px theplain containers spare) is the arithmetic; measure rather than trust it.
Definition of done
#approve-tx-errorand#approve-sign-errorkeep the same height emptyand filled, and nothing below them moves.
and after.
at zero shift.
TODO.mdupdated in the same commit.make checkpasses.