Skip to content

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

Open
carlosjarenom wants to merge 1 commit into
eigent-ai:mainfrom
carlosjarenom:fix/issue-1480-gif-plays-once
Open

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

Conversation

@carlosjarenom

Copy link
Copy Markdown

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
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?

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.

2 participants