From ff7cb95c7b2bad3736d9e801a762d71cef5cfdfc Mon Sep 17 00:00:00 2001 From: Nakul Srivastava Date: Thu, 26 Nov 2026 10:59:56 +0530 Subject: [PATCH 1/2] fix(annotations): text tool click creates a text box again The press that created the text editor kept its default action, so the browser moved focus to the focusable canvas right after the editor autofocused. The empty editor blurred and was discarded at once. Prevent the press default, as note pins already do, and add a regression test that simulates the browser focus move. Co-Authored-By: Claude Opus 5.5 --- CHANGELOG-PUBLIC.md | 6 ++++++ apps/desktop/src/components/AnnotationCanvas.test.tsx | 9 +++++++++ apps/desktop/src/components/AnnotationCanvas.tsx | 3 +++ 3 files changed, 18 insertions(+) diff --git a/CHANGELOG-PUBLIC.md b/CHANGELOG-PUBLIC.md index 2d373f0..9e871a1 100644 --- a/CHANGELOG-PUBLIC.md +++ b/CHANGELOG-PUBLIC.md @@ -2,6 +2,12 @@ User-facing changes only, grouped by date under Added / Improved / Fixed. +## Unreleased + +### Fixed + +- Clicking with the Text tool on the capture screen creates a text box again. + ## 0.6.1 — 2026-11-24 ### Fixed diff --git a/apps/desktop/src/components/AnnotationCanvas.test.tsx b/apps/desktop/src/components/AnnotationCanvas.test.tsx index 1b12483..6020db9 100644 --- a/apps/desktop/src/components/AnnotationCanvas.test.tsx +++ b/apps/desktop/src/components/AnnotationCanvas.test.tsx @@ -187,6 +187,15 @@ describe("AnnotationCanvas effect previews", () => { expect(onCommit).not.toHaveBeenCalled(); }); + it("keeps the new editor focused after the press that created it", () => { + const { canvas } = renderText(); + const notPrevented = fireEvent.pointerDown(canvas, { button: 0, clientX: 50, clientY: 60, pointerId: 1 }); + // A real press focuses the focusable canvas unless its default is prevented. + if (notPrevented) canvas.focus(); + expect(notPrevented).toBe(false); + expect(screen.getByRole("textbox", { name: "Edit annotation text" })).toHaveFocus(); + }); + it("drops empty or whitespace-only text without an undo entry", () => { const { onCommit, onDelete, canvas } = renderText(); fireEvent.pointerDown(canvas, { button: 0, clientX: 50, clientY: 60, pointerId: 1 }); diff --git a/apps/desktop/src/components/AnnotationCanvas.tsx b/apps/desktop/src/components/AnnotationCanvas.tsx index 640dddb..4ba0002 100644 --- a/apps/desktop/src/components/AnnotationCanvas.tsx +++ b/apps/desktop/src/components/AnnotationCanvas.tsx @@ -292,6 +292,9 @@ export function AnnotationCanvas({ const annotation = createAnnotation(activeTool, point, point, style, scene); if (annotation === null) return; if (annotation.kind === "text") { + // The press would otherwise move focus to this canvas after the new editor + // autofocuses, blurring it at once; an empty blur drops the box before it shows. + event.preventDefault(); setPendingText(annotation); setSelectedTextId(null); beginTextEdit(annotation, ""); From 574499b390d77418f633e682819c9f1402427944 Mon Sep 17 00:00:00 2001 From: Nakul Srivastava Date: Thu, 26 Nov 2026 12:09:54 +0530 Subject: [PATCH 2/2] chore(release): v0.6.2 Co-Authored-By: Claude Opus 5.5 --- CHANGELOG-PUBLIC.md | 2 +- apps/desktop/package.json | 2 +- apps/desktop/src-tauri/Cargo.lock | 2 +- apps/desktop/src-tauri/Cargo.toml | 2 +- apps/desktop/src-tauri/tauri.conf.json | 2 +- package.json | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/CHANGELOG-PUBLIC.md b/CHANGELOG-PUBLIC.md index 9e871a1..0a4458d 100644 --- a/CHANGELOG-PUBLIC.md +++ b/CHANGELOG-PUBLIC.md @@ -2,7 +2,7 @@ User-facing changes only, grouped by date under Added / Improved / Fixed. -## Unreleased +## 0.6.2 — 2026-11-26 ### Fixed diff --git a/apps/desktop/package.json b/apps/desktop/package.json index b356ceb..86fd290 100644 --- a/apps/desktop/package.json +++ b/apps/desktop/package.json @@ -1,6 +1,6 @@ { "name": "@snaphub/desktop", - "version": "0.6.1", + "version": "0.6.2", "private": true, "type": "module", "scripts": { diff --git a/apps/desktop/src-tauri/Cargo.lock b/apps/desktop/src-tauri/Cargo.lock index 60a0327..1d5e56c 100644 --- a/apps/desktop/src-tauri/Cargo.lock +++ b/apps/desktop/src-tauri/Cargo.lock @@ -616,7 +616,7 @@ dependencies = [ [[package]] name = "capkit-desktop" -version = "0.6.1" +version = "0.6.2" dependencies = [ "ab_glyph", "arboard", diff --git a/apps/desktop/src-tauri/Cargo.toml b/apps/desktop/src-tauri/Cargo.toml index 020269e..693bb37 100644 --- a/apps/desktop/src-tauri/Cargo.toml +++ b/apps/desktop/src-tauri/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "capkit-desktop" -version = "0.6.1" +version = "0.6.2" description = "CapKit lightweight desktop toolkit to capture, record, and showcase" authors = ["CapKit"] edition = "2024" diff --git a/apps/desktop/src-tauri/tauri.conf.json b/apps/desktop/src-tauri/tauri.conf.json index bbb8624..eda50c8 100644 --- a/apps/desktop/src-tauri/tauri.conf.json +++ b/apps/desktop/src-tauri/tauri.conf.json @@ -1,7 +1,7 @@ { "$schema": "https://schema.tauri.app/config/2", "productName": "CapKit", - "version": "0.6.1", + "version": "0.6.2", "identifier": "com.snaphub.desktop", "build": { "beforeDevCommand": "pnpm dev", diff --git a/package.json b/package.json index 38fff24..01a9399 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "snaphub", - "version": "0.6.1", + "version": "0.6.2", "private": true, "packageManager": "pnpm@11.14.0", "scripts": {