Skip to content

🍕 feat(panel): copy-to-clipboard buttons next to page + component URIs#9

Merged
jjpaulino merged 1 commit into
masterfrom
feat/copy-uri-buttons
May 13, 2026
Merged

🍕 feat(panel): copy-to-clipboard buttons next to page + component URIs#9
jjpaulino merged 1 commit into
masterfrom
feat/copy-uri-buttons

Conversation

@jjpaulino
Copy link
Copy Markdown
Member

Why

The page URI and component URI lines on the Inspect tab were read-only text. To copy them you had to either select-with-mouse or dive into the Copy as… disclosure. This puts the most common URI action one click away on the same row.

What

A small copy-icon button anchored on the right of each URI row.

Row Visible text Copy yields
Page section `page.pageUri` (full) `page.pageUri` (same as displayed)
Component section `selected.instance` (short) `selected.uri` (the full URI you actually paste somewhere)

The asymmetry on the component row is deliberate: the short instance id (`stories-readers-like`) is what you scan for at a glance, but the full URI is what you paste into Clay tooling, fetch URLs, etc. The full URI surfaces in the button's hover tooltip so it's still discoverable without having to copy.

UX details

  • Button is muted at rest (opacity 0.55) so it doesn't compete with the URI text; brightens to full opacity on row-hover or keyboard focus. Standard discoverable-but-quiet affordance pattern.
  • Reuses the existing `.cs-icon-btn` + `Icon` "copy" + `copyToClipboard` + `pushToast` plumbing — no new visual vocabulary introduced.
  • Toast on success/failure matches the existing Copy as → URI path.
  • A new tiny `CopyableUri` component centralizes the row layout + copy/toast logic so the same affordance can be reused on other URI-like fields (canonical URL on the SEO tab, share links, etc.) without duplicating the pattern.

Test plan

  • `npm run validate` (typecheck + lint + format + 84 tests)
  • `npm run build` clean
  • Open the panel on a Clay page → confirm copy button appears next to the page URI → click → confirm toast says "Page URI copied" → paste somewhere shows the URI
  • Click a component → confirm copy button appears next to the instance id row → hover the button → tooltip shows the full URI on a second line → click → toast says "Component URI copied" → paste shows the full URI
  • Tab to the copy button with the keyboard → focus ring visible → Enter triggers the copy

Files

  • New: `src/content/panel/components/CopyableUri.tsx`
  • Updated: `src/content/panel/components/PageInfo.tsx`, `src/content/panel/components/ComponentDetails.tsx`, `src/content/panel/styles.css`

Note on the broader UI cleanup

This PR is focused on the copy buttons only. The other UI consistency observations from the discussion (button-style standardization, button-row grouping, header decluttering, JSON wrap behavior, focus-visible polish) deserve their own scoped PR and aren't bundled here.

Made with Cursor

The page URI and component URI lines were read-only text — to copy them
you had to either select-with-mouse or dive into the "Copy as…" menu.
Adds a small copy-icon button anchored on the right of each URI row so
the most common action is one click away.

Behavior

- Page section: button copies `page.pageUri` (the value already shown).
- Component section: the displayed text stays as the short instance id
  (e.g. "stories-readers-like") for at-a-glance recognition, but the
  copy action yields the *full* component URI — what you actually paste
  into Clay tooling. The full URI surfaces in the button's tooltip on
  hover so it's still discoverable without copying.

UX details

- Button is muted at rest (opacity 0.55) so it doesn't compete with the
  URI text; brightens to full opacity on row-hover or keyboard focus.
  Standard discoverable-but-quiet affordance pattern.
- Reuses the existing .cs-icon-btn + Icon "copy" + copyToClipboard +
  pushToast plumbing — no new visual vocabulary introduced.
- Toast on success/failure matches the existing "Copy as → URI" path.

A new tiny CopyableUri component centralizes the row layout + copy/toast
logic so the same affordance can be reused on other URI-like fields
(canonical in the SEO tab, share links, etc.) without duplication.

Co-authored-by: Cursor <cursoragent@cursor.com>
@jjpaulino jjpaulino self-assigned this May 13, 2026
@jjpaulino jjpaulino merged commit e9a48a7 into master May 13, 2026
1 check passed
@jjpaulino jjpaulino deleted the feat/copy-uri-buttons branch May 13, 2026 16:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant