Files
likang 678058c940
CI / Select checks (push) Has been cancelled
CI / Format and repository checks (push) Has been cancelled
CI / Compile RISC-V (manual) (push) Has been cancelled
Docker / image (push) Has been cancelled
Generated files / Regenerate and commit (push) Has been cancelled
Kernel rig / Select the rig areas (push) Has been cancelled
Lists / Design format changes merge cleanly (push) Has been cancelled
Lists / Lists are sorted one item per line (push) Has been cancelled
Packaging lint / lint (push) Has been cancelled
Pages / build (push) Has been cancelled
CI / Dependency advisories (push) Has been cancelled
CI / Quick compile (push) Has been cancelled
CI / Native Linux Clippy (push) Has been cancelled
CI / Build tests (push) Has been cancelled
CI / Native Linux tests (push) Has been cancelled
CI / GPU path tests (1/4) (push) Has been cancelled
CI / GPU path tests (2/4) (push) Has been cancelled
CI / GPU path tests (3/4) (push) Has been cancelled
CI / GPU path tests (4/4) (push) Has been cancelled
CI / Action matrix (1/16) (push) Has been cancelled
CI / Action matrix (10/16) (push) Has been cancelled
CI / Action matrix (11/16) (push) Has been cancelled
CI / Action matrix (12/16) (push) Has been cancelled
CI / Action matrix (13/16) (push) Has been cancelled
CI / Action matrix (14/16) (push) Has been cancelled
CI / Action matrix (15/16) (push) Has been cancelled
CI / Action matrix (16/16) (push) Has been cancelled
CI / Action matrix (2/16) (push) Has been cancelled
CI / Action matrix (3/16) (push) Has been cancelled
CI / Action matrix (4/16) (push) Has been cancelled
CI / Action matrix (5/16) (push) Has been cancelled
CI / Action matrix (6/16) (push) Has been cancelled
CI / Action matrix (7/16) (push) Has been cancelled
CI / Action matrix (8/16) (push) Has been cancelled
CI / Action matrix (9/16) (push) Has been cancelled
CI / Action matrix determinism (push) Has been cancelled
CI / Property tests (many cases) (push) Has been cancelled
CI / Doc tests (push) Has been cancelled
CI / Reference tests (push) Has been cancelled
CI / Windows D3D12 FXC shaders (push) Has been cancelled
CI / Windows app startup (push) Has been cancelled
CI / ci (push) Has been cancelled
CI / Compile WebAssembly (push) Has been cancelled
CI / Nightly alert (push) Has been cancelled
Kernel rig / Build the CLI (push) Has been cancelled
Kernel rig / Kernel rig (${{ matrix.shard }}) (push) Has been cancelled
Kernel rig / kernel-rig (push) Has been cancelled
Pages / deploy (push) Has been cancelled
优化skill
2026-11-16 11:32:34 +08:00

2.8 KiB

name, description
name description
makecad-ui Use when adding or changing a makeCAD dialog, panel, menu, overlay, canvas, camera input, slider, icon or colour in crates/ui-egui. Covers the single UI container, the UI kit, navigation::handle, theme tokens, command icons and UI scenarios.

Dialogs and UI

The UI is thin: it reads engine state and acts through app.run(id, params) or app.start(id). A dialog is a form that builds the parameters of a command (skills/makecad-commands/SKILL.md). The full control list is docs/ui-kit.md.

One outer container

  • All panels, floating sheets, menus, overlays and platform UI windows use ui_kit::Container, directly or through Panel, Window, Confirm and Menu. Declare the semantic Surface; workspace panels use its shared layout policy and chrome.
  • System and report windows use ui_kit::Window; its low-level host builder is kit-private.
  • Do not construct raw egui hosts, outer popup or window frames, or shadows in feature modules.
  • cargo xtask ui-containers checks source and examples in all current and future crates and apps, recursively. It runs in the fast repository CI job and in cargo xtask ci, with no caller allowances. The inventory and the legitimate content and native exceptions are in docs/ui-container-audit.md.

Controls and colour

  • Colours, typography, dimensions and spacing come from theme::Tokens (crates/ui-egui/src/theme.rs). No literal colours in feature code.
  • Sliders only through ui_kit::slider. Form rows use row, expr_row, text_row, choice_row and count_row from crate::ui_kit (crates/ui-egui/src/ui_kit/).
  • Confirmations use ui_kit::Confirm; the old Prompt element is gone.

One set of camera controls

Every page or canvas with a camera (viewport, Render preview, a flat pattern or drawing page) calls navigation::handle (crates/ui-egui/src/navigation.rs) with its NavCaps (orbit off for flat 2D pages). Never hand-roll camera input from drags, the wheel or pinch; hand_rolled_camera_input_is_rejected fails if a page does.

Icons

Command icons are original SVG masters compiled through crates/ui-egui/src/icon_svg.rs. Read assets/AGENTS.md, assets/icons/ui/AGENTS.md and assets/icons/ui/STYLE_GUIDE.md first, add the ATTRIBUTION.md row, and run cargo xtask icons and cargo xtask assets. See skills/makecad-ground-rules/SKILL.md.

Text

Every label, tooltip and message goes through the catalogs: skills/makecad-ui-text/SKILL.md. A new behaviour that is on by default: skills/makecad-preferences/SKILL.md.

Look at the result

Run the app, drive it and read the screenshot: skills/makecad-agent-tools/SKILL.md. A UI scenario (crates/ui-egui/tests/scenarios/*.json) covers the clicks; see skills/makecad-tests/SKILL.md. Work that takes long must not block the window: skills/makecad-performance/SKILL.md.