Skip to content

resources: add response compose helpers#1070

Open
Bing-su wants to merge 4 commits into
OverlayPlugin:mainfrom
Bing-su:compose
Open

resources: add response compose helpers#1070
Bing-su wants to merge 4 commits into
OverlayPlugin:mainfrom
Bing-su:compose

Conversation

@Bing-su
Copy link
Copy Markdown
Collaborator

@Bing-su Bing-su commented Jun 3, 2026

fixes #1058

Add compose and compose3 helper functions for combining LocaleText output strings into static built-in responses.

Based on my experience so far, I am confident that as long as it is used only for simple and clear content, there will be no translation issues.

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds small composition helpers to the resources/responses.ts module to build static built-in responses by concatenating multiple LocaleText values with separators (with language fallback to en), plus unit tests validating composition behavior and severity handling.

Changes:

  • Add combineLocaleText helper to concatenate localized strings with per-language fallback.
  • Export new compose and compose3 helpers to generate static built-in responses from 2 or 3 LocaleText parts.
  • Add unit tests covering composed output strings, severity selection, and locale fallbacks.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
resources/responses.ts Introduces combineLocaleText plus exported compose / compose3 static response helpers.
test/unittests/responses_test.ts Adds unit tests validating composed output strings and severity / locale fallback behavior.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread test/unittests/responses_test.ts Outdated
@github-actions github-actions Bot added needs-review Awaiting review and removed needs-review Awaiting review labels Jun 3, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add Response.compose for combining registered outputs

2 participants