Skip to content

fix(#2969): use frontmatter title for directory sidebar entries and exclude non-content files - #4020

Merged
waynesun09 merged 2 commits into
mainfrom
agent/2969-fix-getmarkdownfiles-sidebar
Jul 10, 2026
Merged

fix(#2969): use frontmatter title for directory sidebar entries and exclude non-content files#4020
waynesun09 merged 2 commits into
mainfrom
agent/2969-fix-getmarkdownfiles-sidebar

Conversation

@fullsend-ai-coder

Copy link
Copy Markdown
Contributor

Summary

  • Fix getMarkdownFiles() in website/.vitepress/config.ts to check frontmatter title: for directory entries (README.md), matching the existing behavior for standalone .md files
  • Add exclusion sets for non-content files (AGENTS.md, CLAUDE.md, CODEOWNERS, LICENSE, CONTRIBUTING.md) and non-content directories (.github, 0000-experiment-template, dot-directories) to prevent them from appearing in the sidebar

Closes #2969

Test plan

  • Verify sidebar entries for directories with frontmatter title: in their README.md now display the frontmatter title instead of the H1 heading
  • Verify AGENTS.md, CLAUDE.md, CODEOWNERS, LICENSE, and CONTRIBUTING.md no longer appear as sidebar entries
  • Verify 0000-experiment-template directory no longer appears as a sidebar entry
  • Verify dot-directories (e.g. .github) are excluded from sidebar
  • Verify existing sidebar entries for ADRs, problems, and experiments continue to work correctly

…xclude non-content files

The getMarkdownFiles function had two bugs: (1) directory entries with
README.md only checked for H1 headings, ignoring frontmatter title: which
standalone .md files already respected, and (2) non-content files like
AGENTS.md, CLAUDE.md, CODEOWNERS, LICENSE, and template directories like
0000-experiment-template appeared as sidebar items.

Add fmTitleMatch extraction to the directory branch so frontmatter title
takes priority over H1, matching the standalone file branch. Add exclusion
sets for non-content files and directories (including dot-directories) to
prevent them from appearing in the sidebar.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@fullsend-ai-coder
fullsend-ai-coder Bot requested a review from a team as a code owner July 10, 2026 12:02
@github-actions

Copy link
Copy Markdown

E2E tests did not run

E2E tests run automatically for org/repo members and collaborators on pull requests.

For other contributors, a maintainer must add the ok-to-test label after the latest push.

See E2E testing guide for details.

@github-actions

github-actions Bot commented Jul 10, 2026

Copy link
Copy Markdown

Site preview

Preview: https://60a4de16-site.fullsend-ai.workers.dev

Commit: 9f3c2f3e7fc5f2eca8a23f5c9829fb2c77fde7ac

@codecov

codecov Bot commented Jul 10, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@waynesun09 waynesun09 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Review squad (3 agents: Claude, Gemini) found 2 MEDIUM findings worth addressing before merge — both inline below. No CRITICAL/HIGH issues; the core fix (frontmatter title priority, exclusion of AGENTS.md/CLAUDE.md/etc.) is correct. Remaining LOW/INFO items (dead CODEOWNERS/LICENSE entries, duplicated title-extraction logic, unrelated formatting churn) omitted per posting threshold.

Comment thread website/.vitepress/config.ts Outdated
Comment thread website/.vitepress/config.ts Outdated
@waynesun09

Copy link
Copy Markdown
Member

/fs-fix Please address the two MEDIUM review findings posted as inline comments:

  1. fix(#2969): use frontmatter title for directory sidebar entries and exclude non-content files #4020 (comment)0000-adr-template.md still leaks into the sidebar as "NUMBER. TITLE"
  2. fix(#2969): use frontmatter title for directory sidebar entries and exclude non-content files #4020 (comment) — hardcoded exclusion lists will require repeated future patches

@fullsend-ai-coder

fullsend-ai-coder Bot commented Jul 10, 2026

Copy link
Copy Markdown
Contributor Author

🤖 Finished Fix · ✅ Success · Started 12:23 PM UTC · Completed 12:35 PM UTC
Commit: e8381e3 · View workflow run →

Replace excludeFiles/excludeDirs sets with an isNonContent() helper that
uses two patterns: /^0000-.*-template/ catches template placeholders
(fixes 0000-adr-template.md leak), and /^[A-Z][A-Z0-9_-]*$/ catches
ALL-CAPS repo-metadata files. This eliminates the need for manual
denylist updates when new non-content files are added.

Addresses review feedback on #4020
@fullsend-ai-coder

Copy link
Copy Markdown
Contributor Author

🔧 Fix agent — iteration 1 (human-triggered)

Addressed both review findings by replacing hardcoded excludeFiles/excludeDirs sets with a pattern-based isNonContent() helper function. This fixes the 0000-adr-template.md sidebar leak and eliminates the need for manual denylist patches when new non-content files are added.

Fixed (2):

  1. 0000-adr-template.md leaks into sidebar as NUMBER. TITLE (website/.vitepress/config.ts): Replaced hardcoded excludeFiles/excludeDirs sets with a pattern-based isNonContent() helper. The /^0000-.*-template/ pattern now catches 0000-adr-template.md (and any future template files/dirs) automatically.
  2. Hardcoded exclusion lists require repeated future patches (website/.vitepress/config.ts): Replaced exact-name Sets with two pattern rules in isNonContent(): (1) /^0000-.-template/ catches template placeholders, (2) /^[A-Z][A-Z0-9_-]$/ on the basename catches ALL-CAPS repo-metadata files (AGENTS.md, CLAUDE.md, etc.). New non-content files matching either pattern are excluded automatically without denylist updates.

Tests: passed

Decision points
  • Chose dual-pattern approach (template regex + ALL-CAPS regex) over positive-inclusion (frontmatter title as inclusion signal) (alternatives: Positive inclusion via frontmatter title field, Single broader regex, Keep denylists and just add missing entries; rationale: The template file has valid frontmatter (title: NUMBER. TITLE), so positive-inclusion would not exclude it without also checking for placeholder values. The dual-pattern approach is self-documenting, handles all current exclusions, and extends to future cases without maintenance.)

Updated by fullsend fix agent

@waynesun09 waynesun09 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Both MEDIUM findings from the review squad (0000-adr-template.md sidebar leak, hardcoded exclusion list maintainability) are resolved in the latest commit via a pattern-based isNonContent() helper. Verified against the live site preview build (60a4de16-site.fullsend-ai.workers.dev): no template/repo-metadata leak in the Architecture Decisions or Experiments sidebars, real ADR pages render correctly. CI green.

@waynesun09
waynesun09 added this pull request to the merge queue Jul 10, 2026
Merged via the queue into main with commit 969b396 Jul 10, 2026
16 checks passed
@waynesun09
waynesun09 deleted the agent/2969-fix-getmarkdownfiles-sidebar branch July 10, 2026 13:33
@fullsend-ai-retro

fullsend-ai-retro Bot commented Jul 10, 2026

Copy link
Copy Markdown

🤖 Finished Retro · ✅ Success · Started 1:35 PM UTC · Completed 1:43 PM UTC
Commit: 9f3c2f3 · View workflow run →

@fullsend-ai-retro

Copy link
Copy Markdown

PR #4020 fixed two bugs in the VitePress sidebar config: directory entries ignoring frontmatter titles and non-content files leaking into the sidebar. The code agent faithfully implemented the detailed suggested fix from issue #2969, but the suggestion itself had a gap — it listed specific files/directories to exclude but missed 0000-adr-template.md in the ADRs directory. The review squad (3 agents) caught both this specific gap and the broader maintainability concern about hardcoded exclusion lists. The human triggered /fs-fix, and the fix agent replaced the hardcoded sets with a pattern-based isNonContent() helper in one clean iteration. Total time to merge was ~1.5 hours with 1 rework cycle. Review quality was strong — both MEDIUM findings were actionable and led to a better final solution. The main improvement opportunity is for the code agent to validate enumerated filter lists against actual directory contents rather than trusting issue-provided suggestions without independent verification.

Proposals filed

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.

docs: getMarkdownFiles ignores frontmatter title for directory entries and includes non-content files

1 participant