Skip to content

feat: add command-line -LAYER support#204

Merged
mlightcad merged 1 commit intomainfrom
feat/layer
Apr 10, 2026
Merged

feat: add command-line -LAYER support#204
mlightcad merged 1 commit intomainfrom
feat/layer

Conversation

@mlightcad
Copy link
Copy Markdown
Owner

Summary

  • Add a new AutoCAD-style -LAYER command implementation in cad-simple-viewer with command-line-only interaction (no dialog dependency).
  • Register and export the new command so it is available through the default command stack.
  • Add English and Chinese i18n entries for command description, prompts, and keyword labels.
  • Update README checklists (EN/ZH) to mark several implemented capabilities as completed.

Why

  • Layer management in command-line workflows was missing in cad-simple-viewer.
  • The project already supports keyword-driven, branching command patterns; -LAYER fills a core CAD command gap and aligns behavior with AutoCAD-style no-UI usage.

What Changed

  • Added AcApLayerCmd with top-level branches:
    • ?, Make, Set, New, On, Off, Color, Freeze, Thaw, Lock, Unlock, Description.
  • Implemented batch layer name parsing (*, comma-separated names), missing-layer reporting, and user notifications via event bus.
  • Implemented explicit flag-bit updates for freeze/lock state changes to ensure thaw/unlock behavior is deterministic.
  • Added layer listing output (console.table) plus command-line summary feedback.
  • Wired command into registration:
    • import + registration under system command group as -layer.
    • export from command index.
  • Added i18n content in:
    • packages/cad-simple-viewer/src/i18n/en/command.ts
    • packages/cad-simple-viewer/src/i18n/zh/command.ts
    • packages/cad-simple-viewer/src/i18n/en/jig.ts
    • packages/cad-simple-viewer/src/i18n/zh/jig.ts
  • Added detailed TypeDoc comments across AcApLayerCmd type alias, class, and methods.
  • Updated README progress checklist items in:
    • README.md
    • README.zh-CN.md

Risks / Notes

  • -LAYER currently covers core branches but not full AutoCAD parity (e.g., additional subcommands like linetype/lineweight/plot/rename are not included yet).
  • Layer listing is emitted to browser console (console.table), which is practical for dev/debug but may need refinement for production UX.
  • README checklist updates are included in the same change set; reviewers may prefer separating documentation-only edits from command implementation.

@mlightcad mlightcad self-assigned this Apr 10, 2026
@mlightcad mlightcad added the enhancement New feature or request label Apr 10, 2026
@mlightcad mlightcad merged commit 905d3f4 into main Apr 10, 2026
2 checks passed
@mlightcad mlightcad deleted the feat/layer branch April 10, 2026 11:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant