Skip to content

feat(ui-plugins): add Barcode Label Maker (barcode-label-maker) - #255

Open
ppppp2005-p wants to merge 11 commits into
zai-org:mainfrom
ppppp2005-p:feat/barcode-label-maker
Open

ppppp2005-p wants to merge 11 commits into
zai-org:mainfrom
ppppp2005-p:feat/barcode-label-maker

Conversation

@ppppp2005-p

Copy link
Copy Markdown

Plugin type (required) / 插件类型(必填)

  • UI Plugin / 是 UI 插件 — provides MCP Apps interactive pages / 提供 MCP Apps 交互页面
  • Standard plugin / 普通插件(非 UI)
  • Not applicable / 不适用

Affected plugin name(s) / 涉及的插件名称:barcode-label-maker (UI Plugin, new)

What / 改动内容

New community UI plugin Barcode Label Maker / 条码标签打印: Turn a product sheet into barcode labels: EAN-13 and UPC-A with check-digit verification, Code 128 for SKUs and anything else, with product name and price, laid out on common A4/Letter label sheets (3×8, 4×10, 2×7, 5×13, 3×10). Set copies per product, skip labels already used on a sheet, fix codes in the panel and export a print-ready PDF plus SVG barcodes. Runs locally; no API keys.

  • Tools: labels_open, labels_edit, labels_status, labels_export (all share one side panel: file picker, settings, issue list, editable table, preview, export).
  • Columns: sku/货号, name/品名, price/售价, barcode/条码, qty/数量 (copies), in Chinese or English.
  • Barcode rules: 13 digits → EAN-13 with the check digit verified; a valid 12-digit UPC-A stays UPC-A; other 12-digit numbers get the EAN-13 check digit added; wrong check digits, letters or an empty barcode (the SKU is used) → Code 128. Every fallback is explained in the issue list.
  • Label sheets: A4 3×8, 4×10, 2×7, 5×13 and Letter 3×10, with an outline option for a test print and “skip used labels” for partly used sheets.
  • Label content: optional name and price, bars sized to the label with quiet zones, human-readable digits under the bars.
  • Output: labels.pdf (print at 100% / actual size), one SVG per product and a CSV of the encoded values.
  • Scope (v0.1):
    • Linear barcodes only (EAN-13, UPC-A, Code 128); for QR codes use a QR tool. No GS1-128 application identifiers in v0.1.
    • Barcode numbers are not registered for you — use numbers your business owns (e.g. from GS1) for retail.
    • Custom label sizes beyond the five presets are not in v0.1.
  • Local only; writes only barcode-label-maker/ in the workspace. Workspace paths are checked so symlinks cannot lead reads or writes outside the workspace (regression test included).
  • Tests: vitest unit + MCP tool tests on real sample files, and a browser e2e with the official AppBridge host (panel → open → edit → export).

A ZCode Desktop demo recording is attached in the comments. / ZCode 桌面版演示录屏见评论。

Self-check / 自查清单

  • Plugin name is unique kebab-case; new external plugin directory is external_plugins/<name>/
  • Usage category is set (productivity)
  • Plugin type and affected names are declared above
  • version 0.1.0 in both plugin.json and marketplace.json
  • README.md (EN) and README_CN.md (中文) both provided and equivalent
  • description_i18n has both en and zh-CN
  • No secrets, machine-specific paths, or private dependencies
  • Model/API/network dependencies documented
  • python3 scripts/validate.py and python3 scripts/build_dist.py pass locally
  • Exercised in ZCode Desktop (ZCode 4.0.0, macOS arm64: installed from a local marketplace, opened p100/barcode-label-maker/products.xlsx and exported the label PDF, per-product SVGs and the CSV; demo video in the comments)

@ppppp2005-p

Copy link
Copy Markdown
Author

ZCode desktop demo (ZCode 4.0.0, macOS arm64)

barcode-label-maker-demo.mp4

Flow shown:

  1. Installed barcode-label-maker from a local marketplace built from this PR's branch.
  2. Asked ZCode to open p100/barcode-label-maker/products.xlsx and export right away (only labels_open and labels_export).
  3. labels_open read 6 products / 13 labels on 1 sheet of A4 3×8 (70×37 mm). The side panel (条码标签打印) shows the label-sheet settings, the product rows and 3 notes: MUG-010 has no barcode (printed as Code 128 from the SKU), BAG-77 had 12 digits (check digit 2 added), GIFT-9 has a wrong EAN-13 check digit (encoded as Code 128 instead).
  4. labels_export wrote barcode-label-maker/products/: labels.pdf, one SVG per product in svg/, and barcodes.csv. The last card shows the final state and the label PDF.

演示流程:本地 marketplace 安装 → labels_open(6 个商品、13 张标签、A4 3×8 一张纸;3 条提示:无条码改用 Code 128、12 位补校验位、EAN-13 校验位错误)→ labels_export 生成标签 PDF、SVG 和 CSV。

@panda920

Copy link
Copy Markdown
Collaborator

✅ Internal validation passed. A ZCode maintainer will review the change next; after acceptance, release checks run separately and this PR is closed automatically.

This branch has not been deployed

No deployments
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.

2 participants