From 8778629f625f2bbdabf93c59e6741c1c2415b0f8 Mon Sep 17 00:00:00 2001 From: Lu Wilson Date: Tue, 16 Apr 2024 13:42:26 +0100 Subject: [PATCH] Only show cursor chat button in select mode (#3485) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This PR hides the cursor chat context menu button when not in select tool. fixes https://github.com/orgs/tldraw/projects/41/views/1?pane=issue&itemId=59908615 ### Change Type - [ ] `sdk` — Changes the tldraw SDK - [x] `dotcom` — Changes the tldraw.com web app - [ ] `docs` — Changes to the documentation, examples, or templates. - [ ] `vs code` — Changes to the vscode plugin - [ ] `internal` — Does not affect user-facing stuff - [x] `bugfix` — Bug fix - [ ] `feature` — New feature - [ ] `improvement` — Improving existing features - [ ] `chore` — Updating dependencies, other boring stuff - [ ] `galaxy brain` — Architectural changes - [ ] `tests` — Changes to any test code - [ ] `tools` — Changes to infrastructure, CI, internal scripts, debugging tools, etc. - [ ] `dunno` — I don't know ### Test Plan 1. Add a step-by-step description of how to test your PR here. 2. - [ ] Unit Tests - [ ] End to end tests ### Release Notes - Fix cursor chat button appearing when not in select tool. --- apps/dotcom/src/utils/context-menu/CursorChatMenuItem.tsx | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/apps/dotcom/src/utils/context-menu/CursorChatMenuItem.tsx b/apps/dotcom/src/utils/context-menu/CursorChatMenuItem.tsx index 5a6872d56..b51b2fdb2 100644 --- a/apps/dotcom/src/utils/context-menu/CursorChatMenuItem.tsx +++ b/apps/dotcom/src/utils/context-menu/CursorChatMenuItem.tsx @@ -6,9 +6,7 @@ export function CursorChatMenuItem() { const actions = useActions() const shouldShow = useValue( 'show cursor chat', - () => { - return !editor.getInstanceState().isCoarsePointer - }, + () => editor.getCurrentToolId() === 'select' && !editor.getInstanceState().isCoarsePointer, [editor] )