@@ -458,14 +458,6 @@ figcaption { font-size: 0.875em; line-height: 1.4285714; color: var(--text-prima
458458 display: flex; justify-content: flex-end; align-items: center; gap: 2px;
459459 margin-bottom: -2.4rem; position: relative; z-index: 2;
460460}
461- .pa-copy {
462- display: inline-flex; align-items: center; gap: 6px;
463- font: inherit; font-size: var(--text-sm); color: var(--text-body);
464- background: none; border: none; border-radius: 0.5rem;
465- padding: 6px 8px; cursor: pointer; transition: background-color 0.15s;
466- }
467- .pa-copy:hover { background: var(--surface-active); }
468- .pa-copy svg { color: var(--text-icon); }
469461.pa-nav {
470462 display: inline-flex; align-items: center; justify-content: center;
471463 width: 30px; height: 30px; border-radius: 0.5rem;
@@ -797,28 +789,12 @@ export const SIM_ARTIFACT_SHELL = `<script>
797789 }
798790 cols.append(left, mid, right)
799791
800- // Top-of-page controls, like the docs: Copy page plus prev/next
801- // chevrons on the title row, wired to the same targets as the footer.
802- const DUPLICATE_ICON = '<svg ' + ICON_ATTRS + '><path d="M14.25 0.75H2.75C1.64543 0.75 0.75 1.64543 0.75 2.75V14.25"/><rect x="5.25" y="5.25" width="14" height="14" rx="2"/></svg>'
792+ // Top-of-page controls: prev/next chevrons on the title row, wired to
793+ // the same targets as the footer cards.
803794 const CHEV_L = '<svg ' + ICON_ATTRS + '><path d="M13.25 3L6.25 10.25L13.25 17.5"/></svg>'
804795 const CHEV_R = '<svg ' + ICON_ATTRS + '><path d="M6.25 3L13.25 10.25L6.25 17.5"/></svg>'
805796 const actions = document.createElement('div')
806797 actions.className = 'page-actions'
807- const copyBtn = document.createElement('button')
808- copyBtn.className = 'pa-copy'
809- copyBtn.type = 'button'
810- copyBtn.innerHTML = DUPLICATE_ICON + '<span>Copy page</span>'
811- copyBtn.addEventListener('click', async () => {
812- const label = copyBtn.querySelector('span')
813- try {
814- await navigator.clipboard.writeText(mid.innerText || '')
815- if (label) label.textContent = 'Copied'
816- } catch {
817- if (label) label.textContent = 'Select + copy'
818- }
819- setTimeout(() => { const l = copyBtn.querySelector('span'); if (l) l.textContent = 'Copy page' }, 1500)
820- })
821- actions.appendChild(copyBtn)
822798 const prevCard = page.querySelector('.page-nav-card.prev')
823799 const nextCard = page.querySelector('.page-nav-card.next')
824800 if (prevCard || nextCard) {
@@ -834,7 +810,7 @@ export const SIM_ARTIFACT_SHELL = `<script>
834810 }
835811 actions.append(mkNav(prevCard, CHEV_L, 'Previous page'), mkNav(nextCard, CHEV_R, 'Next page'))
836812 }
837- mid.insertBefore(actions, mid.firstChild)
813+ if (actions.childElementCount > 0) mid.insertBefore(actions, mid.firstChild)
838814
839815 const navLinks = [...leftList.querySelectorAll('a')]
840816 search.addEventListener('input', () => {
0 commit comments