Commit 848dc92
fix(dashboard): copy buttons fall back to execCommand when clipboard API blocked
Three pages had `navigator.clipboard.writeText(...)` with no fallback and
no .catch() — when the modern API is unavailable (HTTP non-localhost,
permissions denied, focus loss, browser blocking) the click was a silent
no-op. User reported the chat-prompt copy button doing nothing.
Fixed in:
codec_chat.html copyMsgText() (chat message copy buttons)
codec_dashboard.html copyText() (overview / recents card copy buttons)
codec_vibe.html doCopy() (code editor copy)
Each now:
1. Tries navigator.clipboard.writeText() if present
2. On rejection / unavailability, falls back to a hidden textarea +
document.execCommand('copy')
3. Always surfaces a toast — "Copied" on success, "Copy failed" on
total failure (instead of silent no-op)
Dashboard serves the HTML fresh per-request with _NO_CACHE headers, so
no PM2 restart is required — a browser refresh picks up the fix.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>1 parent 72942c8 commit 848dc92
3 files changed
Lines changed: 85 additions & 6 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
488 | 488 | | |
489 | 489 | | |
490 | 490 | | |
491 | | - | |
| 491 | + | |
| 492 | + | |
| 493 | + | |
| 494 | + | |
| 495 | + | |
| 496 | + | |
| 497 | + | |
| 498 | + | |
| 499 | + | |
| 500 | + | |
| 501 | + | |
| 502 | + | |
| 503 | + | |
| 504 | + | |
| 505 | + | |
| 506 | + | |
| 507 | + | |
| 508 | + | |
| 509 | + | |
| 510 | + | |
| 511 | + | |
| 512 | + | |
492 | 513 | | |
493 | 514 | | |
494 | 515 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
776 | 776 | | |
777 | 777 | | |
778 | 778 | | |
| 779 | + | |
| 780 | + | |
| 781 | + | |
| 782 | + | |
| 783 | + | |
| 784 | + | |
| 785 | + | |
| 786 | + | |
| 787 | + | |
| 788 | + | |
| 789 | + | |
| 790 | + | |
| 791 | + | |
| 792 | + | |
| 793 | + | |
| 794 | + | |
| 795 | + | |
| 796 | + | |
| 797 | + | |
| 798 | + | |
| 799 | + | |
| 800 | + | |
| 801 | + | |
| 802 | + | |
| 803 | + | |
| 804 | + | |
| 805 | + | |
779 | 806 | | |
780 | | - | |
| 807 | + | |
781 | 808 | | |
782 | 809 | | |
783 | 810 | | |
784 | | - | |
| 811 | + | |
| 812 | + | |
| 813 | + | |
| 814 | + | |
| 815 | + | |
| 816 | + | |
| 817 | + | |
| 818 | + | |
| 819 | + | |
| 820 | + | |
785 | 821 | | |
786 | 822 | | |
787 | 823 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
957 | 957 | | |
958 | 958 | | |
959 | 959 | | |
| 960 | + | |
| 961 | + | |
| 962 | + | |
| 963 | + | |
| 964 | + | |
| 965 | + | |
| 966 | + | |
| 967 | + | |
| 968 | + | |
| 969 | + | |
| 970 | + | |
| 971 | + | |
960 | 972 | | |
961 | | - | |
962 | | - | |
963 | | - | |
| 973 | + | |
| 974 | + | |
| 975 | + | |
| 976 | + | |
| 977 | + | |
| 978 | + | |
| 979 | + | |
| 980 | + | |
| 981 | + | |
| 982 | + | |
| 983 | + | |
| 984 | + | |
| 985 | + | |
964 | 986 | | |
965 | 987 | | |
966 | 988 | | |
| |||
0 commit comments