Skip to content

fix(themes): hold the pack welcome image still under reduced motion - #31440

Merged
KiroCrewCaptain merged 1 commit into
mainfrom
fix/23841-welcome-image-reduced-motion
Nov 7, 2026
Merged

KiroCrewCaptain merged 1 commit into
mainfrom
fix/23841-welcome-image-reduced-motion

Conversation

@bolichen97

Copy link
Copy Markdown
Contributor

Problem / Motivation

Goal: A theme pack's animated welcome image holds still on its first frame when the user asks for reduced motion.

A pack's welcome image (branding/welcome.*) can be an animated GIF, WebP or SVG. The welcome screen of a new chat rendered it as a plain <img>, so it kept playing with prefers-reduced-motion: reduce on. The page's global reduced-motion rule stops the page's own animations, not the frames inside an image.

Why it matters

People who turn on reduced motion do so because motion bothers them, sometimes physically. An installed pack's animated welcome image ignored that setting on every new chat. The pack's loader art already honours it since #23552.

Not a goal

What changed (motivation → approach → change)

Under reduced motion the welcome image now stops on its first frame. With motion allowed it plays as before.

The cause was the plain <img>: nothing on the page can pause an image's own animation. PackLoaderImage already solves this for loader art. Under reduced motion it paints the image once onto a <canvas>, which never repaints, and it follows the setting live.

components/WelcomeView.tsx now renders its brand image through PackLoaderImage, with the same src and classes. The welcome hero is hidden on a short viewport, so a still painted while hidden takes its size from the canvas's CSS box instead of the 14px carousel fallback, and stays sharp when the hero shows. The themes spec, the theming contract, the feature map and PackLoaderImage's header comment say the welcome image holds its first frame under reduced motion.

Backwards compatibility

Compatible: with motion allowed the welcome image is still an <img> with the same source, classes, alt="" and aria-hidden; it only gains draggable={false}, as the loader art has. Only reduced motion renders differently; a visible loader canvas in the chat footer keeps its laid-out size, so the footer is unchanged.

Removes nothing: the precedence of compiled branding, pack welcome image, pack logo and stock ghost is unchanged.

Tests

  • WelcomeView.brandMark.test.tsx adds holds an animated welcome image on a still canvas under reduced motion: with prefers-reduced-motion: reduce, a pack's welcome GIF renders a <canvas>, and the only <img> is the hidden decode copy. It fails on origin/main (the image is a visible <img>) and passes with the fix. The existing brand-mark tests keep the motion-allowed <img>, its alt="" and aria-hidden, and the precedence order.
  • PackLoaderImage.test.tsx adds sizes a canvas under a hidden ancestor from its CSS box, not the 14px slot edge: a canvas with no layout box and a 48px CSS size is painted at 48px. It fails without the sizing change (14px) and passes with it.
  • Determinism: both files passed 10 repeated runs, and together with WelcomeView.test.tsx under --sequence.shuffle --sequence.seed=23841.

Proof: not provable -- frontend test (prove.py runs Python only)

Manual verification

N/A — unit coverage sufficient: the canvas still-frame path is the one PackLoaderImage.test.tsx already covers for loader art, and the new test proves the welcome screen takes it.

Screenshots / video

Why no screenshot: with motion allowed the welcome image is the same <img> as before, and under reduced motion it shows the image's first frame, which a still capture cannot tell apart from the old image.

Related Issues

Closes #23841

Sibling sweep

Swept: git grep -nE "brandWelcome|brandLogo|src={avatar}|loaderImages" -- website/src
Sibling: website/src/pages/chat/ChatFooter.tsx -- not affected -- already renders pack loader art through PackLoaderImage
Sibling: website/src/shell/nav/railChrome.tsx:40 -- tracked in #31362
Sibling: website/src/shell/topbar/shellHeader.tsx:77 -- tracked in #31362

Pattern harvest

Rule candidate: review-prompt
Pattern: pack-supplied image that may animate (GIF, WebP, APNG, SVG) rendered as a plain <img> instead of through PackLoaderImage, so it ignores reduced motion

Checklist

  • At most two commits (one is the norm), with a Conventional Commits title (feat|fix|docs|style|refactor|perf|test|chore|ci|build|revert: ...)
  • Existing tests pass and new tests added for new functionality
  • Self-review completed; code follows project style guidelines
  • Documentation updated (if applicable)
  • No secrets, credentials, or internal references in the diff

Contribution License Agreement

Contributions are accepted under the project's Apache-2.0 license; see the Licensing section of CONTRIBUTING.md.

@bolichen97
bolichen97 requested review from a team and KiroCrewCaptain as code owners November 6, 2026 13:51
@bolichen97
bolichen97 requested a review from Zedmor November 6, 2026 13:51
@github-actions github-actions Bot added the readiness: checking Automated validation is still running label Nov 6, 2026
@github-actions

github-actions Bot commented Nov 6, 2026 •

Copy link
Copy Markdown
Contributor

First Principles Review (Opus 5.5) — ✅ PASS

Premise-level review of 414c285443f02f2383e8379b6adab2319af41a09 — why this exists and whether the shipped surface is the smallest honest version. Updated in place on each push. A BLOCK verdict blocks PR readiness; PASS does not.

First-Principles-Verdict: PASS

Nothing blocks. The fix reuses the reduced-motion mechanism that already exists, PackLoaderImage, and the canvas-sizing change is needed because the welcome hero can be hidden when the still is painted.

What this change ships

Inventory (4 items) — 4 justified

Intent: People who turn on reduced motion want a theme pack's animated welcome image to stay still on new chats. This is a FIX (closes #23841, and the new test fails on base).

  1. Under reduced motion, the welcome screen's brand image stops on its first frame instead of playing — justified
  2. With motion allowed, the welcome image also gains draggable={false} — justified
  3. A still image painted while its parent is hidden now takes its size from the CSS box (48px for the welcome mark) instead of the 14px fallback — justified
  4. The themes spec, the theming contract, the feature map and the component's header comment now say the welcome image holds its first frame — justified

[FIRST-PRINCIPLES-REVIEWED] 414c285

Description read

[DESCRIPTION-READ] fce923c628ad7ed1866c8dd7bec59de6c6da00a9e802e13e110007f4886c34b4

That sha256 names the PR description this verdict read. Recompute it with .github/scripts/pr-description-capture.sh; if it differs, the description changed after this verdict was formed and any finding drawn from the description is unproven.

@github-actions

github-actions Bot commented Nov 6, 2026 •

Copy link
Copy Markdown
Contributor

UX Review (Opus 5.5) — ✅ PASS

UX-level review of 414c285443f02f2383e8379b6adab2319af41a09 — updated in place on each push. A BLOCK verdict blocks PR readiness; PASS does not.

UX-Verdict: PASS

Nothing blocks. No control is added or changed. The existing welcome image now stops on its first frame under reduced motion, and a still screenshot can't show that difference, as the author says.

[UX-REVIEWED] 414c285

Description read

[DESCRIPTION-READ] cb6a82f16379cdb02bf28ffe0f92971ec8c4ca9e4fe577e7d027534b799eeff8

That sha256 names everything this verdict read: the PR description, plus the 3 evidence file(s) the workflow collected from it and handed this review. It covers that evidence because the media strip replaces every attachment URL with the same placeholder, so an edit swapping one attachment for another would leave the description's captured text identical while what this review judged changed. Recompute it with .github/scripts/pr-description-capture.sh over the same inputs; if it differs, the description or that evidence changed after this verdict was formed and any finding drawn from either is unproven.

@github-actions

github-actions Bot commented Nov 6, 2026 •

Copy link
Copy Markdown
Contributor

Design Review (Opus 5.5) — ✅ PASS

Design-level review of 414c285443f02f2383e8379b6adab2319af41a09 — updated in place on each push. A BLOCK verdict blocks PR readiness; PASS does not.

Design-Verdict: PASS

Nothing blocks: the change reuses PackLoaderImage, which already holds loader art still under reduced motion. It adds no new surface, and shows nothing different when motion is allowed.

Notes

  • The getComputedStyle sizing fallback in paintStill fixes this hero, and the chat footer's loader art gets the same fix. A loader canvas that paints while hidden now takes its CSS size, not the 14px fallback. That is likely what you want there too, but the description says the footer is "unchanged" and never mentions it.

[DESIGN-REVIEWED] 414c285

Description read

[DESCRIPTION-READ] 69bceb04857b177cb7a64def9cd3bb970c435a1e943fd14f13b817f5d3e30928

That sha256 names everything this verdict read: the PR description, plus the 1 evidence file(s) the workflow collected from it and handed this review. It covers that evidence because the media strip replaces every attachment URL with the same placeholder, so an edit swapping one attachment for another would leave the description's captured text identical while what this review judged changed. Recompute it with .github/scripts/pr-description-capture.sh over the same inputs; if it differs, the description or that evidence changed after this verdict was formed and any finding drawn from either is unproven.

@github-actions

github-actions Bot commented Nov 6, 2026 •

Copy link
Copy Markdown
Contributor

Opus 5.5 Review — ✅ no blocking findings

Reviewed 414c285443f02f2383e8379b6adab2319af41a09 — this comment is updated in place on each push.

Review details

No findings.

[OPUS-REVIEWED] 414c285

Verdict parsed from the review's SHA-scoped output markers for commit 414c285443f02f2383e8379b6adab2319af41a09.

False positive or not applicable? A repository writer can comment:
/ai-review override fable 414c285443f02f2383e8379b6adab2319af41a09 false-positive: <reason, 20 to 500 characters>

@github-actions

github-actions Bot commented Nov 6, 2026 •

Copy link
Copy Markdown
Contributor

GPT 6.1 Review — ✅ no blocking findings

GPT 6.1 completed its review of 414c285443f02f2383e8379b6adab2319af41a09 and found no blocking issues.

This comment is updated in place on each push.

Review details

No findings.
[GPT-REVIEWED] 414c285

False positive or not applicable? A repository writer can comment:
/ai-review override gpt 414c285443f02f2383e8379b6adab2319af41a09 false-positive: <reason, 20 to 500 characters>

@bolichen97
bolichen97 enabled auto-merge (squash) November 6, 2026 14:13
@github-actions github-actions Bot added readiness: passed Eligible automated validation passed for the current revision and removed readiness: checking Automated validation is still running labels Nov 6, 2026
@bolichen97
bolichen97 force-pushed the fix/23841-welcome-image-reduced-motion branch from 93c857c to 56f1857 Compare November 6, 2026 16:53
@bolichen97

Copy link
Copy Markdown
Contributor Author

Rebased: main moved in files beside website/src/components/WelcomeView.tsx, website/src/pages/chat/PackLoaderImage.tsx and docs/system-specs/modules/themes.md since this head went green (40e8300 -> 4c8baf1); CI re-running.

[operator: bolichen97]

@github-actions github-actions Bot added readiness: action required A blocking check or review needs attention and removed readiness: passed Eligible automated validation passed for the current revision labels Nov 6, 2026
@bolichen97
bolichen97 force-pushed the fix/23841-welcome-image-reduced-motion branch from 56f1857 to 6e1165d Compare November 6, 2026 19:42
@bolichen97

Copy link
Copy Markdown
Contributor Author

Rebased: main moved in docs/feature-map/README.md and in files beside website/src/components/WelcomeView.tsx and docs/system-specs/modules/themes.md since this head's CI ran (4c8baf1 -> 8dbdf04); CI re-running. The previous head's red lanes were CI read failures (API rate limit), not findings.

[operator: bolichen97]

@github-actions github-actions Bot added readiness: checking Automated validation is still running readiness: action required A blocking check or review needs attention and removed readiness: action required A blocking check or review needs attention readiness: checking Automated validation is still running labels Nov 6, 2026
A theme pack's welcome image (branding/welcome.*) rendered as a plain
<img>, so an animated GIF, WebP or SVG kept playing when the user asked
for reduced motion: the global rule stops the page's own animations,
not an image's frames. The welcome screen now renders it through
PackLoaderImage, which already paints loader art once onto a canvas
under reduced motion.

The welcome hero is hidden on a short viewport, so a still painted
while hidden now takes its size from the canvas's CSS box instead of
the 14px carousel fallback and stays sharp when the hero shows. The
themes spec, theming contract and feature map say so.

Closes #23841
@bolichen97
bolichen97 force-pushed the fix/23841-welcome-image-reduced-motion branch from 6e1165d to 414c285 Compare November 7, 2026 02:32
@bolichen97

Copy link
Copy Markdown
Contributor Author

Rebased: main moved in docs/feature-map/README.md, docs/system-specs/modules/themes.md and website/docs/theming-contract.md since this head's CI ran (8dbdf04 -> 10e0a06); CI re-running. The previous head's two red backend tests also failed on that base and are fixed on main by #31803 and #31625; its AI review lanes failed on CI read errors, not findings. The diff is unchanged.

[operator: bolichen97]

@github-actions github-actions Bot added readiness: checking Automated validation is still running readiness: passed Eligible automated validation passed for the current revision and removed readiness: action required A blocking check or review needs attention readiness: checking Automated validation is still running labels Nov 7, 2026

@KiroCrewCaptain KiroCrewCaptain left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approved for the on-call. Review lanes pass on 414c285, no conflict, no open change request.

@KiroCrewCaptain
KiroCrewCaptain merged commit 1674b1f into main Nov 7, 2026
97 of 98 checks passed
@KiroCrewCaptain
KiroCrewCaptain deleted the fix/23841-welcome-image-reduced-motion branch November 7, 2026 03:30
@github-actions github-actions Bot removed the readiness: passed Eligible automated validation passed for the current revision label Nov 7, 2026
buluoray added a commit that referenced this pull request Nov 8, 2026
…31440)

A theme pack's welcome image (branding/welcome.*) rendered as a plain
<img>, so an animated GIF, WebP or SVG kept playing when the user asked
for reduced motion: the global rule stops the page's own animations,
not an image's frames. The welcome screen now renders it through
PackLoaderImage, which already paints loader art once onto a canvas
under reduced motion.

The welcome hero is hidden on a short viewport, so a still painted
while hidden now takes its size from the canvas's CSS box instead of
the 14px carousel fallback and stays sharp when the hero shows. The
themes spec, theming contract and feature map say so.

Closes #23841

(cherry picked from commit 1674b1f)

Co-author on main: Bolin Chen
buluoray added a commit that referenced this pull request Nov 8, 2026
…31440)

A theme pack's welcome image (branding/welcome.*) rendered as a plain
<img>, so an animated GIF, WebP or SVG kept playing when the user asked
for reduced motion: the global rule stops the page's own animations,
not an image's frames. The welcome screen now renders it through
PackLoaderImage, which already paints loader art once onto a canvas
under reduced motion.

The welcome hero is hidden on a short viewport, so a still painted
while hidden now takes its size from the canvas's CSS box instead of
the 14px carousel fallback and stays sharp when the hero shows. The
themes spec, theming contract and feature map say so.

Closes #23841

(cherry picked from commit 1674b1f)

Co-author on main: Bolin Chen
buluoray added a commit that referenced this pull request Nov 8, 2026
…31440)

A theme pack's welcome image (branding/welcome.*) rendered as a plain
<img>, so an animated GIF, WebP or SVG kept playing when the user asked
for reduced motion: the global rule stops the page's own animations,
not an image's frames. The welcome screen now renders it through
PackLoaderImage, which already paints loader art once onto a canvas
under reduced motion.

The welcome hero is hidden on a short viewport, so a still painted
while hidden now takes its size from the canvas's CSS box instead of
the 14px carousel fallback and stays sharp when the hero shows. The
themes spec, theming contract and feature map say so.

Closes #23841

(cherry picked from commit 1674b1f)

Co-author on main: Bolin Chen
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Pack welcome image keeps animating under reduced motion

2 participants