Skip to content

Render toolkit documentation chunks consistently - #1068

Closed
jottakka wants to merge 5 commits into
mainfrom
split/render-toolkit-documentation-chunks
Closed

Render toolkit documentation chunks consistently#1068
jottakka wants to merge 5 commits into
mainfrom
split/render-toolkit-documentation-chunks

Conversation

@jottakka

@jottakkajottakka commented Jul 16, 2026

Copy link
Copy Markdown
Contributor

Summary

  • centralize documentation-chunk ordering for rendered toolkit pages
  • include the same before/replace/after content in copied Markdown

Test plan

  • pnpm exec vitest run tests/documentation-chunks.test.ts tests/toolkit-markdown.test.ts

Note

Low Risk
Documentation serialization and refactor only; no auth, API, or data-path changes.

Overview
Centralizes documentation-chunk ordering in sortDocumentationChunks and wires the page renderer’s sortChunksDeterministically export to that shared helper so UI and exports use the same priority → header → content ordering.

ExtendstoToolkitMarkdown so copied/agent markdown includes toolkit- and tool-level documentationChunks at the same injection points as the live docs: before / replace / after per location (description, parameters, auth, header, footer, etc.). replace chunks override default sections (e.g. custom parameters text instead of the table); whitespace-only replacements still suppress the default block.

Tests cover sorting edge cases, chunk placement, replacement behavior, and repeated content across locations.

Reviewed by Cursor Bugbot for commit 90aab58. Bugbot is set up for automated code reviews on this repo. Configure here.

@vercel

vercelBot commented Jul 16, 2026

Copy link
Copy Markdown

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

ProjectDeploymentActionsUpdated (UTC)
docsReadyReadyPreview, CommentJul 16, 2026 8:20pm

Request Review

@cursorcursorBot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes using high effort and found 2 potential issues.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 90aab58. Configure here.

Comment threadapp/_lib/toolkit-markdown.ts
Comment threadapp/_lib/toolkit-markdown.ts Outdated
jottakkaand others added 5 commits July 16, 2026 17:18
Share chunk ordering between rendered pages and copied Markdown so custom toolkit guidance remains complete and predictably placed.
Co-authored-by: Cursor <cursoragent@cursor.com>
Make copied Markdown apply before, replace, and after description chunks in the same order as rendered toolkit pages.
Co-authored-by: Cursor <cursoragent@cursor.com>
Apply replacement chunks consistently across exported toolkit sections so Markdown matches the rendered page ordering and content.
Co-authored-by: Cursor <cursoragent@cursor.com>
Keep Markdown export available when an invalid chunk lacks content instead of failing the whole copy operation.
Co-authored-by: Cursor <cursoragent@cursor.com>
Render after-available-tools documentation only after the complete tool list in copied Markdown.
Co-authored-by: Cursor <cursoragent@cursor.com>
@jottakka
jottakkaforce-pushed the split/render-toolkit-documentation-chunks branch from a330634 to d166368CompareJuly 16, 2026 20:18
@jottakkajottakka self-assigned this Jul 16, 2026
@jottakka
jottakka marked this pull request as ready for review July 16, 2026 21:43
@cursor

cursorBot commented Jul 16, 2026

Copy link
Copy Markdown

Current version of PR was reviewed by /review-bugbot on Jul 16, 15:51 GMT-3. It flagged 1 finding.

Show 1 finding

1. Chunk headers omitted from markdown

app/_lib/toolkit-markdown.ts:30 · Medium Severity

documentationBlocks serializes only chunk.content and never chunk.header, so copy-page markdown diverges from the toolkit docs UI where ChunkContent renders header as the callout/section title. Chunks that keep title and body separate also disappear entirely when content is empty, because the loop skips any chunk whose trimmed content is falsy.

Bugbot on commit d166368 is skipped.

Sign up for freeto 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

@jottakka@teallarson