From db63f881be171c93eba62a0a50fff96ab999fff6 Mon Sep 17 00:00:00 2001 From: Claude Date: Tue, 24 Nov 2026 16:54:13 +0000 Subject: [PATCH 1/3] docs(skills): lookupAutofill copies a currency amount only within one currency The objectstack-data field-types rule states the cross-currency rule the platform ships: a declared lookupAutofill pair and the grid's same-named autofill copy move a currency amount only between fields in the same currency; otherwise the target is left as it was, the form says why, and nothing is converted. Paid for in the same file by trimming restated type-name cells. Claude-Session: https://claude.ai/code/session_01QSeKYo86w1wqy2z2fMrryr Co-authored-by: Claude --- skills/objectstack-data/rules/field-types.md | 47 +++++++++++--------- 1 file changed, 25 insertions(+), 22 deletions(-) diff --git a/skills/objectstack-data/rules/field-types.md b/skills/objectstack-data/rules/field-types.md index 66000636a37..252cb4e702a 100644 --- a/skills/objectstack-data/rules/field-types.md +++ b/skills/objectstack-data/rules/field-types.md @@ -40,15 +40,15 @@ const fields = { | `phone` | Phone numbers | `format` | | `password` | ⚠️ Masked-on-read input. On a generic object the value is stored **PLAINTEXT at rest**. Prefer `secret` for credentials; a generic `password` field triggers a build warning | `minLength`, `maxLength` | | `secret` | Reversible **encrypted-at-rest** credential (DB password, API key, token) — encrypted on write via `ICryptoProvider`, masked on read, fail-closed (ADR-0100) | — | -| `markdown` | Markdown-formatted content | `maxLength` | -| `html` | Raw HTML content | `maxLength` | -| `richtext` | WYSIWYG rich text editor | `maxLength` | +| `markdown` | Markdown content | `maxLength` | +| `html` | Raw HTML | `maxLength` | +| `richtext` | WYSIWYG editor | `maxLength` | ## Numbers | Type | When to Use | Config | |:-----|:------------|:-------| -| `number` | Generic numeric value | `min`, `max`, `precision`, `scale` | +| `number` | Numeric value | `min`, `max`, `precision`, `scale` | | `currency` | Monetary amounts | `currencyConfig` (→ Currency) | | `percent` | Percentage; stored as a fraction (0-1) unless the field declares `max` above 1 (`max: 100`), then whole points; seeds, defaults, API values use that scale | `min`, `max`, `precision`, `percentDisplay` — the read-only face: unset or `'bar'` draws a progress bar, `'plain'` the number alone, for a rate or a probability | @@ -56,15 +56,15 @@ const fields = { | Type | When to Use | Config | |:-----|:------------|:-------| -| `date` | Date only (no time component) | `defaultValue` | -| `datetime` | Full date + time | `defaultValue` | -| `time` | Time only (no date component) | `defaultValue`, `format` | +| `date` | Date only | `defaultValue` | +| `datetime` | Date + time | `defaultValue` | +| `time` | Time only | `defaultValue`, `format` | ## Logic | Type | When to Use | Config | |:-----|:------------|:-------| -| `boolean` | Standard checkbox | `defaultValue` | +| `boolean` | Checkbox | `defaultValue` | | `toggle` | Toggle switch (distinct UI from checkbox) | `defaultValue` | ## Selection @@ -94,22 +94,25 @@ options: [ | `tree` | Hierarchical self-reference | `reference` — optional; when written, this object's own name (any other object is refused at parse) | | `user` | Person picker — a lookup specialized to `sys_user` (reviewer, watchers). Stored identically to `lookup` | `multiple` (collaborators), `defaultValue: 'current_user'`, `deleteBehavior` (no default; declared, as on `lookup`: relationships.md → Delete Behaviors) | -**`lookupAutofill: [{ target, source, overwrite? }]`** (single-value `lookup` / -`master_detail`): a pick copies the picked record's `source` into this object's -`target` (`[{ target: 'unit_price', source: 'list_price' }]` on a product lookup), -in the form and the line-item grid. `target`: a field of this object an author -writes (not the lookup, `readonly` or computed), named once. `source`: a declared, -non-`internal` field of `reference` the target can hold. A pick fills an empty -target or an earlier pick's fill; `overwrite: true` always replaces. Client-side -only; in a grid a declared target leaves the same-named `autofill` copy. +**`lookupAutofill: [{ target, source, overwrite? }]`** (single-value only): a +pick copies the picked record's `source` into this object's `target` +(`unit_price` from a product's `list_price`), in the form and the line-item +grid. `target`: a field of this object an author writes (not the lookup, +`readonly` or computed), named once. `source`: a declared, non-`internal` field +of `reference` the target can hold. A pick fills an empty target or an earlier +pick's fill; `overwrite: true` always replaces. Client-side only; in a grid a +declared target leaves the same-named `autofill` copy. Either copy moves a +`currency` amount only between fields in the same currency (`fixed` or +per-record); else the target is left as it was and the form says why. Nothing +is converted. ## Media | Type | When to Use | Config | |:-----|:------------|:-------| | `image` | Image files (PNG, JPG, GIF, WebP) | `multiple` | -| `file` | Generic file attachments | `multiple` | -| `avatar` | User/profile picture | — | +| `file` | File attachments | `multiple` | +| `avatar` | Profile picture | — | | `video` | Video files | — | | `audio` | Audio files | — | @@ -135,17 +138,17 @@ Stored as JSON on the parent row, no separate table/FK: | Type | When to Use | Config | |:-----|:------------|:-------| -| `location` | Geographic coordinates (lat/lng) | — | +| `location` | Coordinates (lat/lng) | — | | `address` | Structured address (street, city, country) | — | | `code` | Syntax-highlighted code editor | `language` | | `json` | JSON data (untyped escape hatch) | — (validate with a `json_schema` validation rule on the object) | | `color` | Color picker | — | | `rating` | Star/heart rating | `max` (default 5) | -| `slider` | Numeric slider | `min`, `max`, `step` | -| `signature` | Digital signature pad | — | +| `slider` | Slider | `min`, `max`, `step` | +| `signature` | Signature pad | — | | `qrcode` | QR code / barcode | — | | `progress` | Progress bar | `min`, `max` | -| `tags` | Free-form tag input | — | +| `tags` | Free-form tags | — | | `vector` | AI/ML embeddings (semantic search, RAG) | `dimensions` (flat sibling, e.g. `1536`) | ## Common Field Configurations From 2218b90b6d60b48da669d026b7d0e0aa126b8de6 Mon Sep 17 00:00:00 2001 From: Claude Date: Tue, 24 Nov 2026 17:03:37 +0000 Subject: [PATCH 2/3] chore(changeset): skills patch for the lookupAutofill currency sentence Claude-Session: https://claude.ai/code/session_01QSeKYo86w1wqy2z2fMrryr Co-authored-by: Claude --- .changeset/36349-skills-lookupautofill-currency.md | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 .changeset/36349-skills-lookupautofill-currency.md diff --git a/.changeset/36349-skills-lookupautofill-currency.md b/.changeset/36349-skills-lookupautofill-currency.md new file mode 100644 index 00000000000..e5b5873447c --- /dev/null +++ b/.changeset/36349-skills-lookupautofill-currency.md @@ -0,0 +1,10 @@ +--- +'@objectstack/skills': patch +--- + +docs(skills): the data skill says a lookup pick copies a currency amount only between fields in the same currency + +Clause-②: no +Metadata-protocol: none + +`skills/objectstack-data` (`rules/field-types.md`) described `lookupAutofill` as an unconditional copy. It now states the rule the platform applies to a declared pair and to the line-item grid's same-named `autofill` copy: a `currency` amount is copied only between fields in the same currency (a `fixed` code or a per-record one); otherwise the target is left as it was and the form says why. Nothing is converted, so a line in another currency takes its price by hand. The sentence is paid for in the same file by trimming type-table cells that only restated the type name. No behaviour changes. From a141c91fb23ee32acda15b2ca0a7e687e189ed20 Mon Sep 17 00:00:00 2001 From: Claude Date: Tue, 24 Nov 2026 17:16:35 +0000 Subject: [PATCH 3/3] docs(skills): the catalog auto-fill bullet points at the currency rule Claude-Session: https://claude.ai/code/session_01QSeKYo86w1wqy2z2fMrryr Co-authored-by: Claude --- .changeset/36349-skills-lookupautofill-currency.md | 2 +- skills/objectstack-data/rules/relationships.md | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/.changeset/36349-skills-lookupautofill-currency.md b/.changeset/36349-skills-lookupautofill-currency.md index e5b5873447c..c00f95cb5c0 100644 --- a/.changeset/36349-skills-lookupautofill-currency.md +++ b/.changeset/36349-skills-lookupautofill-currency.md @@ -7,4 +7,4 @@ docs(skills): the data skill says a lookup pick copies a currency amount only be Clause-②: no Metadata-protocol: none -`skills/objectstack-data` (`rules/field-types.md`) described `lookupAutofill` as an unconditional copy. It now states the rule the platform applies to a declared pair and to the line-item grid's same-named `autofill` copy: a `currency` amount is copied only between fields in the same currency (a `fixed` code or a per-record one); otherwise the target is left as it was and the form says why. Nothing is converted, so a line in another currency takes its price by hand. The sentence is paid for in the same file by trimming type-table cells that only restated the type name. No behaviour changes. +`skills/objectstack-data` described `lookupAutofill` (`rules/field-types.md`) and the line-item grid's catalog auto-fill (`rules/relationships.md`) as unconditional copies. The first now states, and the second points to, the rule the platform applies to a declared pair and to the line-item grid's same-named `autofill` copy: a `currency` amount is copied only between fields in the same currency (a `fixed` code or a per-record one); otherwise the target is left as it was and the form says why. Nothing is converted, so a line in another currency takes its price by hand. The sentence is paid for in the same file by trimming type-table cells that only restated the type name. No behaviour changes. diff --git a/skills/objectstack-data/rules/relationships.md b/skills/objectstack-data/rules/relationships.md index cc3304e9186..43fff87fbf7 100644 --- a/skills/objectstack-data/rules/relationships.md +++ b/skills/objectstack-data/rules/relationships.md @@ -333,7 +333,8 @@ InvoiceLine = { clock: a scheduled flow too). - **Catalog auto-fill** — a `lookup` line field + sibling columns whose names match fields on the referenced record (e.g. `unit_price`, `description`) → - picking a record fills those cells. + picking a record fills those cells (a `currency` amount only in the same + currency: field-types.md → `lookupAutofill`). - **Sort field** — a numeric `position` / `sort_order` / `sequence` field is auto-detected, hidden from the grid, and stamped on drag-reorder.