Skip to content

Fix duplicate key error on toc#1683

Merged
welpie21 merged 4 commits intomainfrom
chore/fix-toc
Mar 25, 2026
Merged

Fix duplicate key error on toc#1683
welpie21 merged 4 commits intomainfrom
chore/fix-toc

Conversation

@welpie21
Copy link
Copy Markdown
Contributor

No description provided.

@vercel
Copy link
Copy Markdown

vercel bot commented Mar 24, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
docs Ready Ready Preview, Comment Mar 25, 2026 9:14am

Request Review

Copy link
Copy Markdown

@claude claude bot left a comment

Choose a reason for hiding this comment

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

LGTM — the React key fix and trailing-comma cleanup are correct for the stated scope of this PR.

Extended reasoning...

Overview

Two files changed: PageAside/index.tsx adds index to the map callback and uses a composite key (toc-item-${heading.id}-${index}) to eliminate the duplicate-key React warning; vercel.ts adds a trailing comma after the last headers entry.

Security risks

No security-sensitive code is touched. No credentials, secrets, or auth logic involved.

Level of scrutiny

Both changes are mechanical and low-risk. The key change is the standard React pattern for lists that may contain non-unique IDs. The trailing comma is purely cosmetic/style.

Other factors

The inline bug comment flags a pre-existing issue (stateless slug() producing duplicate heading IDs in src/lib/markdown.ts), but that defect predates this PR and is not introduced or worsened here. The PR title accurately describes its scope: fixing the duplicate key error. The root-cause fix for duplicate anchor targets is a separate follow-up concern already captured in the inline comment.

@welpie21 welpie21 merged commit 28a8232 into main Mar 25, 2026
10 checks passed
@welpie21 welpie21 deleted the chore/fix-toc branch March 25, 2026 09:14
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.

2 participants