From d2587acad6c965d453bc9bcd5366d294b84f181e Mon Sep 17 00:00:00 2001 From: lankaukk Date: Thu, 4 Jan 2024 15:26:33 -0500 Subject: [PATCH 1/3] close comment pop up when marking as unread --- editor/src/components/canvas/controls/comment-popup.tsx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/editor/src/components/canvas/controls/comment-popup.tsx b/editor/src/components/canvas/controls/comment-popup.tsx index 3369ce187676..0cbba8ac2a46 100644 --- a/editor/src/components/canvas/controls/comment-popup.tsx +++ b/editor/src/components/canvas/controls/comment-popup.tsx @@ -285,7 +285,8 @@ const CommentThread = React.memo(({ comment }: CommentThreadProps) => { return } setThreadReadStatus(thread.id, 'unread') - }, [thread?.id, setThreadReadStatus]) + dispatch([switchEditorMode(EditorModes.commentMode(null, 'not-dragging'))]) + }, [thread?.id, setThreadReadStatus, dispatch]) const collabs = useStorage((storage) => storage.collaborators) From 87763e76b6fd9a8bef751cdb620b5397da3c26fa Mon Sep 17 00:00:00 2001 From: lankaukk Date: Thu, 4 Jan 2024 15:34:24 -0500 Subject: [PATCH 2/3] resolved comment indicators --- editor/src/components/canvas/controls/comment-indicator.tsx | 4 ++-- editor/src/components/user-bar.tsx | 3 ++- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/editor/src/components/canvas/controls/comment-indicator.tsx b/editor/src/components/canvas/controls/comment-indicator.tsx index d08d3509988d..9303a7c301d3 100644 --- a/editor/src/components/canvas/controls/comment-indicator.tsx +++ b/editor/src/components/canvas/controls/comment-indicator.tsx @@ -199,7 +199,6 @@ export const CommentIndicatorUI = React.memo((props) => position: 'fixed', top: position.y + 3, left: position.x - 3, - filter: resolved ? 'grayscale(1)' : undefined, width: IndicatorSize, height: IndicatorSize, background: read ? colorTheme.bg1.value : colorTheme.primary.value, @@ -208,6 +207,7 @@ export const CommentIndicatorUI = React.memo((props) => alignItems: 'center', justifyContent: 'center', boxShadow: UtopiaStyles.shadowStyles.mid.boxShadow, + opacity: resolved ? 0.6 : 'undefined', } const transform: Interpolation = { @@ -249,7 +249,7 @@ export const CommentIndicatorUI = React.memo((props) => justifyContent: 'center', }} > - + ) diff --git a/editor/src/components/user-bar.tsx b/editor/src/components/user-bar.tsx index 75af6028c600..2da2ed0b3102 100644 --- a/editor/src/components/user-bar.tsx +++ b/editor/src/components/user-bar.tsx @@ -341,6 +341,7 @@ interface AvatarPictureProps { initials: string size?: number isOffline?: boolean + resolved?: boolean } export const AvatarPicture = React.memo((props: AvatarPictureProps) => { @@ -370,7 +371,7 @@ export const AvatarPicture = React.memo((props: AvatarPictureProps) => { width: size ?? '100%', height: size ?? '100%', borderRadius: '100%', - filter: props.isOffline ? 'grayscale(1)' : undefined, + filter: props.isOffline || props.resolved ? 'grayscale(1)' : undefined, pointerEvents: 'none', }} src={url} From 8545cea03323b470b1fe39cfb84d0fa98a3d0b63 Mon Sep 17 00:00:00 2001 From: lankaukk Date: Fri, 5 Jan 2024 09:42:26 -0500 Subject: [PATCH 3/3] undo close when marking unread --- editor/src/components/canvas/controls/comment-popup.tsx | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/editor/src/components/canvas/controls/comment-popup.tsx b/editor/src/components/canvas/controls/comment-popup.tsx index 0cbba8ac2a46..3369ce187676 100644 --- a/editor/src/components/canvas/controls/comment-popup.tsx +++ b/editor/src/components/canvas/controls/comment-popup.tsx @@ -285,8 +285,7 @@ const CommentThread = React.memo(({ comment }: CommentThreadProps) => { return } setThreadReadStatus(thread.id, 'unread') - dispatch([switchEditorMode(EditorModes.commentMode(null, 'not-dragging'))]) - }, [thread?.id, setThreadReadStatus, dispatch]) + }, [thread?.id, setThreadReadStatus]) const collabs = useStorage((storage) => storage.collaborators)