Skip to content

feat(form): annotated_image field — mark point/region (#24) - #150

Merged
iret77 merged 1 commit into
mainfrom
feat/issue-24-annotated-image
Aug 1, 2026
Merged

feat(form): annotated_image field — mark point/region (#24)#150
iret77 merged 1 commit into
mainfrom
feat/issue-24-annotated-image

Conversation

@iret77

@iret77 iret77 commented Jul 31, 2026

Copy link
Copy Markdown
Contributor

Neues annotated_image-Formularfeld: Bild anzeigen und Punkt (mode:point), Region (region) oder beides (both) markieren. Rückgabe normalisiert 0..1 plus intrinsische Pixelgröße (natural) für verlustfreie Pixel-Rückrechnung. src nutzt die bestehende imageresolve-Auflösung.

Build: FE (svelte-check/vite) grün; Rust-Edits trivial. Mac-E2E offen: Interaktion je Modus, required-Gating, Overlay-Ausrichtung bei Resize.

Closes #24


Batch-Kontext: Teil eines 6-PR-Sets (#141, #146, #23, #24, #25, #17) aus parallelen Sub-Sessions, das zusammen einen Release ergibt.

  • Kein Versions-Bump in diesem PR — die Version wird gesammelt beim Release gebumpt (keine Rapid Releases).
  • Empfohlene Merge-Reihenfolge: 4/6. Spätere PRs werden nach vorherigen Merges auf main rebased (Hotspots: mcp.rs, http.rs, skill.md, CHANGELOG.md, server.py).
  • Kein Push auf main; Merge via PR (AGENTS.md). CI baut/testet; interaktives Dialog-E2E nur am Mac verifizierbar.

View with [code]smith Autofix with [code]smith
Need help on this PR? Tag @codesmith-bot with what you need. Autofix is disabled.

@iret77
iret77 force-pushed the feat/issue-24-annotated-image branch from 0284862 to 68a096a Compare August 1, 2026 09:50
#24)

New form field that shows an image and lets the user mark it directly —
for spatial answers words carry poorly ("where should the logo go?",
"which part do I crop?", "point at the bug in this screenshot").

- mode "point" (default): click a single crosshair marker
- mode "region": drag a rectangle
- mode "both": Point/Region toggle; both can be set

`src` reuses the existing image resolution (absolute / ~/ local path
inlined by the bridge, http(s):// fetched Mac-side, or data:) via the
shape-agnostic imageresolve walker — no new resolution path. Result,
under the field name, is normalized 0..1 and resolution-independent:
{point:{x,y}|null, region:{x,y,w,h}|null, natural:{width,height}|null};
`natural` (intrinsic pixel size, set on load) recovers pixels losslessly.
`required` gates the submit action on an annotation being present.

Interaction is pointer-capture based (works for mouse/touch/pen); a
sub-threshold region drag is treated as a stray click and discarded
rather than committing a degenerate rect. Overlay is an SVG viewBox
0..100 stretched over the image so markers track any display size.

- Form.svelte: field type, init, validation, render + styles
- http.rs: add to KNOWN_FIELD_KINDS (+ validation test)
- dialog.rs: window-size estimate arm
- mcp.rs / python server.py: form tool-description field catalog
- docs/skill.md, CHANGELOG.md

Backend build/test not runnable on this headless Linux host (Tauri GUI
crate needs GTK/glib system libs); frontend typecheck + build are green.
@iret77
iret77 force-pushed the feat/issue-24-annotated-image branch from 68a096a to 176e3ff Compare August 1, 2026 09:54
@iret77
iret77 merged commit 4a4c22a into main Aug 1, 2026
4 checks passed
@iret77
iret77 deleted the feat/issue-24-annotated-image branch August 2, 2026 20:46
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.

Add annotated image (mark point/region)

1 participant