From ce55af617190c7e9ef9035257ab5bc8b273557e3 Mon Sep 17 00:00:00 2001 From: Danila Poyarkov Date: Mon, 2 Mar 2026 18:45:50 +0300 Subject: [PATCH] Fix pasteID int overflow and make error toasts copyable MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Use Int32Array instead of Uint32Array for Kiwi pasteID (signed int field) - Error toasts: don't auto-dismiss, show copy button, text is selectable - Add clipboard roundtrip tests (encode → decode → verify) --- packages/core/src/clipboard.ts | 2 +- src/components/AppToast.vue | 32 +++++++-- tests/engine/clipboard.test.ts | 116 ++++++++++++++++++++++++++++++++- 3 files changed, 142 insertions(+), 8 deletions(-) diff --git a/packages/core/src/clipboard.ts b/packages/core/src/clipboard.ts index 368601f84..554f39106 100644 --- a/packages/core/src/clipboard.ts +++ b/packages/core/src/clipboard.ts @@ -420,7 +420,7 @@ export function buildFigmaClipboardHTML(nodes: SceneNode[], graph: SceneGraph): type: 'NODE_CHANGES', sessionID: 0, ackID: 0, - pasteID: crypto.getRandomValues(new Uint32Array(1))[0], + pasteID: crypto.getRandomValues(new Int32Array(1))[0], pasteFileKey: 'openpencil', nodeChanges } diff --git a/src/components/AppToast.vue b/src/components/AppToast.vue index 407e07a6f..87275f69e 100644 --- a/src/components/AppToast.vue +++ b/src/components/AppToast.vue @@ -1,15 +1,20 @@