Do not report BibTeX copied when clipboard writing fails

Open Beginner friendly
#7 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
78/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Active
Tech stack
javascript
Domain
frontend

Research direction

Start in the Pages source at the BibTeX Copy button entry point and inspect both the Clipboard API promise handling and the legacy document.execCommand('copy') fallback. Reproduce the rejected write described in the issue, then verify that only confirmed writes show “Copied!” and failed attempts expose an error state.

Written by the indexing model from the issue text.

Description

Problem

The BibTeX copy button reports success even when the clipboard write fails in the current Pages source (web@66efcf4f1f8a4aaf5cc937e5b6d5bd9724f3ea04).

The Clipboard API path calls the same success callback for both resolution and rejection:

navigator.clipboard.writeText(text).then(done).catch(done);

The legacy fallback also ignores the boolean result of document.execCommand('copy') and calls done() unconditionally.

Reproduction

  1. Open https://bytedance.github.io/TableVerse/#bibtex in a browser context where clipboard writes are denied by permission or policy.
  2. Click Copy.
  3. Observe that the button changes to Copied! although the clipboard was not updated.

The rejection path can also be reproduced deterministically by replacing navigator.clipboard.writeText with a Promise that rejects before clicking the button.

Expected behavior

The button should show success only after a confirmed clipboard write. If the modern API fails, the page may attempt the existing fallback, but a failed fallback should expose a clear error state.

Actual behavior

Both success and failure paths display Copied!.

Impact

Users may paste stale or unrelated clipboard content after receiving a false success message.

Environment

Dominant language
No language data
Stars
25
Forks
1
PR merge metrics
No merged PRs in 30d

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from bytedance/TableVerse

All issues in bytedance/TableVerse

Similar issues

More Web Dev issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.