File tree Expand file tree Collapse file tree 1 file changed +17
-0
lines changed
src/components/DocH1CopyPageWrapper Expand file tree Collapse file tree 1 file changed +17
-0
lines changed Original file line number Diff line number Diff line change 1+ /**
2+ * DocH1CopyPageWrapper
3+ *
4+ * Purpose:
5+ * - Positions the CopyPageButton next to the document H1 on docs pages.
6+ *
7+ * Rationale:
8+ * - Keeps CopyPageButton focused on presentation + markdown extraction only.
9+ * - Avoids doc-vs-tutorial branching or DOM mutations inside the button.
10+ * - Runs only on Doc pages (wired in DocItem/Layout), so timing/targets are reliable.
11+ *
12+ * Behavior:
13+ * - Wraps the first `article h1` in a container and moves the button into it.
14+ * - Enables absolute positioning via CSS without affecting tutorials.
15+ * - No UI is rendered; this component only performs safe DOM positioning and
16+ * guards against double wrapping.
17+ */
118import React , { useEffect , useRef } from 'react'
219import styles from '../CopyPageButton/CopyPageButton.module.css'
320
You can’t perform that action at this time.
0 commit comments