Skip to content

fix: reject unsupported image formats before API call, fix scroll layout jumps (#351, #844)#845

Open
MrRealORG wants to merge 1 commit into
XiaomiMiMo:mainfrom
MrRealORG:fix/auto-0616-unsupported-image-scroll-fixes
Open

fix: reject unsupported image formats before API call, fix scroll layout jumps (#351, #844)#845
MrRealORG wants to merge 1 commit into
XiaomiMiMo:mainfrom
MrRealORG:fix/auto-0616-unsupported-image-scroll-fixes

Conversation

@MrRealORG

@MrRealORG MrRealORG commented Jun 16, 2026

Copy link
Copy Markdown

Summary

Fixes two bugs:

#351: Unsupported image format causes repeated 400 errors

When an unsupported image format (e.g. .ico, .tiff) is attached to a conversation, the MiMo API rejects it with a 400 error. Because the invalid media stays in the message history, every subsequent turn re-sends it, causing the same error repeatedly and making the conversation unusable.

Fix: Added a SUPPORTED_IMAGE_MIMES allowlist in util/media.ts (bmp, gif, jpeg, png, webp) and a pre-send filter in provider/transform.ts that converts unsupported image formats to a clear text error before they reach the API. This prevents the 400 error entirely.

#844: Scroll causes right-side display glitch

CSS content-visibility: auto without matching contain-intrinsic-size causes the browser to estimate element sizes as 0px when off-screen, producing layout jumps during scrolling.

Fix: Added contain-intrinsic-size to all CSS rules using content-visibility: auto:

  • message-part.css: auto 500px
  • basic-tool.css: auto 200px
  • file.css: auto 300px

Test Plan

  • Attach an .ico file — verify clear error instead of 400 loop
  • Attach a .png file — verify it still works
  • Scroll in long conversation — verify no display glitches

Closes #351
Closes #844

@MrRealORG MrRealORG changed the title fix: reject unsupported image formats before API call, fix scroll lay… fix: reject unsupported image formats before API call, fix scroll layout jumps (#351, #844) Jun 16, 2026
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.

对话窗口右侧显示bug 不支持的图片格式触发报错后,后续对话仍反复携带非法媒体,导致无法继续交互

1 participant