the last two shell strings were the composer's pre-filled prompt (2 -> 0)

CapabilityPage puts a suggestion in the chat composer, which the reader sees and
edits before sending -- user-facing, so translated. The hidden promptFrontmatter
beside it is NOT: that one instructs the agent and carries file paths. The scanner
never flagged it, correctly, because it opens with a tag rather than a capital.

officer-web is now at zero convertible strings.
This commit is contained in:
2026-08-23 05:38:17 +00:00
parent bde59eb74e
commit a48a7ff696
3 changed files with 14 additions and 4 deletions
@@ -278,12 +278,18 @@ export const CapabilityChat = ({
description,
onResponseEnd,
}: CapabilityChatProps) => {
const { t } = useTranslation();
const seedFile = `${kind.toUpperCase()}.md`;
const genericPrefix = `<frontmatter>\ninput file: ${filePath}\n${seedFile}: ${filePath}\ndir: ${resourceDir}\n\nBe aware of any extra files alongside the same dir as the ${kind} file we're handling, for possible extra context. You can also, if pertinent, create scripts or other files that will help you in the future.\n</frontmatter>`;
const promptFrontmatter = isNew ? (buildCreationPrefix(kind, filePath, resourceDir) ?? genericPrefix) : genericPrefix;
/*
The composer's PRE-FILLED text, which the reader sees and edits — so it is translated. The hidden
`promptFrontmatter` above is not: that one instructs the agent and carries file paths, and is
machine-facing rather than something anybody reads.
*/
const defaultInput = isNew
? (description ?? `Help me create the content for this new ${kind} file`)
: `Help me understand and improve this ${kind} file`;
? (description ?? t('capability.createPrompt', { kind: kind.toLowerCase() }))
: t('capability.improvePrompt', { kind: kind.toLowerCase() });
const chat = useChat(undefined, undefined, { replaceUrl: false });
+3 -1
View File
@@ -697,6 +697,8 @@
"searchPlaceholder": "Search {{kind}}…",
"selectOne": "Select a {{kind}}",
"selectToView": "Select a {{kind}} to view its contents",
"delete": "Delete"
"delete": "Delete",
"createPrompt": "Help me create the content for this new {{kind}} file",
"improvePrompt": "Help me understand and improve this {{kind}} file"
}
}
+3 -1
View File
@@ -697,6 +697,8 @@
"searchPlaceholder": "Pesquisar {{kind}}…",
"selectOne": "Selecione um {{kind}}",
"selectToView": "Selecione um {{kind}} para ver o seu conteúdo",
"delete": "Eliminar"
"delete": "Eliminar",
"createPrompt": "Ajuda-me a criar o conteúdo deste novo ficheiro de {{kind}}",
"improvePrompt": "Ajuda-me a compreender e melhorar este ficheiro de {{kind}}"
}
}