Skip to content

Commit dc804b3

Browse files
committed
feat(vscode): add sidebar view with comprehensive uii integration
Add a dedicated Activity Bar sidebar for the VS Code extension with enhanced UI features and improved user experience. Features added: - Activity Bar sidebar with tree view navigation - Four main sections: Actions, Recent Files, Settings, Quick Links - Quick action buttons for common operations (compare, refresh, etc.) - Recent files tracking (up to 20 files, displays last 10) - Interactive settings management from sidebar - Direct links to GitHub repository, docs, and issue tracker - 14 new commands for sidebar functionality - Context menu integration in sidebar tree items - Welcome view for first-time users Commands added: - diffmanifests.checkEnvironment - diffmanifests.refreshSidebar - diffmanifests.openGitHub/openDocs/reportIssue - diffmanifests.configure* (PythonPath, ConfigFile, OutputFormat) - diffmanifests.toggle* (AutoInstall, ShowOutput) - diffmanifests.openSettings - diffmanifests.clearRecentFiles UI improvements: - Icons for all commands and tree items - Collapsible sections in sidebar - Real-time settings display - One-click access to all configurations
1 parent a5a3c41 commit dc804b3

File tree

7 files changed

+642
-10
lines changed

7 files changed

+642
-10
lines changed

README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,9 @@ A **Visual Studio Code extension** is available for seamless integration with yo
8888
### Features
8989

9090
- 🖱️ **GUI Integration**: Compare manifests directly from VS Code
91+
- 📋 **Sidebar View**: Dedicated sidebar with quick access to all features and settings
92+
-**Quick Actions**: Compare manifests, check environment, and manage settings from sidebar
93+
- 📂 **Recent Files**: Track and quickly access recently compared files
9194
- 🎯 **Context Menu**: Right-click on XML files to compare
9295
- ⚙️ **Auto-Configuration**: Automatic Python environment detection
9396
- 📊 **Multiple Output Formats**: JSON and Excel support

README_cn.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,9 @@ pip install -e .
8888
### 功能特性
8989

9090
- 🖱️ **GUI 集成**:直接在 VS Code 中比较清单
91+
- 📋 **侧边栏视图**:专用侧边栏,快速访问所有功能和设置
92+
-**快速操作**:从侧边栏比较清单、检查环境和管理设置
93+
- 📂 **最近文件**:跟踪并快速访问最近比较的文件
9194
- 🎯 **右键菜单**:右键点击 XML 文件进行比较
9295
- ⚙️ **自动配置**:自动检测 Python 环境
9396
- 📊 **多种输出格式**:支持 JSON 和 Excel

vscode/README.md

Lines changed: 49 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,9 @@ A Visual Studio Code extension for comparing Android manifest files using the `d
88

99
- 🔍 **Deep Manifest Comparison**: Compare two manifest XML files directly from VS Code
1010
- 🎯 **Context Menu Integration**: Right-click on manifest files in the explorer to compare
11+
- 📋 **Sidebar View**: Dedicated sidebar with quick access to all features and settings
12+
-**Quick Actions**: Compare manifests, check environment, and manage settings from sidebar
13+
- 📂 **Recent Files**: Track and quickly access recently compared files
1114
- ⚙️ **Configurable**: Customize Python path, config file, and output format
1215
- 📊 **Multiple Output Formats**: Support for JSON and Excel output formats
1316
- 🔄 **Auto-Installation**: Automatically offers to install the diffmanifests package
@@ -134,7 +137,20 @@ pip3 show diffmanifests # Ubuntu/Linux
134137

135138
## Usage
136139

137-
### Method 1: Command Palette
140+
### Method 1: Sidebar (Recommended)
141+
142+
1. Click on the Diff Manifests icon in the Activity Bar (left sidebar)
143+
2. In the sidebar, you'll see:
144+
- **Actions**: Quick access to compare manifests and other operations
145+
- **Recent Files**: List of recently compared files for quick access
146+
- **Settings**: View and modify extension settings
147+
- **Quick Links**: Access documentation and GitHub repository
148+
149+
3. Click "Compare Manifests" to start a new comparison
150+
4. Follow the prompts to select files
151+
5. View results in the output panel or open the result file
152+
153+
### Method 2: Command Palette
138154

139155
1. Press `Ctrl+Shift+P` (Windows/Linux) or `Cmd+Shift+P` (macOS)
140156
2. Type "Diff Manifests: Compare Two Manifest Files"
@@ -144,15 +160,15 @@ pip3 show diffmanifests # Ubuntu/Linux
144160
6. Choose the output file location
145161
7. View the results
146162

147-
### Method 2: Context Menu
163+
### Method 3: Context Menu
148164

149165
1. Right-click on a manifest XML file in the Explorer
150166
2. Select "Diff Manifests: Compare Selected Files"
151167
3. Follow the prompts to select the second manifest and config file
152168
4. Choose the output file location
153169
5. View the results
154170

155-
### Method 3: Using Settings
171+
### Method 4: Using Settings
156172

157173
Configure default settings for faster workflow:
158174

@@ -191,6 +207,36 @@ Add to your `settings.json`:
191207
}
192208
```
193209

210+
### Quick Configuration from Sidebar
211+
212+
You can also configure settings directly from the sidebar:
213+
1. Open the Diff Manifests sidebar
214+
2. Expand the "Settings" section
215+
3. Click on any setting item to modify it:
216+
- **Python Path**: Change Python executable path
217+
- **Config File**: Select default config.json file
218+
- **Output Format**: Switch between JSON and Excel
219+
- **Auto Install**: Toggle automatic installation
220+
- **Show Output**: Toggle output panel visibility
221+
- **Open Settings**: Access full extension settings
222+
223+
## Available Commands
224+
225+
All commands are available via Command Palette (`Ctrl+Shift+P`):
226+
227+
- **Diff Manifests: Compare Two Manifest Files** - Start a new comparison
228+
- **Diff Manifests: Compare Selected Files** - Compare from selected file
229+
- **Diff Manifests: Open Output File** - Open a result file
230+
- **Diff Manifests: Check Environment** - Verify Python and package installation
231+
- **Refresh** (Sidebar) - Refresh the sidebar view
232+
- **Open Settings** - Open extension settings
233+
- **Configure Python Path** - Set Python executable path
234+
- **Configure Config File** - Set default config file
235+
- **Configure Output Format** - Choose output format
236+
- **Toggle Auto Install** - Enable/disable auto-installation
237+
- **Toggle Show Output Panel** - Enable/disable auto-show output
238+
- **Clear Recent Files** - Clear recent files list
239+
194240
## Python Package Installation
195241

196242
The extension requires the `diffmanifests` Python package. It will offer to install it automatically on first use, or you can install it manually:

vscode/README_cn.md

Lines changed: 49 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,9 @@
88

99
- 🔍 **深度清单比较**:直接在 VS Code 中比较两个清单 XML 文件
1010
- 🎯 **右键菜单集成**:在资源管理器中右键点击清单文件进行比较
11+
- 📋 **侧边栏视图**:专用侧边栏,快速访问所有功能和设置
12+
-**快速操作**:从侧边栏比较清单、检查环境和管理设置
13+
- 📂 **最近文件**:跟踪并快速访问最近比较的文件
1114
- ⚙️ **可配置**:自定义 Python 路径、配置文件和输出格式
1215
- 📊 **多种输出格式**:支持 JSON 和 Excel 输出格式
1316
- 🔄 **自动安装**:自动提供安装 diffmanifests 包
@@ -134,7 +137,20 @@ pip3 show diffmanifests # Ubuntu/Linux
134137

135138
## 使用方法
136139

137-
### 方法 1:命令面板
140+
### 方法 1:侧边栏(推荐)
141+
142+
1. 点击活动栏(左侧边栏)中的 Diff Manifests 图标
143+
2. 在侧边栏中,您将看到:
144+
- **操作**:快速访问比较清单和其他操作
145+
- **最近文件**:最近比较的文件列表,便于快速访问
146+
- **设置**:查看和修改扩展设置
147+
- **快速链接**:访问文档和 GitHub 仓库
148+
149+
3. 点击"比较清单"开始新的比较
150+
4. 按照提示选择文件
151+
5. 在输出面板中查看结果或打开结果文件
152+
153+
### 方法 2:命令面板
138154

139155
1.`Ctrl+Shift+P` (Windows/Linux) 或 `Cmd+Shift+P` (macOS)
140156
2. 输入 "Diff Manifests: Compare Two Manifest Files"
@@ -144,15 +160,15 @@ pip3 show diffmanifests # Ubuntu/Linux
144160
6. 选择输出文件位置
145161
7. 查看结果
146162

147-
### 方法 2:右键菜单
163+
### 方法 3:右键菜单
148164

149165
1. 在资源管理器中右键点击清单 XML 文件
150166
2. 选择 "Diff Manifests: Compare Selected Files"
151167
3. 按照提示选择第二个清单和配置文件
152168
4. 选择输出文件位置
153169
5. 查看结果
154170

155-
### 方法 3:使用设置
171+
### 方法 4:使用设置
156172

157173
配置默认设置以加快工作流程:
158174

@@ -191,6 +207,36 @@ pip3 show diffmanifests # Ubuntu/Linux
191207
}
192208
```
193209

210+
### 从侧边栏快速配置
211+
212+
您也可以直接从侧边栏配置设置:
213+
1. 打开 Diff Manifests 侧边栏
214+
2. 展开"设置"部分
215+
3. 点击任何设置项来修改它:
216+
- **Python 路径**:更改 Python 可执行文件路径
217+
- **配置文件**:选择默认 config.json 文件
218+
- **输出格式**:在 JSON 和 Excel 之间切换
219+
- **自动安装**:切换自动安装功能
220+
- **显示输出**:切换输出面板可见性
221+
- **打开设置**:访问完整的扩展设置
222+
223+
## 可用命令
224+
225+
所有命令都可以通过命令面板 (`Ctrl+Shift+P`) 访问:
226+
227+
- **Diff Manifests: Compare Two Manifest Files** - 开始新的比较
228+
- **Diff Manifests: Compare Selected Files** - 从选定文件比较
229+
- **Diff Manifests: Open Output File** - 打开结果文件
230+
- **Diff Manifests: Check Environment** - 验证 Python 和包安装
231+
- **Refresh**(侧边栏)- 刷新侧边栏视图
232+
- **Open Settings** - 打开扩展设置
233+
- **Configure Python Path** - 设置 Python 可执行文件路径
234+
- **Configure Config File** - 设置默认配置文件
235+
- **Configure Output Format** - 选择输出格式
236+
- **Toggle Auto Install** - 启用/禁用自动安装
237+
- **Toggle Show Output Panel** - 启用/禁用自动显示输出
238+
- **Clear Recent Files** - 清除最近文件列表
239+
194240
## Python 包安装
195241

196242
扩展需要 `diffmanifests` Python 包。它会在首次使用时自动提供安装,或者您可以手动安装:

vscode/package.json

Lines changed: 116 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,18 +19,112 @@
1919
],
2020
"main": "./out/extension.js",
2121
"contributes": {
22+
"viewsContainers": {
23+
"activitybar": [
24+
{
25+
"id": "diffmanifests-sidebar",
26+
"title": "Diff Manifests",
27+
"icon": "$(diff)"
28+
}
29+
]
30+
},
31+
"views": {
32+
"diffmanifests-sidebar": [
33+
{
34+
"id": "diffmanifests-explorer",
35+
"name": "Explorer",
36+
"icon": "$(diff)",
37+
"contextualTitle": "Diff Manifests"
38+
},
39+
{
40+
"id": "diffmanifests-welcome",
41+
"name": "Getting Started",
42+
"when": "diffmanifests.showWelcome"
43+
}
44+
]
45+
},
2246
"commands": [
2347
{
2448
"command": "diffmanifests.compare",
25-
"title": "Diff Manifests: Compare Two Manifest Files"
49+
"title": "Diff Manifests: Compare Two Manifest Files",
50+
"icon": "$(diff)"
2651
},
2752
{
2853
"command": "diffmanifests.compareSelection",
29-
"title": "Diff Manifests: Compare Selected Files"
54+
"title": "Diff Manifests: Compare Selected Files",
55+
"icon": "$(files)"
3056
},
3157
{
3258
"command": "diffmanifests.openOutput",
33-
"title": "Diff Manifests: Open Output File"
59+
"title": "Diff Manifests: Open Output File",
60+
"icon": "$(go-to-file)"
61+
},
62+
{
63+
"command": "diffmanifests.checkEnvironment",
64+
"title": "Diff Manifests: Check Environment",
65+
"icon": "$(refresh)"
66+
},
67+
{
68+
"command": "diffmanifests.refreshSidebar",
69+
"title": "Refresh",
70+
"icon": "$(refresh)"
71+
},
72+
{
73+
"command": "diffmanifests.openGitHub",
74+
"title": "Open GitHub Repository",
75+
"icon": "$(github)"
76+
},
77+
{
78+
"command": "diffmanifests.openDocs",
79+
"title": "Open Documentation",
80+
"icon": "$(book)"
81+
},
82+
{
83+
"command": "diffmanifests.reportIssue",
84+
"title": "Report Issue",
85+
"icon": "$(bug)"
86+
},
87+
{
88+
"command": "diffmanifests.configurePythonPath",
89+
"title": "Configure Python Path",
90+
"icon": "$(settings-gear)"
91+
},
92+
{
93+
"command": "diffmanifests.configureConfigFile",
94+
"title": "Configure Config File",
95+
"icon": "$(settings-gear)"
96+
},
97+
{
98+
"command": "diffmanifests.configureOutputFormat",
99+
"title": "Configure Output Format",
100+
"icon": "$(settings-gear)"
101+
},
102+
{
103+
"command": "diffmanifests.toggleAutoInstall",
104+
"title": "Toggle Auto Install",
105+
"icon": "$(symbol-boolean)"
106+
},
107+
{
108+
"command": "diffmanifests.toggleShowOutput",
109+
"title": "Toggle Show Output Panel",
110+
"icon": "$(output)"
111+
},
112+
{
113+
"command": "diffmanifests.openSettings",
114+
"title": "Open Extension Settings",
115+
"icon": "$(settings)"
116+
},
117+
{
118+
"command": "diffmanifests.clearRecentFiles",
119+
"title": "Clear Recent Files",
120+
"icon": "$(clear-all)"
121+
}
122+
],
123+
"viewsWelcome": [
124+
{
125+
"view": "diffmanifests-explorer",
126+
"contents": "Welcome to Diff Manifests!\n\nCompare Android manifest files using Gerrit & Gitiles API.\n\n[Compare Manifests](command:diffmanifests.compare)\n\n[Open Settings](command:diffmanifests.openSettings)\n\n[View Documentation](command:diffmanifests.openDocs)",
127+
"when": "workspaceFolderCount == 0"
34128
}
35129
],
36130
"configuration": {
@@ -68,6 +162,25 @@
68162
}
69163
},
70164
"menus": {
165+
"view/title": [
166+
{
167+
"command": "diffmanifests.refreshSidebar",
168+
"when": "view == diffmanifests-explorer",
169+
"group": "navigation"
170+
},
171+
{
172+
"command": "diffmanifests.compare",
173+
"when": "view == diffmanifests-explorer",
174+
"group": "navigation"
175+
}
176+
],
177+
"view/item/context": [
178+
{
179+
"command": "diffmanifests.clearRecentFiles",
180+
"when": "view == diffmanifests-explorer && viewItem == recent",
181+
"group": "inline"
182+
}
183+
],
71184
"explorer/context": [
72185
{
73186
"when": "resourceExtname == .xml",

0 commit comments

Comments
 (0)