Codebase intelligence for AI and humans: code health scores, auto-generated docs, git analytics, dead code detection, and architectural decisions via MCP.
Python aicode-complexitycode-healthcode-intelligencecode-qualitydead-codedeveloper-toolsdocumentationgit-analyticsmcpopen-sourcepythonrefactoringstatic-analysistechnical-debt
fix(ui): keep table-of-contents keys unique across repeated headings (#1053)
Raghav Chamadiyad59eae822df5
diff --git a/packages/ui/src/wiki/table-of-contents.tsx b/packages/ui/src/wiki/table-of-contents.tsxindex 65fbdcde9..b7e7c7330 100644--- a/packages/ui/src/wiki/table-of-contents.tsx+++ b/packages/ui/src/wiki/table-of-contents.tsx@@ -59,8 +59,11 @@ export function TableOfContents({ content }: { content: string }) {</p>{/* Left rail: a hairline the active item's accent bar sits on. */}<ul className="border-l border-[var(--color-border-default)]">- {headings.map(({ id, text, level }) => (- <li key={id}>+ {/* A page can repeat a heading (two "Examples" sections, or a+ duplicated section from generation), which slugifies to the same+ id, so the list index keeps the React key unique. */}+ {headings.map(({ id, text, level }, index) => (+ <li key={`${id}-${index}`}><ahref={`#${id}`}className={cn(