Skip to content

fix: add loop="infinite" to img tags to ensure GIFs play continuously (fixes #1480)#1676

Closed
carlosjarenom wants to merge 4 commits into
eigent-ai:mainfrom
carlosjarenom:fix/issue-1480-gif-plays-once
Closed

fix: add loop="infinite" to img tags to ensure GIFs play continuously (fixes #1480)#1676
carlosjarenom wants to merge 4 commits into
eigent-ai:mainfrom
carlosjarenom:fix/issue-1480-gif-plays-once

Conversation

@carlosjarenom

Copy link
Copy Markdown
Contributor

Problem

GIFs generated by eigent agents would only play once and then stop on the last frame, instead of looping continuously.

Reported in issue #1480.

Fix

Added loop="infinite" attribute to all <img> tags in the MarkDown component (src/components/ChatBox/MessageItem/MarkDown.tsx), covering:

  • Images rendered from relative paths (converted to data URLs)
  • Images rendered from absolute URLs
  • Image preview dialog

While HTML <img> tags should loop GIFs by default, this explicit attribute ensures consistent behavior across browsers and Electron.

Files Changed

  • src/components/ChatBox/MessageItem/MarkDown.tsx - Added loop="infinite" to img tags

…fixes eigent-ai#1480)

GIFs generated by eigent agents were only playing once and then
stopping on the last frame. Added loop="infinite" attribute to
all img tags in the MarkDown component to ensure they loop properly.

This affects:
- Images rendered from relative paths (data URLs)
- Images rendered from absolute URLs
- Image preview dialog

While HTML img tags should loop GIFs by default, this explicit
attribute ensures consistent behavior across browsers and Electron.
@carlosjarenom
carlosjarenom force-pushed the fix/issue-1480-gif-plays-once branch from e4568c0 to aa0e841 Compare July 4, 2026 17:37
@carlosjarenom

Copy link
Copy Markdown
Contributor Author

Rebased on latest upstream/main and force-pushed.

Changes: Added loop="infinite" to all <img> tags in MarkDown.tsx (relative paths, absolute URLs, preview dialog) — ensures GIFs loop continuously across browsers and Electron.

@Douglasymlai

Copy link
Copy Markdown
Contributor

@carlosjarenom Thanks for the contribution. This implementation does not fix #1480. The loop attribute is not valid for an HTML element, and Chromium/Electron will ignore it. GIF repetition is defined within the GIF data itself, so adding loop="infinite" cannot make a play-once GIF repeat.

The branch also currently fails TypeScript and ESLint checks because of the unsupported attribute. Please fix the generated GIF data to include infinite looping, or use another supported mechanism to restart the animation. A regression test using a known one-shot GIF would also be helpful.

@4pmtong Could you also take a look at the expected implementation for this fix?

@4pmtong

4pmtong commented Jul 18, 2026

Copy link
Copy Markdown
Collaborator

Thanks @Douglasymlai, I agree with this assessment.

From our current docs/design direction, I would avoid fixing this in MarkDown.tsx. The markdown renderer should stay a display layer; generated artifact behavior should be fixed either at the GIF generation step by writing infinite-loop metadata, or through a supported viewer-level replay/normalization path. That will also keep the fix compatible with the future WorkspaceResolver / ArtifactRef / remote-control flow.

@carlosjarenom

Copy link
Copy Markdown
Contributor Author

Superseded by #1780 — the fix for #1480 is implemented at the generation level (backend) rather than display level. Closing this PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants