diff --git a/.changeset/20558-comment-reactions-mentions-description.md b/.changeset/20558-comment-reactions-mentions-description.md new file mode 100644 index 00000000000..59d33873f85 --- /dev/null +++ b/.changeset/20558-comment-reactions-mentions-description.md @@ -0,0 +1,16 @@ +--- +'@objectstack/plugin-audit': patch +--- + +`sys_comment.reactions` and `sys_comment.mentions` now describe the shape they actually store (#20558) + +The two field descriptions are served metadata (field help in the console, and what an AI client reads before it seeds a comment), and both named a shape no producer writes: + +| Field | Description was | Description is now | Stored value | +| --- | --- | --- | --- | +| `reactions` | `JSON array of emoji reaction objects` | `JSON object mapping each emoji to the list of user ids who reacted` | `{"👍":["usr_1","usr_2"]}` | +| `mentions` | `JSON array of @mention objects` | `JSON array of the user ids @mentioned in the comment` | `["usr_1","usr_2"]` | + +The console's record discussion panel reads and writes `reactions` as that map, and writes `mentions` as that list of ids; the `collab.mention` notification hook reads the ids. + +Description text only: no stored value, validation rule or hook changes, and nothing to migrate. The English translation bundle is regenerated from the source description, and the zh-CN, ja-JP and es-ES help texts for both fields are rewritten to match (values only, no key added or dropped). diff --git a/packages/plugins/plugin-audit/src/objects/sys-comment.object.ts b/packages/plugins/plugin-audit/src/objects/sys-comment.object.ts index c5c85c2604a..534c4c1ad9a 100644 --- a/packages/plugins/plugin-audit/src/objects/sys-comment.object.ts +++ b/packages/plugins/plugin-audit/src/objects/sys-comment.object.ts @@ -118,14 +118,14 @@ export const SysComment = ObjectSchema.create({ mentions: Field.textarea({ label: 'Mentions', required: false, - description: 'JSON array of @mention objects', + description: 'JSON array of the user ids @mentioned in the comment', group: 'Body', }), reactions: Field.textarea({ label: 'Reactions', required: false, - description: 'JSON array of emoji reaction objects', + description: 'JSON object mapping each emoji to the list of user ids who reacted', group: 'Body', }), diff --git a/packages/plugins/plugin-audit/src/translations/en.objects.generated.ts b/packages/plugins/plugin-audit/src/translations/en.objects.generated.ts index d9926a66f91..7c4575273dc 100644 --- a/packages/plugins/plugin-audit/src/translations/en.objects.generated.ts +++ b/packages/plugins/plugin-audit/src/translations/en.objects.generated.ts @@ -215,11 +215,11 @@ export const enObjects: NonNullable = { }, mentions: { label: "Mentions", - help: "JSON array of @mention objects" + help: "JSON array of the user ids @mentioned in the comment" }, reactions: { label: "Reactions", - help: "JSON array of emoji reaction objects" + help: "JSON object mapping each emoji to the list of user ids who reacted" }, is_edited: { label: "Edited" diff --git a/packages/plugins/plugin-audit/src/translations/es-ES.objects.generated.ts b/packages/plugins/plugin-audit/src/translations/es-ES.objects.generated.ts index 964c47bf678..e64327493df 100644 --- a/packages/plugins/plugin-audit/src/translations/es-ES.objects.generated.ts +++ b/packages/plugins/plugin-audit/src/translations/es-ES.objects.generated.ts @@ -215,11 +215,11 @@ export const esESObjects: NonNullable = { }, mentions: { label: "Menciones", - help: "Matriz JSON de objetos @mention." + help: "Matriz JSON de los id de usuario mencionados con @ en el comentario." }, reactions: { label: "Reacciones", - help: "Matriz JSON de objetos de reacción emoji." + help: "Objeto JSON que asigna cada emoji a la lista de id de usuario de quienes reaccionaron." }, is_edited: { label: "Editado" diff --git a/packages/plugins/plugin-audit/src/translations/ja-JP.objects.generated.ts b/packages/plugins/plugin-audit/src/translations/ja-JP.objects.generated.ts index 4eb57cf6f43..256513fb8a4 100644 --- a/packages/plugins/plugin-audit/src/translations/ja-JP.objects.generated.ts +++ b/packages/plugins/plugin-audit/src/translations/ja-JP.objects.generated.ts @@ -215,11 +215,11 @@ export const jaJPObjects: NonNullable = { }, mentions: { label: "メンション", - help: "@メンションオブジェクトの JSON 配列" + help: "コメント内で @メンションされたユーザー ID の JSON 配列" }, reactions: { label: "リアクション", - help: "絵文字リアクションオブジェクトの JSON 配列" + help: "各絵文字を、リアクションしたユーザー ID のリストに対応付ける JSON オブジェクト" }, is_edited: { label: "編集済み" diff --git a/packages/plugins/plugin-audit/src/translations/zh-CN.objects.generated.ts b/packages/plugins/plugin-audit/src/translations/zh-CN.objects.generated.ts index 704987edb7e..eaf3ac3df84 100644 --- a/packages/plugins/plugin-audit/src/translations/zh-CN.objects.generated.ts +++ b/packages/plugins/plugin-audit/src/translations/zh-CN.objects.generated.ts @@ -215,11 +215,11 @@ export const zhCNObjects: NonNullable = { }, mentions: { label: "提及", - help: "@mention 对象的 JSON 数组" + help: "评论中被 @ 提及的用户 ID 的 JSON 数组" }, reactions: { label: "回应", - help: "表情回应对象的 JSON 数组" + help: "将每个表情映射到对其做出回应的用户 ID 列表的 JSON 对象" }, is_edited: { label: "已编辑"