
BOM Compare Tool
BOM Compare Tool
oshwhub-official0BOM Compare - BOM Comparison Tool
中文 | English
An EasyEDA Pro extension for comparing differences between two BOM (Bill of Materials) files, presenting changes visually in a table format.
Features
Core Features
- Multi-format Support: Import CSV, TXT, XLS, XLSX formats
- Smart Parsing: Auto-detect file encoding (UTF-8, GBK, GB2312), header rows, and delimiters
- Column Mapping: Auto-match common Chinese/English column name variants with manual configuration support
- Diff Comparison: Compare column by column based on Designator, highlighting differences
- Diff Navigation: Jump to previous/next difference quickly, filter by type (Added/Missing/Changed/Same)
- Synchronized Scrolling: Left and right panels scroll together for easy line-by-line comparison
- Export Report: Export comparison results in CSV/XLSX format
User Experience
- Drag & Drop Import: Load files by dragging them directly onto the panel
- Virtual Scrolling: Smooth rendering for BOM data with tens of thousands of rows
- Internationalization: Chinese/English interface switching
- Keyboard Shortcuts: Ctrl+D to compare, F3/Shift+F3 to navigate differences, Ctrl+F to search
- Column Resizing: Drag to adjust column width, double-click to auto-fit content
- Search & Locate: Search by designator or keyword to quickly find target rows
- Cell Copy: Click cell to quickly copy content
- Row Link Highlight: Hover over a row to automatically highlight the corresponding designator row in the opposite panel
Advanced Features
- Duplicate Column Detection: Automatically detect and warn about duplicate designators to avoid matching errors
- Column Settings: Customize which columns participate in comparison
- Header Diff Comparison: Specialized comparison of header differences between two files
- Detail Popup: Horizontal comparison layout showing detailed component change information
- Real-time Editing: Update comparison results in real-time after editing data
- Recent Files: Record recently opened file paths for quick reloading
Layout
Side-by-side dual-panel layout with the old file on the left and the new file on the right:
- Top: File action bar (Import, Clear, Export)
- Middle: BOM data table (resizable columns, sorting, search)
- Bottom: Summary bar (statistics for Same/Changed/Added/Missing rows)
Main Interface Screenshots

Diff Highlighting
| Color | Meaning |
|---|---|
| Blue/Cyan cell | Value differs between old and new files |
| Orange/Yellow row | Component exists only in the new file |
| Red/Pink row | Component exists in the old file but missing in the new |
| No highlight | Identical |
Diff Display Screenshots


Development
Requirements
- Node.js >= 20.17.0
Install Dependencies
npm install
Common Commands
npm run compile # Compile the project
npm run build # Compile + package the extension
npm run lint # Code linting
npm run fix # Auto-fix code style
npm run test # Run tests (watch mode)
npm run test:run # Run tests (single run)
Project Structure
├── src/ # Extension entry
│ └── index.ts # Register menu, open iframe window
├── iframe/ # Main UI (iframe embedded page)
│ ├── index.html # Page entry
│ ├── styles/ # Styles (CSS variables, themes, layout, tables)
│ │ ├── variables.css
│ │ ├── theme.css
│ │ ├── layout.css
│ │ └── table.css
│ └── src/
│ ├── main.ts # Initialization entry
│ ├── types.ts # Type definitions
│ ├── locales/ # i18n resources
│ │ ├── zh-Hans.ts
│ │ └── en.ts
│ ├── core/ # Core logic
│ │ ├── parser/ # File parsing (CSV, Excel)
│ │ ├── comparator.ts # Comparison algorithm
│ │ ├── column-mapper.ts # Column mapping
│ │ ├── column-config.ts # Column configuration
│ │ └── exporter.ts # Export
│ ├── ui/ # UI components
│ │ ├── table.ts # Table component
│ │ ├── toolbar.ts # Toolbar
│ │ ├── state.ts # State management
│ │ ├── summary.ts # Summary bar
│ │ ├── dialog.ts # Dialog
│ │ ├── column-settings-dialog.ts # Column settings dialog
│ │ ├── sheet-selector.ts # Sheet selector
│ │ ├── drop-zone.ts # Drop zone
│ │ ├── editable.ts # Editable cell
│ │ ├── loading.ts # Loading state
│ │ ├── tooltip.ts # Tooltip
│ │ ├── column-resize.ts # Column resize
│ │ └── layout.ts # Layout
│ └── utils/ # Utility functions
│ ├── i18n.ts # Internationalization
│ ├── encoding.ts # Encoding detection
│ ├── hotkeys.ts # Keyboard shortcuts
│ └── storage.ts # Local storage
├── tests/ # Test cases and sample data
│ ├── comparator.test.ts
│ ├── csv-parser.test.ts
│ └── data/ # Test sample data
├── locales/ # Extension menu i18n
│ ├── zh-Hans.json
│ ├── en.json
│ └── extensionJson/ # Extension registration menu translation
│ ├── zh-Hans.json
│ └── en.json
├── docs/ # Documentation
│ ├── prd.md # Product requirements document
│ ├── features.md # Feature requirements document
│ ├── dev-plan.md # Development plan
│ └── easyeda-iframe-bug-workaround.md
├── config/ # esbuild build config
│ ├── esbuild.common.ts
│ └── esbuild.prod.ts
├── build/ # Packaging scripts
│ └── packaged.ts
├── images/ # Image resources
│ └── logo.png
├── dist/ # Build output (gitignore)
├── extension.json # Extension config
├── package.json # Project dependencies and scripts config
├── tsconfig.json # TypeScript compilation config
├── vitest.config.ts # Vitest testing config
└── eslint.config.mjs # ESLint linting config
Tech Stack
- TypeScript (strict mode)
- esbuild (build)
- Vitest (testing)
- xlsx / papaparse / jschardet (file parsing)
- @jlceda/pro-api-types (EDA extension API)
Usage
Quick Start
- After installing the extension, click BOM Compare in the top menu of EasyEDA Pro's homepage, schematic editor, or PCB editor
- Click the "Import" button on the left panel to select the old version BOM file
- Click the "Import" button on the right panel to select the new version BOM file
- Click the "Run BOM Compare" button, or use the shortcut Ctrl+D
- View the comparison results and use the diff navigation buttons to quickly locate changes
Detailed Usage Steps
Step 1: Load Files
- Method 1: Click the "Import" button to select a BOM file from the file selector
- Method 2: Drag and drop the file directly onto the corresponding panel area
Supported file formats:
- CSV (.csv)
- TXT (.txt)
- XLS (.xls)
- XLSX (.xlsx)
Step 2: Configure Column Mapping (if needed)
If file column names cannot be automatically matched, the system will display a column mapping configuration panel:
- Left side shows the source file column names
- Right side selects the corresponding standard column names
- You can choose "Ignore this column"
- Configuration is automatically saved and applied next time you load files of the same format

Step 3: Run Comparison
- Click the "Run BOM Compare" button, or use the shortcut Ctrl+D
- The system will compare based on Designator as the reference
- By default, all columns are compared, but you can customize this in column settings
Step 4: View Results
- The bottom summary bar displays statistics: Same, Changed, Added, Removed row counts
- Use the "Previous Difference" / "Next Difference" buttons to quickly jump
- Use the filter to view by type: All/Changed Only/Added Only/Removed Only/Same Only
- Click the "Detail" button at the end of the row to view horizontal comparison details
Step 5: Export Report
- Click the "Export" button to export the current BOM data
- Click "Export Report" to generate a report containing change summary and detailed differences
FAQ
Q: What file formats are supported?
A: CSV, TXT, XLS, XLSX formats are supported. The system automatically detects file encoding (UTF-8, GBK, GB2312).
Q: How do I compare two BOM files with different column names?
A: The system automatically matches common Chinese/English column name variants. If automatic matching fails, you can manually specify the correspondence.
Q: What is the comparison reference?
A: Designator is used as the comparison reference. The system matches rows on the left and right sides based on designator, then compares the values of other fields column by column.
Q: How do I quickly locate differences?
A: Use the "Previous Difference" / "Next Difference" buttons, or use the shortcuts F3/Shift+F3. You can also use the filter to view by type.
Q: What does the exported report contain?
A: The exported report contains three sheets: Change Summary, Difference Details, and Full Comparison.
Keyboard Shortcuts
| Shortcut | Function |
|---|---|
| Ctrl+D | Run BOM comparison |
| F3 | Next difference |
| Shift+F3 | Previous difference |
| Ctrl+F | Search |
Changelog
See CHANGELOG.md for version update history.
v1.2.4
优化
- 完成多语言优化
v1.2.3
新增
- 为搜索输入框添加清除按钮,方便快速清空搜索内容
- 扩展语言自动跟随主程序设置,无需手动切换
修复
- 修复语言切换时列宽调整手柄丢失问题
- 修复列宽调整与列名映射功能冲突,扩大调整手柄区域
- 修复表格滚动时文本在表头连接处可见的问题
- 添加 BOM Compare 菜单项的中英文翻译
优化
- 优化详情列文本居中对齐,提升视觉体验
- 优化导出按钮显示逻辑,统一使用 CSS 类控制
- 实现左右表格滚动高度一致性,避免不对称
- 优化表头分割线视觉一致性,消除粗细差异
- 动态计算操作列宽度,适应中英文双语显示
v1.2.2
新增
- 实现全局搜索和筛选功能,支持文本搜索和差异类型筛选
- 文件导入后自动触发搜索/筛选功能
- 差异导航和筛选按钮动态显示/隐藏,清空/导入文件时自动恢复非对比状态
- 筛选模式下也显示高亮效果,提升视觉反馈
- 表头详情按钮条件显示,保持列一致性
- 使第一列(行号列)支持列宽调整
修复
- 实现表头固定功能,预设表头和原始表头在滚动时保持可见
- 修复预设表头操作列 sticky 定位失效问题
- 修复列宽调整功能并优化用户体验
- 修复文本搜索和筛选在对比后的行为不一致问题
- 修复搜索/筛选模式切换时行显示问题
优化
- 优化搜索高亮样式,使用 outline 替换 border
- 优化拖拽区域提示语,删除冗余文字
1.2.1
优化
- 将列名匹配从模糊匹配改为精准匹配,减少误识别
- 优化界面文字颜色对比度,提升深色背景下的可读性
变更
- 为 BOM Compare 菜单项添加省略号,遵循弹窗类型菜单项的 UI 规范
- 修复 comparator.ts 中的 TypeScript 类型错误
- 扩展版本从 v1.2.0 升级至 v1.2.1
1.2.0
新增
- 完善中英文 README 文档,添加详细的功能特性说明
- 新增详细的使用步骤指南,包含快速开始和5步详细操作说明
- 新增常见问题(FAQ)章节,解答用户常见疑问
- 新增快捷键列表,列出所有支持的键盘操作
- 为界面截图预留占位符,方便后续添加实际截图
- 更新项目结构说明,详细列出所有目录和文件
变更
- 扩展版本从 v1.1.0 升级至 v1.2.0
- 更新 .edaignore,允许 README 文件被扩展加载
- 更新扩展 logo 图片
- 删除 docs 文件夹下的开发文档(dev-plan.md、features.md、prd.md、progress.md、easyeda-iframe-bug-workaround.md)
1.1.0
新增
- 添加重复列检测和警告系统
修复
- 修复diff表格列数不一致导致详情列sticky定位失效的问题
1.0.0
初始版本

Type
Keyword
Extension Info
| Version | v1.2.4 |
| Author | EasyEDA |
| Published at | 2026-06-16 08:29:42 |
| Name | bom-compare |
| UUID | c78c9305280f48c0ad48d53803e7f1b2 |
| Works with | ^3.0.0 |
| Report | Report abuse |
Comment