Skip to content

fix(workspace): Enable animation for theme background images - #14618

Open
niyasrad wants to merge 2 commits into
warpdotdev:masterfrom
niyasrad:niyas/animate-theme-background-image
Open

fix(workspace): Enable animation for theme background images#14618
niyasrad wants to merge 2 commits into
warpdotdev:masterfrom
niyasrad:niyas/animate-theme-background-image

Conversation

@niyasrad

@niyasrad niyasrad commented Aug 1, 2026

Copy link
Copy Markdown

Description

Adds the missing enable_animation_with_start_time() call to the workspace background rendering path (app/src/workspace/view.rs). Animated GIF theme backgrounds currently freeze on their first frame because the animation start time is never initialized at this call site. Follows the same working pattern already used at changelog_section.rs:153.

Related to #5178 (.gif background support) — see comment there for context. This doesn't add .gif picker support in the theme UI (a separate change), but fixes the animation-freeze bug that would otherwise affect any .gif background, since the file-path deserialization doesn't restrict extensions today.

Linked Issue

  • The linked issue is labeled ready-to-spec or ready-to-implement.
  • Where appropriate, screenshots or a short video of the implementation are included below (especially for user-visible or UI changes).

Note: #5178 is currently labeled enhancement/triaged, not yet ready-to-spec/ready-to-implement — flagging this openly rather than checking it off. Happy to file a dedicated issue if that's preferred.

Testing

  • I have manually tested my changes locally with ./script/run

cargo check -p warp passes. I was not able to complete a full local cargo build + visual/screenshot verification — my dev machine has 7.7GB RAM, well under what's needed to comfortably build this project (Warp's CI runners use 64GB). I'd appreciate help verifying the visual animation behavior before merge.

Screenshots / Videos

None yet — see testing note above.

Agent Mode

  • Warp Agent Mode - This PR was created via Warp's AI Agent Mode

@cla-bot

cla-bot Bot commented Aug 1, 2026

Copy link
Copy Markdown

Thank you for your pull request and welcome to our community. We could not parse the GitHub identity of the following contributors: Niyas Hameed.
This is most likely caused by a git client misconfiguration; please make sure to:

  1. check if your git client is configured with an email to sign commits git config --list | grep email
  2. If not, set it up using git config --global user.email email@example.com
  3. Make sure that the git commit email is configured in your GitHub account settings, see https://github.com/settings/emails

@oz-for-oss

oz-for-oss Bot commented Aug 1, 2026

Copy link
Copy Markdown
Contributor

@niyasrad

Every PR must be linked to a same-repo issue before Oz can review it.

Next step: open or find a same-repo issue describing this change, then link it to this PR by adding Closes #123 to the PR description (or using the "Development" sidebar on GitHub). A maintainer will mark the issue ready-to-implement when it is ready. Once it is marked, comment /oz-review to re-trigger review.

See the contribution guidelines for the full readiness model.

Powered by Oz

@github-actions github-actions Bot added the external-contributor Indicates that a PR has been opened by someone outside the Warp team. label Aug 1, 2026

@oz-for-oss oz-for-oss Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

@niyasrad

Every PR must be linked to a same-repo issue before Oz can review it.

Next step: open or find a same-repo issue describing this change, then link it to this PR by adding Closes #123 to the PR description (or using the "Development" sidebar on GitHub). A maintainer will mark the issue ready-to-implement when it is ready. Once it is marked, comment /oz-review to re-trigger review.

See the contribution guidelines for the full readiness model.

Powered by Oz

Add enable_animation_with_start_time() call to the workspace background
rendering path. Without this, animated GIF backgrounds freeze on their
first frame instead of playing. This follows the established pattern
used elsewhere in the codebase (e.g. changelog_section.rs:153).
@niyasrad
niyasrad force-pushed the niyas/animate-theme-background-image branch from 932afa0 to 0507341 Compare August 1, 2026 04:14
@cla-bot

cla-bot Bot commented Aug 1, 2026

Copy link
Copy Markdown

Thank you for your pull request and welcome to our community. We require contributors to sign our Contributor License Agreement, and we don't seem to have the users @niyasrad on file. In order for us to review and merge your code, each contributor must visit https://cla.warp.dev to read and agree to our CLA. Once you have done so, please comment @cla-bot check to trigger another check.

@niyasrad

niyasrad commented Aug 1, 2026

Copy link
Copy Markdown
Author

@cla-bot check

@cla-bot cla-bot Bot added the cla-signed label Aug 1, 2026
@cla-bot

cla-bot Bot commented Aug 1, 2026

Copy link
Copy Markdown

The cla-bot has been summoned, and re-checked this pull request!

Add regression coverage for the animated image frame advancement fix. The
original bug was that paint_animated_image() would ignore the started_at
field and always recompute Instant::now(), making elapsed_time ~0 and
freezing animations on the first frame.

The fix adds enable_animation_with_start_time() to set started_at, which
paint_animated_image() then uses to compute elapsed time correctly.

This commit includes:

1. Six solid tests directly verifying AnimatedImage::get_current_frame()
   frame advancement/wrapping over elapsed time with real GIF/WebP fixtures

2. Four regression tests for the paint_animated_image fix:
   - Tests that verify enable_animation_with_start_time() sets started_at
   - Tests that verify started_at is actually used for frame selection

3. Refactor: Extract elapsed-time computation into a pure helper method
   compute_elapsed_time_ms(&self, now: Instant) that can be unit-tested
   directly. This method respects self.started_at and would fail if someone
   reintroduces the bug (e.g., ignoring self.started_at or recomputing
   Instant::now() fresh).

The new regression tests directly verify that compute_elapsed_time_ms uses
self.started_at correctly, and would catch the regression if someone
changed the logic to ignore started_at.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cla-signed external-contributor Indicates that a PR has been opened by someone outside the Warp team.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant