From 0ee91268205ffca5f857dc51bace85c5a91689c9 Mon Sep 17 00:00:00 2001
From: Julian Dominguez-Schatz <julian.dominguezschatz@gmail.com>
Date: Mon, 8 Jul 2024 13:39:00 -0400
Subject: [PATCH] Disable interactivity on preview status icons (#2924)

* Disable interactivity on preview statuses

These have no click action but have a focus effect of a purple circle
(residual from the "Cleared" checkbox styling) that looks a bit glitchy.

* Add release notes

* Exclude status field from keyboard navigation
---
 .../components/transactions/TransactionsTable.jsx  | 14 +++++++++++---
 upcoming-release-notes/2924.md                     |  6 ++++++
 2 files changed, 17 insertions(+), 3 deletions(-)
 create mode 100644 upcoming-release-notes/2924.md

diff --git a/packages/desktop-client/src/components/transactions/TransactionsTable.jsx b/packages/desktop-client/src/components/transactions/TransactionsTable.jsx
index f0880f907..f06f4af9e 100644
--- a/packages/desktop-client/src/components/transactions/TransactionsTable.jsx
+++ b/packages/desktop-client/src/components/transactions/TransactionsTable.jsx
@@ -342,6 +342,7 @@ function StatusCell({
   selected,
   status,
   isChild,
+  isPreview,
   onEdit,
   onUpdate,
 }) {
@@ -384,12 +385,19 @@ function StatusCell({
           border: '1px solid transparent',
           borderRadius: 50,
           ':focus': {
-            border: '1px solid ' + theme.formInputBorderSelected,
-            boxShadow: '0 1px 2px ' + theme.formInputBorderSelected,
+            ...(isPreview
+              ? {
+                  boxShadow: 'none',
+                }
+              : {
+                  border: '1px solid ' + theme.formInputBorderSelected,
+                  boxShadow: '0 1px 2px ' + theme.formInputBorderSelected,
+                }),
           },
           cursor: isClearedField ? 'pointer' : 'default',
           ...(isChild && { visibility: 'hidden' }),
         }}
+        disabled={isPreview || isChild}
         onEdit={() => onEdit(id, 'cleared')}
         onSelect={onSelect}
       >
@@ -1965,7 +1973,7 @@ export const TransactionTable = forwardRef((props, ref) => {
         );
 
     if (isPreviewId(item.id)) {
-      fields = ['select', 'cleared'];
+      fields = ['select'];
     }
     if (isTemporaryId(item.id)) {
       // You can't focus the select/delete button of temporary
diff --git a/upcoming-release-notes/2924.md b/upcoming-release-notes/2924.md
new file mode 100644
index 000000000..0c0af51de
--- /dev/null
+++ b/upcoming-release-notes/2924.md
@@ -0,0 +1,6 @@
+---
+category: Bugfix
+authors: [jfdoming]
+---
+
+Disable interactivity on preview status icons
-- 
GitLab