docs: CR-4 — README Scope/create-Signatur auf v0.2.0 + panel-dep v0.1.1->v0.4.0 synct

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
Calic
2026-06-16 14:32:35 +00:00
parent d4654e74a9
commit 1368c0aebd

View File

@@ -9,7 +9,7 @@ registered via `register_action`.
**Version:** 0.2.0
**Lib-ID:** lib-core.crafting-display
**Requires:** lib-core.crafting v0.2.0, lib-core.panel v0.1.1, lib-core.inventory-list v0.1.0, lib-core.composition v0.3.0
**Requires:** lib-core.crafting v0.2.0, lib-core.panel v0.4.0, lib-core.inventory-list v0.1.0, lib-core.composition v0.3.0
**Tags:** crafting, ui, panel, widget, recipes
## Topology
@@ -34,11 +34,13 @@ engine's per-module non-transitive resolver: this lib does not call
them directly, but `crafting` does, and modules consuming this widget
must satisfy them.
## Scope (v0.1.0)
## Scope (v0.2.0)
v0.1 ships a minimal recipe-list widget:
v0.2 ships a recipe-list widget:
- `create(container_entity, opts)` — builds a panel-compatible widget_def
- `create(arg, opts)` — builds a panel-compatible widget_def; `arg` is a
bare container-entity-handle (Form 1, bw-compat) or a
`function() -> locale` factory (Form 2)
- `register_action` / `unregister_action` — context-menu actions (right-click on row)
- `set_icon_resolver` / `set_label_resolver` / `set_summary_resolver` — override default row content
- Render: label (left-aligned) + summary (right-aligned)
@@ -51,7 +53,7 @@ v0.1 ships a minimal recipe-list widget:
- Tooltip / hover-detail
- Stack-count display
**v0.2 hardening notes (deferred):**
**Hardening notes (deferred):**
- `is_known(ctx)` is called per recipe per frame; no per-frame memoization.
Large recipe-registries may want a cache layer.
- `is_known(ctx)` errors emit one `[WARN]` per failure per frame; no rate-
@@ -76,7 +78,7 @@ the panel dispatches input events as `{kind = "click", x, y, button}` or
`0xE0E0E0FF`), matching the `panel.DEFAULT_THEME` schema.
Right-click on a row invokes `panel.show_context_menu(x, y, actions)`
with the registered actions; left-click and wheel are ignored in v0.1.
with the registered actions; left-click and wheel are ignored.
## Row Visibility + Availability rules
@@ -217,9 +219,9 @@ Removes a context-menu action. Idempotent: no error if `label` was never registe
**Syntax:** `display.set_icon_resolver(widget_def: table, fn: function) -> void`
Replaces the icon resolver. `fn(recipe) -> any|nil` — return value is
opaque to v0.1 (default icon column not yet rendered; resolver is wired
in for v0.2 atlas-icon support and for tests).
Replaces the icon resolver. `fn(recipe) -> any|nil` the return value is
opaque to the widget (the icon column is not rendered yet; resolver is
wired in for atlas-icon support and for tests).
---
@@ -262,7 +264,7 @@ suffixing `"×N"` when `count>1`.
|--------------------|-------------------------------------------------------------|
| `label_resolver` | `recipe.name or recipe.id` |
| `summary_resolver` | `inputs[*].template` joined with `" + "`, `"×N"` when `count>1` |
| `icon_resolver` | returns `nil` (no icon in v0.1) |
| `icon_resolver` | returns `nil` (icon column not rendered yet) |
| `ctx_factory` | returns `{}` (empty table; replace to feed actor/skill ctx) |
## Test backdoors