Skip to content

Remove redundant Overview headings on TOC-enabled docs pages#721

Open
Copilot wants to merge 1 commit intomainfrom
copilot/remove-redundant-overview-headings
Open

Remove redundant Overview headings on TOC-enabled docs pages#721
Copilot wants to merge 1 commit intomainfrom
copilot/remove-redundant-overview-headings

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Apr 15, 2026

Summary

  • Remove explicit Overview headings from affected docs pages and keep/rename content where needed.
  • Update the doc-writer skill guidance to explicitly forbid ## Overview on TOC-enabled pages.
  • Add docs unit-test enforcement to fail when TOC-enabled docs include an explicit Overview heading.

Updated articles

  • src/frontend/src/content/docs/deployment/custom-deployments.mdx
  • src/frontend/src/content/docs/deployment/azure/azure-security-best-practices.mdx
  • src/frontend/src/content/docs/deployment/pipelines.mdx (Overview renamed to Pipeline deployment model)
  • src/frontend/src/content/docs/integrations/cloud/azure/azure-container-registry/azure-container-registry-host.mdx (Overview renamed to Key capabilities)
  • src/frontend/src/content/docs/integrations/cloud/azure/azure-container-registry/azure-container-registry-get-started.mdx (Overview renamed to Key capabilities)

Validation

  • pnpm --dir ./src/frontend run lint
  • pnpm --dir ./src/frontend run test:unit:docs
  • pnpm --dir ./src/frontend run build:skip-search
  • pnpm --dir ./src/frontend run test:unit
  • parallel_validation run: Code review succeeded; CodeQL timed out per tool warning.

@IEvangelist IEvangelist marked this pull request as ready for review April 15, 2026 20:00
@IEvangelist IEvangelist requested a review from eerhardt as a code owner April 15, 2026 20:00
Copilot AI review requested due to automatic review settings April 15, 2026 20:00
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

Note

Copilot was unable to run its full agentic suite in this review.

Removes redundant Overview headings from TOC-enabled docs pages and adds enforcement to prevent reintroducing them.

Changes:

  • Updated multiple docs pages to remove or rename ## Overview sections.
  • Extended doc-writer guidance to forbid ## Overview on TOC-enabled pages.
  • Added a docs unit test that fails when TOC-enabled docs include an explicit “Overview” heading.

Reviewed changes

Copilot reviewed 7 out of 7 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
src/frontend/tests/unit/filetree-format.vitest.test.ts Adds detection + unit-test enforcement for explicit “Overview” headings on TOC-enabled docs pages
src/frontend/src/content/docs/integrations/cloud/azure/azure-container-registry/azure-container-registry-host.mdx Renames Overview heading to a more specific “Key capabilities” section
src/frontend/src/content/docs/integrations/cloud/azure/azure-container-registry/azure-container-registry-get-started.mdx Renames Overview heading to a more specific “Key capabilities” section
src/frontend/src/content/docs/deployment/pipelines.mdx Renames Overview heading to “Pipeline deployment model”
src/frontend/src/content/docs/deployment/custom-deployments.mdx Removes redundant Overview heading so intro content is direct body text
src/frontend/src/content/docs/deployment/azure/azure-security-best-practices.mdx Removes redundant Overview heading so intro content is direct body text
.github/skills/doc-writer/SKILL.md Documents the “no ## Overview on TOC-enabled pages” guidance and suggested alternatives

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

Comment on lines +96 to +103
let currentFence: string | null = null;

for (const [index, line] of lines.entries()) {
const fenceMatch = line.match(/^\s*(```+|~~~+)/);
if (fenceMatch) {
const fence = fenceMatch[1][0];
currentFence = currentFence === fence ? null : fence;
continue;
Copy link

Copilot AI Apr 15, 2026

Choose a reason for hiding this comment

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

The code-fence tracker only stores the fence character (` or ~) and toggles on any subsequent fence line starting with the same character. This breaks for valid Markdown that uses longer fences (e.g., opening with ```` and containing ``` inside), causing the scanner to exit the fenced block early and potentially flag headings that are actually inside code blocks. Track the full fence delimiter (character + length) and only close when encountering a matching delimiter with the same character and length >= the opener.

Suggested change
let currentFence: string | null = null;
for (const [index, line] of lines.entries()) {
const fenceMatch = line.match(/^\s*(```+|~~~+)/);
if (fenceMatch) {
const fence = fenceMatch[1][0];
currentFence = currentFence === fence ? null : fence;
continue;
let currentFence: { char: '`' | '~'; length: number } | null = null;
for (const [index, line] of lines.entries()) {
const fenceMatch = line.match(/^\s*((`{3,})|(~{3,}))/);
if (fenceMatch) {
const fenceDelimiter = fenceMatch[1];
const fenceChar = fenceDelimiter[0] as '`' | '~';
const fenceLength = fenceDelimiter.length;
if (!currentFence) {
currentFence = { char: fenceChar, length: fenceLength };
continue;
}
if (currentFence.char === fenceChar && fenceLength >= currentFence.length) {
currentFence = null;
continue;
}

Copilot uses AI. Check for mistakes.
const frontendRoot = path.resolve(testsDir, '..', '..');
const docsRoot = path.join(frontendRoot, 'src', 'content', 'docs');
const fileTreeBlockPattern = /<FileTree\b[^>]*>([\s\S]*?)<\/FileTree>/g;
const frontmatterPattern = /^---\r?\n([\s\S]*?)\r?\n---/;
Copy link

Copilot AI Apr 15, 2026

Choose a reason for hiding this comment

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

The frontmatter detection is anchored at the start of the file and won’t match if the document begins with a UTF-8 BOM or leading blank lines. In those cases, isTableOfContentsEnabled() will treat TOC as enabled and may produce unexpected failures. Consider permitting an optional BOM and leading whitespace/newlines before the opening ---.

Suggested change
const frontmatterPattern = /^---\r?\n([\s\S]*?)\r?\n---/;
const frontmatterPattern = /^\uFEFF?\s*---\r?\n([\s\S]*?)\r?\n---/;

Copilot uses AI. Check for mistakes.
Comment on lines +83 to +84
const frontmatterMatch = source.match(frontmatterPattern);
const frontmatter = frontmatterMatch?.[1] ?? '';
Copy link

Copilot AI Apr 15, 2026

Choose a reason for hiding this comment

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

The frontmatter detection is anchored at the start of the file and won’t match if the document begins with a UTF-8 BOM or leading blank lines. In those cases, isTableOfContentsEnabled() will treat TOC as enabled and may produce unexpected failures. Consider permitting an optional BOM and leading whitespace/newlines before the opening ---.

Copilot uses AI. Check for mistakes.
Comment on lines +110 to +116
if (/^\s*##+\s+Overview\s*$/.test(line)) {
issues.push({
line: index + 1,
reason:
'TOC-enabled pages must not include an explicit "Overview" heading; use intro text or a more specific heading.',
});
}
Copy link

Copilot AI Apr 15, 2026

Choose a reason for hiding this comment

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

This enforcement currently flags any heading level ## or deeper (##+) and only matches the exact-cased word Overview. However, the added guidance in doc-writer specifically references forbidding ## Overview. Either (a) adjust the rule/message/docs to be consistent about whether ### Overview is also prohibited, and (b) consider making the match case-insensitive so ## overview can’t bypass the rule.

Copilot uses AI. Check for mistakes.
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.

3 participants