Skip to content

Commit a5a7221

Browse files
committed
Consolidate code.
Signed-off-by: bgravenorst <[email protected]>
1 parent 3acaa81 commit a5a7221

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

src/components/DocH1CopyPageWrapper/index.jsx

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,20 @@
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+
*/
118
import React, { useEffect, useRef } from 'react'
219
import styles from '../CopyPageButton/CopyPageButton.module.css'
320

0 commit comments

Comments
 (0)