opencode icon indicating copy to clipboard operation
opencode copied to clipboard

fix(webUI): handle non-ASCII filenames in snapshot diff

Open JASON-QWeb opened this issue 3 days ago • 1 comments

Summary

Fixes https://github.com/anomalyco/opencode/issues/7670 Same as https://github.com/anomalyco/opencode/issues/7408

This PR resolves on Web: when containing non-ASCII filenames, Path is error, so filenames and git diff will display uncorrect and cause SyntaxError.

Problem

  • For non-ASCII filenames (CN/KOR/JP) , Git emits quoted paths, so the filenames in session diffs don’t match the ones in snapshot diffs.
  • shell interpretation can interfere with git show when paths contain Unicode characters, resulting in empty before/after content when get summary diff.

Changes

  • use Bun.spawn to get git show, so it can avoid Bun shell interpretation error
  • add decodeGitQuotepath to handle non-ASCII filenames (CN/KOR/JP)

Solution

Make non-ASCII filenames (CN/KOR/JP) path can be decode correctly like other filenames on Web.

Verification

Make changes to three file: test.py , 测试.py and 시험.py

Before:

  • Filename is wrong and click will cause error Before1 Before2

After: After

JASON-QWeb avatar Jan 11 '26 06:01 JASON-QWeb