Skip to content

Add paste and clear buttons to text input - #14

Open
Rezuan-Hassan wants to merge 1 commit into
Coding-Moves:mainfrom
Rezuan-Hassan:feature/paste-clear-buttons
Open

Rezuan-Hassan wants to merge 1 commit into
Coding-Moves:mainfrom
Rezuan-Hassan:feature/paste-clear-buttons

Conversation

@Rezuan-Hassan

Copy link
Copy Markdown

Summary of Changes

  • Added a Paste button that reads text from navigator.clipboard.readText() and inserts it into the controlled draft state.
  • Added friendly error handling for clipboard API unavailability, permission denial, and unexpected errors, reminding users they can paste via Ctrl+V.
  • Added a Clear button that immediately empties the textarea and is disabled when the draft is empty.
  • Preserved automatic word counter and duration updates derived from draft.
  • Used existing button classes (.button, .button-secondary, .button-small) to maintain design consistency and ensure responsive, accessible controls.

Verification

  • Tested TypeScript check (npm run typecheck), linting (npm run lint), and production build (npm run build).
  • Verified logic for clear action, clipboard insertion, and permission denial fallbacks.

@vercel

vercel Bot commented Nov 15, 2026

Copy link
Copy Markdown

@Rezuan-Hassan is attempting to deploy a commit to the Moavia's projects Team on Vercel.

A member of the Team first needs to authorize it.

@vercel

vercel Bot commented Nov 16, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
awaaz Ready Ready Preview Nov 16, 2026 3:15pm UTC

@Muawiya-contact Muawiya-contact left a comment •

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

@Rezuan-Hassan, thanks for adding these controls—the live preview confirms Paste and Clear work when clipboard access is available. One change is needed before merge: handlePaste() calls warmUp() before checking or reading the clipboard, so a denied or empty clipboard still starts downloading the Kokoro voice; the preview showed “Downloading voice… 0%” alongside the permission error. Please remove that pre-read warm-up. The text field already warms on focus, and openBook() loads the model when reading starts, so Paste can stay lightweight.

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.

2 participants