fix(docs): dropdown bg in dark mode, MCP sidebar sync, Safari copy#6402
fix(docs): dropdown bg in dark mode, MCP sidebar sync, Safari copy#6402
Conversation
- Add missing --c-slate-1 dark-mode definition in custom-colors.css; bg-slate-1 resolves through this var, which was undefined in dark mode and caused the copy-page popover (and any other bg-slate-1 surface) to render transparent. - In SidebarState.sidebar_index, route MCP doc paths to index 1 so the MCP category is selected when landing directly on /docs/ai-builder/integrations/mcp-*. - Fix copy-page button on Safari: rewrite to use navigator.clipboard.write with a ClipboardItem whose data is a Promise. Calling clipboard.write synchronously inside the click handler preserves Safari's user-gesture requirement; the prior fetch().then(writeText) chain only worked in Chromium. - Remove the llms-full.txt entry from the copy-page dropdown. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Greptile SummaryThree focused docs-site bug fixes: adds the missing Confidence Score: 4/5Safe to merge — all three fixes are targeted and correct, with only minor style-level concerns. No P0 or P1 findings. Two P2s: the No files require special attention; the sidebar state change and clipboard rewrite are both straightforward. Important Files Changed
Flowchart%%{init: {'theme': 'neutral'}}%%
flowchart TD
A[User clicks Copy button] --> B[animate icons]
B --> C{ClipboardItem available?}
C -- Yes --> D[Create blobPromise via fetch]
D --> E[navigator.clipboard.write with ClipboardItem]
E --> F{Success?}
F -- No --> G[console.error]
F -- Yes --> H[Text in clipboard]
C -- No --> I[fetch mdUrl]
I --> J{navigator.clipboard.writeText?}
J -- Yes --> K[writeText text]
J -- No --> L[textarea execCommand fallback]
K --> H
L --> H
Reviews (1): Last reviewed commit: "fix(docs): dropdown bg in dark mode, MCP..." | Re-trigger Greptile |
Summary
Three small docs-site bugs found while reviewing
/docs/ai-builder/integrations/mcp-overview/, plus a dropdown cleanup.--c-slate-1was missing from the dark-theme block incustom-colors.css(only an orphan comment marked the slot). Tailwind'sbg-slate-1resolves through--color-slate-1→var(--c-slate-1), which fell back totransparentin dark mode. Affects everybg-slate-1surface; most visible on the copy-page popover./docs/ai-builder/integrations/mcp-*directly fell through tosidebar_index = 0(AI Builder), so the MCP category wasn't selected. Clicking MCP first worked because the click handler set_sidebar_index = 1. Added an/mcp-branch toSidebarState.sidebar_index.fetch(mdUrl).then(text => navigator.clipboard.writeText(text)). By the timewriteTextran, Safari's user-gesture window had closed and the call was rejected. Chrome was lenient and allowed it. Switched tonavigator.clipboard.write([new ClipboardItem({ 'text/plain': blobPromise })])— callingwritesynchronously with a Promise-backedClipboardItempreserves the gesture binding in both browsers.llms-full.txtfrom the copy-page dropdown.Test plan
#151618)./docs/ai-builder/integrations/mcp-overview/— sidebar shows MCP category selected and the MCP Integration accordion expanded.llms-full.txtrow no longer appears in the dropdown.🤖 Generated with Claude Code