Add LLM-friendly markdown outputs and Copy page menu#132
Conversation
* Tms 1532 (#50) * Updated the title for the Homepage on BreadSchema * Updated Atto overview page Fixed incorrect interlinks in the introduction to Atto page * Added CI/CD & API docs for TMS (#39) Added CI/CD & API docs for TMS * Dummy commit * Fixed Issue With AWS User Access Fixed Issue With AWS User Access * Fixed Issue with AWS User Access * Merge pull request #41 from testsigmahq/TMS-1520 Added Jira Actions Sync Steps & CI/CD docs * Added Versions for TMS Docs --------- Co-authored-by: Santhoshkumar <117272529+Santhosh-testsigma@users.noreply.github.com> Co-authored-by: Abdul <132989679+Abdul-jailani@users.noreply.github.com> Co-authored-by: Vikram Chaitanya <vikram@testsigma.com> * Added new docs for Jira two-way integration (#51) * Added new docs for Jira two-way integration * Update manage-sprints.md * Changed app name for Jira integration (#52) * updated sitemap --------- Co-authored-by: Santhoshkumar <117272529+Santhosh-testsigma@users.noreply.github.com> Co-authored-by: Abdul <132989679+Abdul-jailani@users.noreply.github.com> Co-authored-by: Vikram Chaitanya <vikram@testsigma.com>
* [WEB-1811] - Fixed the CI build failing issue (#56) * Best Practices docs for Atto (#55) * Added images for best practices (#57) * [WEB-1811][Rework] - Updated the Gatsby config (#58) * trail and error 1 (#59) * small fix (#60) * removed gatsby clean (#61) * [WEB-1812] - Fixed the font issue (#62) --------- Co-authored-by: Santhoshkumar <117272529+Santhosh-testsigma@users.noreply.github.com>
New docs for Linear Integration & Export Reports
Added docs for Test Run & Plan public link
[WEB-1924] - Removed the FreshChat chat bot and Integrated the Salesforce Chatbot
[Dev] - Fixed the SH chatbot logo alignment issue
Added new doc for generating tests from files
Updated Typo in Linear Doc
Dev - Removed the Salesforce chatbot
Dummy commit for Updated typesense key updation
Added docs supporting ClickUp Integration
[Dev] - Removed the Open source note on the Docs footer
Added 'Sprint Planner for ClickUp Tasks'
Added GitLab Integration doc
Added no follow links as per SEO team suggestions
Added new docs for TS <> TMS Integration
Added new docs to TS <> TMS Integration
Added Review & Clone Tests, Comments & Alerts docs
Replaced the redirected URLs to the original URL
Added Datasets, Traceability & Confluence Int docs
Added new Azure DevOps docs (#116)
Added 3 docs for Test Capture
Updated Leftnav.jsx
Fixed page size issues
Emit per-page <slug>.md companions, an llms.txt index, and a hand-authored home .md for /docs/test-management/ during gatsby build. Add <link rel="alternate" type="text/markdown"> to every page's head, configure S3 Content-Type for .md, and ship a "Copy page" dropdown next to the page title with Copy / View / Open in ChatGPT / Claude / Perplexity actions. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
📝 WalkthroughWalkthroughThis PR extends the documentation pipeline to generate LLM-optimized markdown versions of ChangesLLM-Friendly Markdown Companions
Sequence Diagramsflowchart TD
Input["Source *.md in<br/>src/pages/docs/test-management/"] --> Parse["Parse frontmatter<br/>Check noindex flag"]
Parse --> Transform["Transform content:<br/>info blocks, Storylane,<br/>anchors, br tags,<br/>scripts"]
Transform --> Frontmatter["Wrap with YAML<br/>frontmatter"]
Frontmatter --> Write["Write to public/<br/>under derived slug"]
Write --> Aggregate["Aggregate metadata<br/>by section"]
Aggregate --> Index["Generate llms.txt<br/>index"]
Index --> Home["Write hand-authored<br/>home page"]
sequenceDiagram
participant User
participant Menu as CopyPageMenu
participant Clipboard as navigator.clipboard
participant LLM as External LLM
User->>Menu: Click trigger
activate Menu
Menu->>Menu: Toggle open state
User->>Menu: Click copy markdown
Menu->>Menu: Fetch markdown from<br/>derived URL
Menu->>Clipboard: Copy to clipboard
Clipboard-->>Menu: Success/Fallback
Menu->>Menu: Show "Copied!" feedback
User->>Menu: Click external link
Menu->>LLM: window.open with prompt
Menu->>Menu: Close menu
deactivate Menu
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Possibly related PRs
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 3
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@src/components/CopyPageMenu.jsx`:
- Around line 89-90: The mdUrl construction in CopyPageMenu.jsx currently
hardcodes "https://testsigma.com" and calls slug.replace(...) without checking
slug; update mdUrl to derive the origin from window.location.origin (or fallback
to a safe default) and guard slug before calling replace by ensuring slug is a
string (e.g., const safeSlug = typeof slug === 'string' ? slug : ''). Then
compute mdUrl = `${origin}${safeSlug.replace(/\/$/, '')}.md`; update references
to mdUrl and prompt accordingly so you never call replace on undefined and the
URL works in non-production origins.
- Around line 102-113: The temporary-textarea copy path currently ignores the
return value of document.execCommand('copy'), so setCopied(true) is called even
when the copy failed; update the copy logic in the handler (the function that
creates the textarea and calls document.execCommand('copy')) to capture the
boolean result of document.execCommand('copy') and only call setCopied(true)
(and start the timeout) when that result is true (and similarly when using
navigator.clipboard.writeText()); always remove the textarea and handle/fall
back on errors by not setting copied on failure and optionally logging or
rejecting so callers know copy failed.
In `@src/components/seo.jsx`:
- Around line 204-208: The alternate link construction calls replace on slug
directly and will throw if slug is undefined; update the href expression in the
SEO component (the <link rel='alternate' ...> using slug) to ensure slug is a
string before calling replace (e.g., default slug to '' or use (slug ||
'').replace(/\/$/, '') so the template literal becomes
`https://testsigma.com${(slug || '').replace(/\/$/, '')}.md`), ensuring no
runtime crash when slug is absent.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: 542e1030-6d3c-412b-bef8-e78491c6b010
📒 Files selected for processing (6)
gatsby-config.jsgatsby-node.jssrc/components/CopyPageMenu.jsxsrc/components/CopyPageMenu.scsssrc/components/seo.jsxsrc/templates/page.jsx
CopyPageMenu: coerce non-string slug to '' and read window.location.origin (with prod URL fallback for SSR) so the .md URL works in local dev and staging without hardcoding a production host. seo.jsx: default slug to '' in the alternate link href so the SEO render won't crash if a future caller forgets to pass slug. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Summary
Ships the testmu/Mintlify-style LLM surface for
testsigma.com/docs/test-management/(~93 pages) as a pilot. After this lands, the same approach can be ported totestsigma-docs(519 pages).What changed:
<slug>.mdnext to its HTML output. Strips frontmatter to a minimal subset (title,metadesc,canonical,page_id), converts[[info]]blocks to blockquotes, replaces Storylane iframes with a labeled link, converts<br>to newlines outside table cells, rewrites stray<a>tags to Markdown, and strips<script>tags.llms.txtindex at/docs/test-management/llms.txt— grouped by section, sorted by frontmatterorder, links point to.mdcompanions..mdat/docs/test-management.mdfor the/docs/test-management/URL (rendered fromindex.jsx, so no source.mdfor the hook to pick up).<link rel="alternate" type="text/markdown">in every page<head>so LLM tools can discover the companion.Content-Typeoverride (text/markdown; charset=utf-8) for.mdfiles viagatsby-plugin-s3params.navigator.clipboardwithexecCommandfallback; closes on outside click viareact-onclickout(already a dep).Files:
gatsby-node.js— extendedonPostBuildwith the emitter + transformation pipeline + index/home writers (~190 new lines)gatsby-config.js—paramsblock forgatsby-plugin-s3src/components/seo.jsx—<link rel="alternate">after canonicalsrc/components/CopyPageMenu.jsx+.scss— new dropdown componentsrc/templates/page.jsx— mount<CopyPageMenu>inline with the titleTest plan
npm install --legacy-peer-deps && npm run buildsucceeds; build log showsEmitted 93 .md companions + llms.txt + test-management.mdnpm run serveand visit any test-management page — "Copy page ▾" renders top-right of the title; all 5 menu items behavepublic/docs/test-management/test-cases/manage-test-cases.md— clean markdown, frontmatter intact, H1 from titlepublic/docs/test-management/atto/best-practices/writing-best-prompts.md— tables intact,<br>preserved inside cellspublic/docs/test-management/api-reference/modules.md— all anchor cells converted to[text](url), no stray<a>tagspublic/docs/test-management/settings/custom-fields.md—<number>HTML entities preservedcurl -sI https://<host>/docs/test-management/introduction/overview.mdreturnsContent-Type: text/markdown; charset=utf-8.mdcompanion (visible in tool reasoning) and answer cleanlySummary by CodeRabbit
Release Notes
New Features
Chores