Files
app__bitwarden-clients/apps
Will Martin b449ac1d25 [PM-44168] Render the popup loading spinner only while loading (#23528) (#23862)
The spinner in the popup page shell is always in the DOM and merely hidden with
tw-invisible. visibility:hidden does not stop a CSS animation, so bwi-spin keeps
running for the life of the popup at ~30 fps on a page that is doing nothing.

Every frame forces a style recalculation across the page. With the Tailwind
:has() variants on each item row that is expensive: the renderer allocates about
8 MB/s, some 500 MB a minute. It is freed again, just not fast enough -- VmData
climbs until it hits the 8 GiB RLIMIT_DATA Chromium applies to renderers, mmap
fails and V8 aborts, leaving a SIGILL core dump of that one renderer while the
browser keeps running.

That is the crash behind #23309, #23431 and #23022. None could be reproduced,
which fits: nothing leaks, the DOM does not grow and the JS heap stays flat, so
a heap snapshot shows nothing. Measured on a local build with the popup open and
untouched, growth went from +500 MB/min to -1.5 MB/min, while
document.getAnimations() reported exactly one running animation -- bwi-spin, on
a bit-icon whose computed visibility was hidden.

Guarding with @if is what every other spinner in the codebase already does. The
overlay is absolutely positioned, so not rendering it costs no layout.



(cherry picked from commit d1d1224ef0)

Co-authored-by: Urias Uhle <101756727+Lolig4@users.noreply.github.com>
Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
2026-10-14 10:08:31 -04:00
..
2026-10-05 08:56:04 -04:00