Skip to content

feat(ui-plugins): add Attendance Report (attendance-report) - #289

Open
ppppp2005-p wants to merge 11 commits into
zai-org:mainfrom
ppppp2005-p:feat/attendance-report
Open

ppppp2005-p wants to merge 11 commits into
zai-org:mainfrom
ppppp2005-p:feat/attendance-report

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) / 涉及的插件名称:attendance-report (UI Plugin, new)

What / 改动内容

New community UI plugin Attendance Report / 考勤统计: Turn the raw punch records from your time clock or attendance app into a monthly attendance report. Pick the export, set the shift hours, grace minutes, flexible start, lunch break, overtime rule, rest days and holidays, and see for each person and day the first and last punch, late arrivals, early leaves, missing punches, absences and overtime. Fix a forgotten punch or mark leave and business trips right in the table, then export a summary workbook and one workbook per person for them to check. Runs locally; no HR system or API keys.

  • Tools: attend_open, attend_edit, attend_status, attend_export (all share one side panel: file picker, settings, issue list, editable table, preview, export).
  • From any punch export: one row per punch with 姓名 and 打卡时间 (or 日期 + 时间), in CSV or Excel; duplicate punches are merged.
  • Your rules: shift start/end, late and early-leave grace, flexible start, lunch break, overtime threshold and minimum.
  • Calendar: Sat+Sun, Sun-only or no rest days; public holidays and make-up working days.
  • Every day judged: late, early leave, missing punch, absence, weekday and rest-day overtime, hours worked.
  • Fix in the table: add a forgotten punch, or write 请假/病假/出差 in the note to excuse the day.
  • Workbooks: a summary per person with the day-by-day detail highlighted, plus one workbook per person.
  • Scope (v0.1):
    • One shift per company in v0.1 — no rotating or night shifts across midnight.
    • Leave balances and payroll are not calculated.
  • Local only; writes only attendance-report/ 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 the punch export p100/attendance-report/punches.xlsx and exported the monthly summary and per-person sheets; demo video in the comments)

@ppppp2005-p

Copy link
Copy Markdown
Author

ZCode desktop demo (ZCode 4.0.0, macOS arm64)

attendance-report-demo.mp4

Flow shown:

  1. Installed attendance-report from a local marketplace built from this PR's branch.
  2. Asked ZCode to open the punch-clock export p100/attendance-report/punches.xlsx, fix anything that blocks the export, then export (attend_open, attend_edit only if needed, attend_export).
  3. attend_open picked the month 2026-11 automatically (October punches are ignored) and summarised 6 people: 4 late arrivals, 2 missing punches, 3 absences and 32.3 h of overtime. These are warnings only, so no edits were needed. Missing punches: 林晓雯 11-09 (no clock-in), 王磊 11-25 (no clock-out). Days with no punches: 王磊 11-12, 赵小雨 11-18 and 11-19. The side panel (考勤统计) shows the rules (month, 09:00–18:00, late / early grace, flexible start, lunch break, overtime start and minimum, weekend days, holidays and make-up workdays) and the summary chips.
  4. attend_export wrote attendance-report/punches/attendance-2026-11.xlsx (the summary) and one detail workbook per person in people/ (7 files). The last card is the final state.

演示流程:本地 marketplace 安装 → attend_open(自动识别 2026-11,6 人,4 次迟到、2 次缺卡、3 天缺勤、加班 32.3 小时,均为警告)→ attend_export 生成月度汇总表和每人明细。

@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