claude-code icon indicating copy to clipboard operation
claude-code copied to clipboard

[BUG] Desktop Code tab: a mod's theme backdrop never animates (Svg scene drawn as a still picture; Client and APNG image grounds draw nothing)

Open lssc-maker opened this issue 2 weeks ago • 6 comments

Summary

A mod that sets a theme backdrop with $.theme.set({ backdrop: { scene } }) and draws it at the Backdrop render site gets a still picture on the desktop app. Animation inside the Svg (CSS keyframes or SMIL) never plays. The types and the plugin-authoring skill describe this as a "live scene" and say to "animate with CSS inside its own <style>".

The same SVG markup does animate when drawn in an AbovePrompt band. The other backdrop routes fail too: a Client in the backdrop draws nothing, and an animated PNG used as an image ground draws nothing (the app's plain ground shows).

Environment

  • Claude desktop app 5.11492.5, Code tab, macOS 27.0 (Apple silicon)
  • Claude Code 2.1.325 in the session (mod hot-reloaded from the session's mods folder)
  • System "Reduce motion" is off.

Expected

The Backdrop scene animates behind the conversation, as the docs describe ("A scene is the one thing in a look that moves").

Actual

Backdrop drawn as Result on desktop
<Svg isInteractive> with CSS @keyframes in <style> Still. Every frame's element shows at once, as if <style> were ignored.
<Svg isInteractive> with SMIL (<animate>, <animateTransform>) Still. Shows the first-moment attributes; nothing moves.
Same SMIL with an explicit width/height on the <svg> Still.
<Svg> without isInteractive, SMIL begin set from the wall clock, identical source between renders (the workarounds from #99211 / #100797) Still.
Redrawing the backdrop from a timer ($.state write every 250 ms) The whole window flashes on every redraw. This is a photosensitivity / seizure risk; a mod author can trigger it by accident.
<Client> (a surface module drawing Box/Text cells) as the backdrop Nothing drawn; the plain app ground shows.
Image ground { image: { source: 'art/valley-night.png' } }, an APNG under 1 MiB Nothing drawn; the plain app ground shows. claude plugin test also refuses this theme.set with id is 1 to 64 of letters, digits, _ or - (host check), even for a root-level path.

For comparison, the same SMIL SVG returned from a ui.render hook on AbovePrompt (<Svg source={svg} isInteractive />) animates correctly in the band.

Minimal repro

hooks/register.tsx (with the usual plugin.json and hooks.json):

import type { Register } from 'claude-code'

const SVG =
  '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 160 100" preserveAspectRatio="xMidYMid slice">' +
  '<style>.spin{transform-box:view-box;transform-origin:120px 50px;animation:spin 4s linear infinite}' +
  '@keyframes spin{to{transform:rotate(360deg)}}</style>' +
  '<rect width="160" height="100" fill="#203040"/>' +
  // SMIL: a dot that moves left and right
  '<circle cx="20" cy="50" r="8" fill="#f2c234"><animate attributeName="cx" values="20;80;20" dur="3s" repeatCount="indefinite"/></circle>' +
  // CSS: a rotating square
  '<rect class="spin" x="110" y="40" width="20" height="20" fill="#7fb069"/>' +
  '</svg>'

export const register: Register = on => {
  on('session.start', async ($, e, next) => {
    await $.theme.set({ backdrop: { scene: 'repro', glass: { blur: 0, opacity: 0.5 } } })
    return next(e)
  })

  on('ui.render', { component: 'Backdrop' }, ($, e, next) => {
    if (e.surface !== 'desktop' && e.surface !== 'mobile') return next(e)
    const { Svg } = $.ui.resolve(e)
    return <Svg source={SVG} alt="repro" isInteractive />
  })

  // The same SVG in the band animates, for comparison
  on('ui.render', { component: 'AbovePrompt' }, ($, e, next) => {
    if (e.surface !== 'desktop') return next(e)
    const { Svg } = $.ui.resolve(e)
    return <Svg source={SVG} alt="repro band" isInteractive />
  })
}

Load it in a desktop Code tab session. The band's dot and square move; the backdrop's do not.

Related

  • #99211: the desktop rebuilds every mod render site on any state change, restarting SVG animations
  • #100797: an unchanged mod Svg is rebuilt on every AbovePrompt re-render (blank frame, SMIL restarts)

Those explain restarts and blank frames in the band. In the backdrop, the animation doesn't even start, and the workarounds from those threads (plain image, clock-phased begin, identical source) don't help. That suggests the backdrop is rasterized once to a still bitmap.

Asks

  1. Play CSS / SMIL animation in a Backdrop Svg, as the docs describe, or document that backdrops are still on desktop.
  2. Never redraw the backdrop as a full-window blank-then-paint, so a mod can't make the window flash.
  3. Either draw a Client and image grounds in the backdrop or refuse them with a clear reason; right now they fail silently to a blank ground.

lssc-maker avatar Nov 14 '26 03:11 lssc-maker

Same here on macOS, Claude desktop 5.11492.5, Claude Code 2.1.325, Reduce motion off. My scenes use no @media rules and no shape-rendering (so it's broader than #109770), and they draw as still pictures. A tiny test scene with one SMIL <animate> (repeatCount="indefinite") plays for a moment when it first appears, then freezes. The same SVGs animate continuously in Chrome. Public repro: https://github.com/cvdvs/claude-themes

cvdvs avatar Nov 14 '26 11:11 cvdvs

Same symptom here on Windows, and I found what decides it on my machine: how the mod is loaded, not what the scene contains.

Setup: Windows 11 (build 26300), Claude desktop 5.11492.5 (MSIX), Claude Code 2.1.325, laptop with Intel UHD + NVIDIA RTX 4070. Claude Settings → Motion: System. Windows animation effects on.

What I see

  • A mod loaded from a folder draws its Backdrop scene (<Svg isInteractive> from a ui.render hook) as a still picture, or lets it run for a few seconds and then freezes it. That covers both ways I tried: the session's mods folder (hot reload) and CLAUDE_CODE_PLUGIN_DIRS in ~/.claude/settings.json.
  • The same mod, unchanged, installed at user scope animates continuously, including through the end of a turn.

Workaround

Make the mod folder its own marketplace and install from it:

// <mod folder>/.claude-plugin/marketplace.json
{ "name": "my-local", "owner": { "name": "me" }, "plugins": [{ "name": "<mod name>", "source": "./" }] }
claude plugin marketplace add <mod folder>
claude plugin install <mod name>@my-local

Remove any CLAUDE_CODE_PLUGIN_DIRS entry for the same folder, open a new session, and send a first message.

Evidence that scene content is not the cause

I copied the Night Reef scene from the installed theme-examples plugin into a folder-loaded test mod and returned it from that mod's own Backdrop hook:

Source returned by the folder-loaded mod Result
Night Reef, byte for byte keeps animating
Night Reef with one extra line break before </svg> runs a few seconds, then freezes
Night Reef with an empty <g/> appended runs a few seconds, then freezes
Night Reef with one <text> or one small <rect> appended runs a few seconds, then freezes

The byte-identical case had just been drawn by the installed theme-examples plugin in the same session, so it may be the "unchanged source is not redrawn" behaviour from #110150 keeping the already-live drawing, rather than a fresh draw that survived. Changing the glass settings made no difference in any case.

Meanwhile the installed theme-examples plugin animates scenes it has never drawn before in that session (for example its fireworks overlay).

One more observation

In a session that had both the installed copy and a folder-loaded copy of the same mod, the scene was animating, then froze the moment a turn ended. That turn had edited a file in the folder-loaded copy, so it hot-reloaded and re-ran session.start → $.theme.set. Removing the folder-loaded copy brought the animation back at the next turn end.

The #109770 triggers are separate, and still apply once installed

With the mod installed and its plain scene animating, I switched the same session between four builds of the scene:

Build Result
no shape-rendering, only the prefers-reduced-motion @media rule animates
shape-rendering="crispEdges" on the root <svg> still
@media (prefers-color-scheme:light) and @media (max-aspect-ratio:3/4) rules added still
both still

So there are two independent causes: folder-loaded mods are stilled whatever the scene contains, and an installed mod is stilled by shape-rendering or by any @media rule other than prefers-reduced-motion.

colvinb-laf avatar Nov 15 '26 13:11 colvinb-laf

Additional data point: Linux / KDE Wayland, the animation depends on display resolution (works at 1920×1080, stops at 2560×1440 and 3840×2160)

I can reproduce a related symptom on Linux, with measurements at four resolutions on the same machine and the same mod.

Environment

  • Claude Desktop 5.11492.5 (official apt package), Claude Code 2.1.325
  • Kubuntu/KDE Plasma, Wayland session
  • Intel Meteor Lake iGPU, Mesa 26.0.8 (glxinfo: direct rendering and accelerated). The app's GPU process is running (--gpu-recent-crash-count=0), so this is not a software-rendering fallback.
  • Two 3840×2160 monitors at 145% scale, plus the laptop panel at 1920×1200, 100%.

The mod

  • $.theme.set({ backdrop: { scene, glass: { blur: 0, ... } } }) at session.start (and again on session.attach), drawn with <Svg source isInteractive /> on Backdrop.
  • One SVG of about 100 KB, viewBox with preserveAspectRatio="slice", CSS @keyframes only: no filters, no @media, no CSS variables, no script.
  • Installed at user scope through a local marketplace, as suggested in this ticket.

Behaviour

  • The animation plays for a while, then stops. The UI stays fully responsive; only the backdrop motion stops.
  • Switching conversation redraws it and it resumes briefly (the cycle phase is derived from the clock), then stops again.

Measurements (screenshots of the active window every 6–8 s; share of pixels that changed between consecutive shots, in three regions of the animated scene)

Display mode Result
1920×1200 laptop panel, scale 1 animates normally
1920×1080, scale 1 continuous change over 40 s (about 1–7 % per interval)
2560×1440, scale 1 changes for the first ~16 s (about 4 %), then 0.00 % and stays frozen
3840×2160, scale 1 and 1.45 frozen (0.00 % across about 20 s)

So fractional scaling is not the cause by itself: the same freeze happens at 100 %. The only variable that separated working from frozen was the number of pixels.

What did not help

  • Reducing the scene to its minimum (only the main character animation, everything decorative static): still freezes at 3840×2160.
  • Removing every SVG filter, large radial gradient and full-window animated layer.
  • Forcing a redraw every 4 s with $.ui.invalidate('ui.render') (with the phase kept aligned to the clock): no change.
  • Renderer memory does not grow during the freezes.
  • I could not test --ozone-platform=x11: the main window never opened.

One more observation In a session whose status showed isDrawn: false at session.start (no attached client yet), the backdrop was displayed but static.

Questions

  1. Is there a pixel or time budget after which the app stops a backdrop's motion? It seems to sit between 1920×1080 and 2560×1440 here.
  2. Could the mod be told the real pixel size of the window? viewport only gives columns and rows, so a mod cannot lighten its scene on large displays.

Possibly related: #99211, #100797, #109770, #110095.

BgressSin avatar Nov 17 '26 10:11 BgressSin

Another data point: Windows 11, 4K display at 150 %, user-scope install, backdrop still frozen

This matches the resolution pattern in the previous comment.

Environment

  • Windows 11 Pro, build 26300
  • Claude desktop 5.11492.5 (MSIX), Claude Code 2.1.325
  • Display: one 3840×2160 monitor at 150 % scale (2560×1440 logical), 164 Hz
  • GPU: NVIDIA GeForce RTX 5070 Ti (plus AMD integrated graphics)
  • Windows transparency effects on, animation effects on

The mod

  • $.theme.set({ backdrop: { scene } }) and an <Svg isInteractive> scene on Backdrop (five layers since our last version).
  • No shape-rendering, no @media except prefers-reduced-motion, no raster images, no timed redraws. $.theme.set is called again only when the accent color changes.
  • Installed at user scope through a local marketplace (claude plugin install <mod>@<local-marketplace>), not loaded from a folder. The folder load was removed from settings.

Behaviour

  • The scene draws, but it does not animate. The same SVG animates continuously in Chrome.
  • Removing shape-rendering and moving from the folder load to the user-scope install did not make it animate on this display.

Measurement PrintWindow on the Claude window (2575×1407), 6 frames at 500 ms. The last frame pair had 69 changed pixels. The earlier pairs changed a lot, but the transcript was streaming during the capture, so they do not isolate the backdrop. I will add a clean measurement with an idle transcript if useful.

So on this machine the display size is the remaining variable that fits. A fix or a documented pixel budget would help, and so would giving mods the real pixel size of the window, as asked above.

ratboygs-netizen avatar Nov 17 '26 19:11 ratboygs-netizen

Same freeze here on Windows, and it seems to scale with how heavy the scene is, not with how much of it moves.

Environment: Claude desktop 5.11492.5 (Microsoft Store build), Claude Code 2.1.325, Windows 11 Pro 26200, Intel Iris Xe, 2560×1600 @ 60 Hz. A Parsec Virtual Display Adapter is also installed (unused).

Scene: a mod's Backdrop, <Svg isInteractive>, about 100 KB, viewBox 1600×1000: a sky gradient, dozens of large translucent circles (fill-opacity: 0.1), branch paths, 1,079 small flower shapes with radial-gradient fills, and 24 falling petals animated with CSS @keyframes (transform + opacity, infinite).

Result: it animates for a few seconds after load, then becomes a still picture. Each test below was left untouched for several minutes in a fresh window.

Variant Result
theme-examples koi-mosaic, same window and screen keeps animating
our scene without flowers (branches + petals only) keeps animating
full scene moves, then freezes
642 flowers instead of 1,079 freezes
flowers as plain <circle r> (no CSS d: path()) freezes
flowers as 5-point polygons freezes
flat fills instead of gradients freezes
all flowers kept, only 3 petals animating freezes
petals stepped at 6 fps, all in sync freezes
glass clear vs. the koi recipe (blur 12, opacity 0.36) freezes both ways
loaded from a plugin folder vs. installed from a local marketplace freezes both ways

So the install-at-user-scope workaround above didn't help here. Less motion doesn't help either; less static content does. It looks like a cost or size ceiling in the backdrop renderer rather than anything about the animation.

Also checked: the still-picture filter for scenes seems to be gated on data-software-compositing and reduced motion. Neither applies here: the koi keep moving in the same window, Windows animation effects are on, and the app log shows no GPU events.

Happy to test a build or share the scene file.

VessyMe avatar Nov 18 '26 10:11 VessyMe

This looks like the same bug as #109853, which has repros on Windows and macOS and a likely cause traced in its comments. Linking so the reports stay in one place.

elliott7987-lab avatar Nov 19 '26 17:11 elliott7987-lab