Skip to content

Fix tab layout, rename tabs, and fix diff rendering double-escaping - #5

Merged
unknowIfGuestInDream merged 3 commits into
masterfrom
copilot/fix-tab-issues-and-diff-rendering
Jan 30, 2026
Merged

unknowIfGuestInDream merged 3 commits into
masterfrom
copilot/fix-tab-issues-and-diff-rendering

Conversation

Copilot AI commented Jan 30, 2026 •

Copy link
Copy Markdown
Contributor

Addresses UI/UX issues with tab positioning, naming, and a diff rendering bug caused by double-escaping content.

Changes

Tab Layout & Naming

  • Moved tabs from top to bottom using CSS order: 1
  • Renamed "Visual Diff" → "Visual", "Raw Content" → "Content"
  • Updated all i18n files (en, zh-cn, ja)

Content Tab Behavior

  • Now opens file in VS Code's native text editor instead of displaying raw text in webview
vscode.commands.executeCommand('vscode.openWith', document.uri, 'default');

Diff Rendering Fix

Content was double-escaped: escapeForJs() escaped special chars, then JSON.stringify() escaped them again, corrupting diff content.

Before:

const escapedContent = escapeForJs(content);
let currentContent = ${JSON.stringify(escapedContent)};

After:

let currentContent = ${JSON.stringify(content)};

i18n Note

package.nls.json files must remain in root per VS Code requirements. For runtime webview localization, use @vscode/l10n with l10n/ folder.

Original prompt

This section details on the original issue you should resolve

<issue_title>问题修复</issue_title>
<issue_description>1. tab移到下面
2. 第一个tab叫Visual 第二个叫Content
3. 第二个编辑器用vscode内置文本编辑器打开文件
4. 第一个tab加载patch/diff 有错误: Unable to render diff. Please check if the content is a valid diff/patch format.
5. 国际化文件能单独放在一个文件夹下么?还是必须放在根目录下</issue_description>

Comments on the Issue (you are @copilot in this section)


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

…to open with VS Code text editor

Co-authored-by: unknowIfGuestInDream <57802425+unknowIfGuestInDream@users.noreply.github.com>
…ual feedback

Co-authored-by: unknowIfGuestInDream <57802425+unknowIfGuestInDream@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix tab positioning and diff rendering errors Fix tab layout, rename tabs, and fix diff rendering double-escaping Jan 30, 2026
@unknowIfGuestInDream
unknowIfGuestInDream marked this pull request as ready for review January 30, 2026 02:16
@unknowIfGuestInDream
unknowIfGuestInDream merged commit 9770c45 into master Jan 30, 2026
4 checks passed
@unknowIfGuestInDream
unknowIfGuestInDream deleted the copilot/fix-tab-issues-and-diff-rendering branch January 30, 2026 02:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

问题修复

2 participants