Skip to content

fix(w3c/sotd): Adjust pluralization of "Working Group" for CRD/CRYD#5166

Open
kfranqueiro wants to merge 3 commits intospeced:mainfrom
kfranqueiro:kgf-multi-wg-crd-cryd
Open

fix(w3c/sotd): Adjust pluralization of "Working Group" for CRD/CRYD#5166
kfranqueiro wants to merge 3 commits intospeced:mainfrom
kfranqueiro:kgf-multi-wg-crd-cryd

Conversation

@kfranqueiro
Copy link
Copy Markdown
Contributor

Fixes #5164.

This adds a condition to the value of statusExplanation dependent on whether the document lists a single WG or multiple WGs, so that "Working Group" is properly pluralized in the latter case.

This logic is in line with what pubrules checks for.

Copy link
Copy Markdown
Contributor

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

This PR updates the W3C SoTD (Status of This Document) template logic so CRD/CRYD “Working Group” wording can be pluralized when a spec is published by multiple W3C groups, aligning output with pubrules expectations.

Changes:

  • Adjust CRD and CRYD statusExplanation text to switch between “Working Group intends” vs “Working Groups intend”.
  • Expand W3C group-related tests to assert singular/plural wording for CRD/CRYD.
  • Fix a minor grammar issue in an existing test name.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.

File Description
src/w3c/templates/sotd.js Adds conditional pluralization for “Working Group(s) … intend(s)” in CRD/CRYD status explanation text.
tests/spec/w3c/group-spec.js Adds assertions for CRD/CRYD singular vs plural WG phrasing; fixes a test description typo.

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

Comment on lines 198 to +201
statusExplanation = html`A Candidate Recommendation Draft integrates
changes from the previous Candidate Recommendation that the Working Group
intends to include in a subsequent Candidate Recommendation Snapshot.`;
changes from the previous Candidate Recommendation that the Working
Group${Array.isArray(conf.wg) ? "s intend" : " intends"} to include in a
subsequent Candidate Recommendation Snapshot.`;
Copy link

Copilot AI Apr 8, 2026

Choose a reason for hiding this comment

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

Pluralization here keys off Array.isArray(conf.wg), which will incorrectly pluralize when the user provides a single group as an array (e.g., group: ["payments"] => conf.wg becomes an array of length 1). Since this template already relies on conf.multipleWGs elsewhere, use conf.multipleWGs (or Array.isArray(conf.wg) && conf.wg.length > 1) to decide between “Group intends” vs “Groups intend”.

Copilot uses AI. Check for mistakes.
Comment on lines 207 to +210
statusExplanation = html`A Candidate Registry Draft integrates changes
from the previous Candidate Registry Snapshot that the Working Group
intends to include in a subsequent Candidate Registry Snapshot.`;
from the previous Candidate Registry Snapshot that the Working
Group${Array.isArray(conf.wg) ? "s intend" : " intends"} to include in a
subsequent Candidate Registry Snapshot.`;
Copy link

Copilot AI Apr 8, 2026

Choose a reason for hiding this comment

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

Same issue as the CRD branch: Array.isArray(conf.wg) will pluralize even for a single WG if it was configured via an array. Switch this conditional to conf.multipleWGs (or check conf.wg.length > 1) so pubrules-style pluralization is based on the actual number of working groups, not the value type.

Copilot uses AI. Check for mistakes.
const sotd = doc.getElementById("sotd").textContent.replace(/\s+/g, " ");
expect(sotd).toContain("that the Working Group intends to include in");
});

Copy link

Copilot AI Apr 8, 2026

Choose a reason for hiding this comment

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

The new CRD/CRYD SotD tests cover string vs multi-element array, but they don’t cover the common edge case where a single group is provided as an array (e.g., group: ["payments"]). Adding that case would prevent regressions where pluralization is based on Array.isArray(conf.wg) instead of the actual group count.

Suggested change
it(`when one group is specified as an array in a ${specStatus}, "Working Group" is singular`, async () => {
const ops = makeStandardOps({
group: ["payments"],
specStatus,
});
const doc = await makeRSDoc(ops);
const sotd = doc.getElementById("sotd").textContent.replace(/\s+/g, " ");
expect(sotd).toContain("that the Working Group intends to include in");
});

Copilot uses AI. Check for mistakes.
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

At first I had intentionally not done this as it seemed there were other places in the codebase that already exhibit the same behavior, but upon pulling further on this thread I see that headers.js does in fact consider this, and is responsible for assigning config.multipleWGs, which sotd.js uses in one other location, so I can use that for this PR as well.

Copy link
Copy Markdown
Contributor

@marcoscaceres marcoscaceres left a comment

Choose a reason for hiding this comment

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

Suggestion for cleaner it() descriptions — shorter, specStatus leads, and the quoted text matches what's actually asserted.

Copy link
Copy Markdown
Contributor

@marcoscaceres marcoscaceres left a comment

Choose a reason for hiding this comment

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

Co-pilot caught a couple of good ones... might be worth adding tests for those too.

@kfranqueiro kfranqueiro force-pushed the kgf-multi-wg-crd-cryd branch from 61beaf8 to df895e5 Compare April 8, 2026 14:27
@marcoscaceres
Copy link
Copy Markdown
Contributor

@kfranqueiro can you give it a rebase? 🙏

@kfranqueiro kfranqueiro force-pushed the kgf-multi-wg-crd-cryd branch from df895e5 to 8aba777 Compare April 9, 2026 16:08
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.

Sotd for joint deliverables

3 participants