Skip to content

Conversation

@dqnamo
Copy link

@dqnamo dqnamo commented Feb 9, 2026

Have been looking for a quick way to add facehash to projects. Not sure on the best place to put this on the page tho tbh
image
image

@vercel
Copy link

vercel bot commented Feb 9, 2026

@dqnamo is attempting to deploy a commit to the cossistant Team on Vercel.

A member of the Team first needs to authorize it.

@greptile-apps
Copy link

greptile-apps bot commented Feb 9, 2026

Greptile Overview

Greptile Summary

This PR adds a small CTA to the Facehash landing page: a client-side button that copies a pre-written “AI prompt” (installation + usage notes) to the clipboard, and wires it into the hero section of apps/facehash-landing.

The change is isolated to the landing app UI: page.tsx imports and renders the new CopyAiPromptButton, while copy-ai-prompt.tsx implements the clipboard-copy behavior and transient “copied” state/icon swap.

Confidence Score: 4/5

  • Mostly safe to merge, but has a couple client-side UX/runtime issues to address in the new clipboard button.
  • The PR is small and localized. The main concerns are (1) unhandled failures from the Clipboard API causing unhandled promise rejections in some environments and (2) a timeout-driven state update that isn’t cleaned up on unmount, which can trigger React warnings. Fixing these should make the change low-risk.
  • apps/facehash-landing/src/components/copy-ai-prompt.tsx

Important Files Changed

Filename Overview
apps/facehash-landing/src/app/page.tsx Adds a new call-to-action under the hero text; no functional issues found in this file.
apps/facehash-landing/src/components/copy-ai-prompt.tsx Adds a client-side button that copies a markdown prompt to the clipboard; currently has unhandled clipboard failures and a timeout that isn't cleaned up on unmount.

Sequence Diagram

sequenceDiagram
  participant U as User
  participant P as Home page (page.tsx)
  participant B as CopyAiPromptButton
  participant C as navigator.clipboard

  U->>P: Render landing page
  P->>B: Render <CopyAiPromptButton />
  U->>B: Click "copy ai prompt" button
  B->>C: writeText(MARKDOWN)
  alt writeText succeeds
    C-->>B: Promise resolves
    B->>B: setCopied(true)
    B->>B: setTimeout(2s) -> setCopied(false)
  else writeText fails
    C-->>B: Promise rejects
    B-->>U: Unhandled rejection (current)
  end
Loading

Copy link

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

2 files reviewed, 2 comments

Edit Code Review Agent Settings | Greptile

Comment on lines +72 to +76
const handleCopy = async () => {
await navigator.clipboard.writeText(MARKDOWN);
setCopied(true);
setTimeout(() => setCopied(false), 2000);
};
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unhandled clipboard failure
navigator.clipboard.writeText can throw (e.g., non-secure context, denied permission, unsupported API). Since the handler doesn’t catch errors, clicking the button can produce an unhandled promise rejection and still schedules state changes. Consider wrapping the copy in a try/catch and only toggling copied on success (optionally provide a fallback message).

Comment on lines +72 to +76
const handleCopy = async () => {
await navigator.clipboard.writeText(MARKDOWN);
setCopied(true);
setTimeout(() => setCopied(false), 2000);
};
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Timeout set after unmount
The setTimeout(() => setCopied(false), 2000) isn’t cleared if the component unmounts within 2s, which can trigger React warnings about state updates on unmounted components. Store the timeout id and clear it in an effect cleanup.

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