openpencil/tools
Kayshen-X 68a7e534fd feat(panels,canvas): editable gradients/effects + SVG/image import + locale-aware dialogs
Continues the gradient + property-panel polish from the previous
commit and rounds out two new flows the TS app already has:

Gradient stops + effects:
- ColorTarget gains GradientStop(i) + EffectColor(i); HSV picker
  preserves alpha across hue/SV drags so a transparent stop stays
  transparent. Hex pill stays 6-char; alpha is reattached at commit
  and the swatch sits on a 2x2 alpha checker so #00000000 reads as
  transparent rather than empty.
- Effects section reflowed into card-style blocks (image #9 spec):
  title + minus, X/Y and Blur/Spread 2-col grids, color row with
  swatch + rgba(...) text; clicking the swatch opens an HSV picker
  bound to that effect index via SetEffectColor.
- Press dispatch on both hosts anchors picker overlays at the
  clicked y so they pop adjacent to the swatch instead of the top.

Image + SVG import (toolbar + Fill section "图片" row):
- New FileAction::ImportImageOrSvg / PickFillImage; persistence_image
  pops rfd, decodes raster as data: URL, inserts an Image node or
  rewrites the selected node's primary fill.
- ImageNode actually renders on the canvas: NodePayload + SceneNode
  carry image_src, canvas_viewport_paint.rs decodes the data URL
  once and hands raw bytes to RenderBackend::draw_image with a
  src-hash cache id. Grey placeholder paints only when decode fails
  so transparent PNGs don't get a grey matte underneath.
- SVG import ported to TS-parity (packages/pen-engine svg-parser):
  recursive <g> tree walk with inherited fill/stroke/style="...",
  viewBox-aware scaling with maxDim cap, multi-subpath split, raw
  d preserved on PathNode. Imports land wrapped in a Group named
  after the source file.

Locale-aware first run:
- settings_io detects the OS locale (LC_ALL/LANG/LC_MESSAGES with
  zh-Hans/zh-Hant heuristics) and seeds editor_ui.locale before
  settings.json is read; persisted user choice still wins.
- macOS bundle declares CFBundleLocalizations + AllowMixedLocalizations
  so NSOpenPanel / NSSavePanel render in the same language as the
  rest of the chrome.

Web host kept exhaustive across the new variants (PickFillImage,
OpenEffectColorPicker, ColorTarget::EffectColor, GradientStop). Two
new files: persistence_image.rs (file-pick handlers, ≤120 lines) and
svg_path_data.rs (path-d tokenizer + bbox + normaliser, split from
svg_import.rs to stay under the 800-line cap). 277 op-editor-core
tests pass.
2026-05-23 23:11:38 +08:00
..
bundle-macos.sh feat(panels,canvas): editable gradients/effects + SVG/image import + locale-aware dialogs 2026-05-23 23:11:38 +08:00
check-jian-boundaries.sh docs: translate remaining Chinese source comments to English 2026-05-17 09:33:41 +08:00
check-wasm-bundle.sh chore(ci): re-point tooling + CI workflows at the op-host-* crates 2026-05-17 00:01:35 +08:00
check-widget-boundary.sh chore(ci): re-point tooling + CI workflows at the op-host-* crates 2026-05-17 00:01:35 +08:00
convert-locales.py fix(i18n): point convert-locales.py output at the op-i18n crate 2026-05-16 14:25:58 +08:00
dump-diagnostics-golden.ts feat(ai): implement op-design-lint Rust crate (S1) 2026-05-23 18:39:08 +08:00
fetch-skia-artifact.sh build(step-1b): add tools/fetch-skia-artifact.sh (Variant A release path) 2026-05-09 21:04:00 +08:00
merge-settings-i18n.py feat(desktop): winit shell platform integration 2026-05-18 08:29:36 +08:00