fix: Prevent comment sidebar from opening unexpectedly (#11845)

* fix: Prevent comment sidebar from opening unexpectedly

Guard against stale cross-document focused comments opening the sidebar
by checking the comment's documentId matches the current document. Also
stop restoring rightSidebar state from localStorage on app load so the
sidebar always starts closed.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* fix: Restore rightSidebar persistence on page reload

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Tom Moor
2026-03-22 12:10:15 -04:00
committed by GitHub
parent 8f541eb321
commit 5691ea5ae3
+1 -1
View File
@@ -93,7 +93,7 @@ function DocumentEditor(props: Props, ref: React.RefObject<any>) {
}, [ref]);
React.useEffect(() => {
if (focusedComment) {
if (focusedComment && focusedComment.documentId === document.id) {
const viewingResolved = params.get("resolved") === "";
if (
(focusedComment.isResolved && !viewingResolved) ||