Skip to content

Render toolkit documentation chunks consistently#1068

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

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

Conversation

@jottakka

@jottakka jottakka 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.

Extends toToolkitMarkdown 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

vercel Bot commented Jul 16, 2026

Copy link
Copy Markdown

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

Project Deployment Actions Updated (UTC)
docs Ready Ready Preview, Comment Jul 16, 2026 8:20pm

Request Review

@cursor cursor Bot 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 thread app/_lib/toolkit-markdown.ts
Comment thread app/_lib/toolkit-markdown.ts Outdated
jottakka and 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
jottakka force-pushed the split/render-toolkit-documentation-chunks branch from a330634 to d166368 Compare July 16, 2026 20:18
@jottakka jottakka self-assigned this Jul 16, 2026
@jottakka
jottakka marked this pull request as ready for review July 16, 2026 21:43
@cursor

cursor Bot 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.

@jottakka
jottakka requested a review from teallarson July 16, 2026 21:52
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.

1 participant