perf(v2): use static background SVG in Firefox to stop GPU repaint#3702
Merged
Conversation
The auth_background.svg fallback contains two infinite CSS animations. As a full-viewport background-image under a 28px blur (and re-sampled by every backdrop-filter surface), Firefox's WebRender re-rasterizes the whole viewport every frame, pegging the renderer/GPU. It is worst on pages that fall back to this art (settings, administration) since they call setBgArt(null); other pages show static cover art. Swap to the existing static variant in Firefox only via the @-moz-document url-prefix() hack (the same pattern v1's Auth.vue already uses). Other browsers keep the animation. The BackgroundArt fallback is moved from an inline style into CSS so the override can take effect. Generated-By: PostHog Code Task-Id: d82d41fa-0db7-477d-bb80-fc512558e076
Contributor
There was a problem hiding this comment.
Pull request overview
This PR mitigates a Firefox-specific performance regression in the v2 UI by avoiding the animated SVG background in Gecko, which can trigger continuous full-viewport re-rasterization under blur/backdrop-filter surfaces (notably on pages that use the fallback auth background art).
Changes:
- Move the v2 “no cover art” fallback background-image from inline styles to CSS so it can be overridden in Firefox.
- Add Firefox-only
@-moz-document url-prefix()overrides to swapauth_background.svg→auth_background_static.svgacross v2 surfaces that use the auth background art. - Adjust
BackgroundArt.vueto only set inlinebackground-imagewhen a real cover URL is present, allowing the CSS fallback (and Firefox override) to apply when unset.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| frontend/src/v2/views/PairShell.vue | Adds Firefox-only CSS override to use the static auth background SVG. |
| frontend/src/v2/views/DevicePairShell.vue | Adds Firefox-only CSS override to use the static auth background SVG. |
| frontend/src/v2/styles/global.css | Defines the fallback background-image in CSS and swaps it to the static SVG in Firefox. |
| frontend/src/v2/layouts/AuthLayout.vue | Adds Firefox-only CSS override to use the static auth background SVG. |
| frontend/src/v2/components/AppShell/BackgroundArt.vue | Removes inline fallback background-image so the CSS fallback/Firefox override can take effect. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Greptile SummaryThis PR switches Firefox v2 background fallback art to a static SVG.
Confidence Score: 5/5This looks safe to merge.
Important Files Changed
Reviews (1): Last reviewed commit: "perf(v2): use static background SVG in F..." | Re-trigger Greptile |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Explain the changes or enhancements you are proposing with this pull request.
In Firefox, loading any v2 page pegged the renderer/GPU (WebRender backend saturated, continuous 80-100% peaks), worst on
/administration.Root cause:
assets/auth_background.svgcontains two infinite CSS animations (leftMove/rightMove,15s ... infinite). Rendered as a full-viewportbackground-imageunder a 28px blur and re-sampled by everybackdrop-filtersurface, Firefox's WebRender re-rasterizes the whole viewport every frame. It is worst on pages that fall back to this art (settings, administration) because they callsetBgArt(null), so both background layers show the animated SVG; other pages show static cover art. The animation never surfaced indocument.getAnimations()because animations inside abackground-imageSVG live in a separate document.Fix: swap to the already-existing static variant (
auth_background_static.svg) in Firefox only, via the@-moz-document url-prefix()hack, the same pattern v1'sAuth.vuealready uses. Every other browser keeps the animation. Applied to all four v2 surfaces that use this art (app background, auth, pair, device-pair). The app background fallback is moved from an inline style into CSS so the Firefox override can take effect; cover art (raster) is unaffected.Verified:
npm run typecheckclean,npm run buildsucceeds and the@-moz-documentblocks survive minification with the static (non-animated) SVG inlined,trunk fmtclean.AI assistance disclosure: This change was investigated and implemented with the assistance of an AI agent (PostHog Code / Claude), including the profiling analysis, root-cause diagnosis, and the code changes, all reviewed by the author.
Checklist
Please check all that apply.
Screenshots (if applicable)
N/A (visual output is unchanged in Chrome/Safari; Firefox shows the static variant of the same artwork).
Created with PostHog Code