Skip to content

fix(fields): one asset check, translations respect per-field localization - #100

Merged
Madraka merged 1 commit into
mainfrom
feat/fields-followups
Oct 23, 2026
Merged

Madraka merged 1 commit into
mainfrom
feat/fields-followups

Conversation

@Madraka

@Madraka Madraka commented Oct 23, 2026

Copy link
Copy Markdown
Contributor

Two follow-ups from RFC-0041 (#95, #97).

1. One field-asset check

  • fieldAssetIssues({defs, refs, kept, lookup, skip?}) in @cloudhal/core-ts/media. It takes a lookup function, so it doesn't touch storage.
  • The rules: an image field needs an image of this site, rich-text asset: references must exist, and a retired file can't be newly used. The codes and messages are the same as before.
  • Used in three places: the store write (planEntryFields), the store's diagnose, and the MCP precheck. The copy in mcp-server is deleted.
  • Behaviour change in MCP: it could refuse writes the store accepted (a retired asset already used by the entry under another field). It now matches the store exactly.

2. RFC-0041 §5 in the translation tools

  • get_translation_source: source no longer carries fields. A new fields output holds only the localized text and rich-text values to translate, and a new sharedFields output lists the non-localized keys. Glossary matching includes the field values.
  • save_translation:
    • It takes a fields input. Non-localized values are refused in precheck with field_not_localized, with paths in details.issues, before anything is written.
    • A new translation in the same site no longer copies field values: localized values fall back to the original's, and shared values are read from it.
    • Language editions, and collections without definitions, still copy as before.
  • Studio: the hand-written translation draft copies only localized values.

Tests

  • core-ts: the new tests pass on sqlite and D1. Locally the Miniflare DO tail fails with EADDRNOTAVAIL.
  • mcp-server: 160/160.
  • Studio: 1241/1241.
  • Typecheck, size check, the MCP doc check and design lint pass.

Changeset: patch (core-ts, mcp-server).

🤖 Generated with Claude Code

…tion

- Field asset rules (an image field needs an image of this site,
  rich-text asset: references must exist, a retired file is not newly
  used) live once in @cloudhal/core-ts/media (fieldAssetIssues, with a
  lookup function); the store and the MCP precheck share it, so MCP no
  longer refuses writes the store accepts.
- RFC-0041 §5: get_translation_source returns only the localized text
  and rich-text values plus the shared keys; save_translation takes
  fields and refuses non-localized ones in precheck
  (field_not_localized); a new translation no longer copies field
  values. Studio's hand-written draft copies only localized values.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Madraka <8898640+Madraka@users.noreply.github.com>
@Madraka
Madraka merged commit 98fec2b into main Oct 23, 2026
4 checks passed
@Madraka
Madraka deleted the feat/fields-followups branch October 23, 2026 06:34
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.

1 participant