@@ -9,8 +9,12 @@ export default function CopyPage({ file }: { file: string | undefined }) {
99 } `;
1010
1111 return (
12- < details class = "copy-page-dropdown relative" >
13- < summary class = "btn list-none [&::-webkit-details-marker]:hidden flex items-center gap-2 cursor-pointer select-none" >
12+ < div class = "copy-page-split inline-flex shrink-0 rounded-full border-2 border-foreground-primary dark:border-background-tertiary" >
13+ { /* Primary: directly copies the URL */ }
14+ < button
15+ type = "button"
16+ class = "copy-page-main-btn flex items-center gap-2 px-4 py-2 text-sm font-semibold text-foreground-primary bg-transparent hover:bg-header-highlight dark:hover:text-background-primary rounded-l-full transition-colors cursor-pointer select-none"
17+ >
1418 < svg
1519 xmlns = "http://www.w3.org/2000/svg"
1620 aria-hidden = "true"
@@ -22,9 +26,26 @@ export default function CopyPage({ file }: { file: string | undefined }) {
2226 < path d = "M0 6.75C0 5.784.784 5 1.75 5h1.5a.75.75 0 0 1 0 1.5h-1.5a.25.25 0 0 0-.25.25v7.5c0 .138.112.25.25.25h7.5a.25.25 0 0 0 .25-.25v-1.5a.75.75 0 0 1 1.5 0v1.5A1.75 1.75 0 0 1 9.25 16h-7.5A1.75 1.75 0 0 1 0 14.25Z" />
2327 < path d = "M5 1.75C5 .784 5.784 0 6.75 0h7.5C15.216 0 16 .784 16 1.75v7.5A1.75 1.75 0 0 1 14.25 11h-7.5A1.75 1.75 0 0 1 5 9.25Zm1.75-.25a.25.25 0 0 0-.25.25v7.5c0 .138.112.25.25.25h7.5a.25.25 0 0 0 .25-.25v-7.5a.25.25 0 0 0-.25-.25Z" />
2428 </ svg >
25- Copy page
29+ < span class = "copy-page-main-label" > Copy page</ span >
30+ </ button >
31+
32+ { /* Visual divider between the two halves */ }
33+ < span
34+ class = "self-stretch w-0.5 bg-foreground-primary dark:bg-background-tertiary shrink-0"
35+ aria-hidden = "true"
36+ >
37+ </ span >
38+
39+ { /* Chevron: opens the popover panel */ }
40+ < button
41+ type = "button"
42+ class = "copy-page-toggle-btn flex items-center px-3 py-2 text-foreground-primary bg-transparent hover:bg-header-highlight dark:hover:text-background-primary rounded-r-full transition-colors cursor-pointer select-none"
43+ popovertarget = "copy-page-menu"
44+ aria-label = "More copy options"
45+ aria-haspopup = "menu"
46+ >
2647 < svg
27- class = "copy-page-chevron ml-1 transition-transform duration-200"
48+ class = "copy-page-chevron transition-transform duration-200"
2849 xmlns = "http://www.w3.org/2000/svg"
2950 aria-hidden = "true"
3051 fill = "currentColor"
@@ -34,35 +55,14 @@ export default function CopyPage({ file }: { file: string | undefined }) {
3455 >
3556 < path d = "M12.78 5.22a.749.749 0 0 1 0 1.06l-4.25 4.25a.749.749 0 0 1-1.06 0L3.22 6.28a.749.749 0 1 1 1.06-1.06L8 8.939l3.72-3.719a.749.749 0 0 1 1.06 0Z" />
3657 </ svg >
37- </ summary >
38-
39- < div class = "absolute right-0 z-50 mt-1 w-72 border border-foreground-tertiary rounded-md overflow-hidden bg-white dark:bg-gray-900 shadow-lg" >
40- < button class = "copy-page-link-btn flex items-start gap-3 w-full px-4 py-3 text-left hover:bg-background-secondary dark:hover:bg-gray-800 transition-colors" >
41- < svg
42- xmlns = "http://www.w3.org/2000/svg"
43- aria-hidden = "true"
44- fill = "currentColor"
45- width = "16"
46- height = "16"
47- viewBox = "0 0 16 16"
48- class = "mt-0.5 shrink-0"
49- >
50- < path d = "m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 2 2 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a2.002 2.002 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 2 2 0 0 0-2.83 0l-2.5 2.5a2.002 2.002 0 0 0 0 2.83Z" />
51- </ svg >
52- < span >
53- < span class = "copy-page-link-label block text-sm font-medium" >
54- Copy page link
55- </ span >
56- < span class = "block text-xs text-foreground-secondary mt-0.5" >
57- Copy the current page URL to clipboard
58- </ span >
59- </ span >
60- </ button >
58+ </ button >
6159
60+ { /* Popover panel — lives in top layer, positioned via JS */ }
61+ < div id = "copy-page-menu" popover = "auto" class = "copy-page-panel" >
6262 < a
6363 href = { file }
6464 target = "_blank"
65- class = "no-underline flex items-start gap-3 px-4 py-3 border-t border-foreground-tertiary hover:bg-background-secondary dark:hover:bg-gray-800 transition-colors"
65+ class = "no-underline flex items-start gap-3 px-4 py-3 hover:bg-background-secondary dark:hover:bg-gray-800 transition-colors"
6666 >
6767 < svg
6868 xmlns = "http://www.w3.org/2000/svg"
@@ -82,7 +82,6 @@ export default function CopyPage({ file }: { file: string | undefined }) {
8282 </ span >
8383 </ span >
8484 </ a >
85-
8685 < a
8786 href = { claudeUrl }
8887 target = "_blank"
@@ -107,6 +106,6 @@ export default function CopyPage({ file }: { file: string | undefined }) {
107106 </ span >
108107 </ a >
109108 </ div >
110- </ details >
109+ </ div >
111110 ) ;
112111}
0 commit comments