fix(comments): remount AnnotationCommentPanel when switching annotations
Some checks failed
CI / Unit & Component Tests (push) Failing after 2m13s
CI / Backend Unit Tests (push) Successful in 2m23s
CI / E2E Tests (push) Failing after 24m41s
CI / Unit & Component Tests (pull_request) Failing after 2m8s
CI / Backend Unit Tests (pull_request) Successful in 2m8s
CI / E2E Tests (pull_request) Has been cancelled
Some checks failed
CI / Unit & Component Tests (push) Failing after 2m13s
CI / Backend Unit Tests (push) Successful in 2m23s
CI / E2E Tests (push) Failing after 24m41s
CI / Unit & Component Tests (pull_request) Failing after 2m8s
CI / Backend Unit Tests (pull_request) Successful in 2m8s
CI / E2E Tests (pull_request) Has been cancelled
Wrap the panel in {#key activeAnnotationId} so Svelte destroys and
recreates it on every annotation change, triggering onMount and
loading the correct comments.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -452,18 +452,20 @@ function zoomOut() {
|
|||||||
{/if}
|
{/if}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
{#if activeAnnotationId}
|
{#key activeAnnotationId}
|
||||||
<AnnotationCommentPanel
|
{#if activeAnnotationId}
|
||||||
documentId={documentId}
|
<AnnotationCommentPanel
|
||||||
annotationId={activeAnnotationId}
|
documentId={documentId}
|
||||||
canComment={canComment ?? false}
|
annotationId={activeAnnotationId}
|
||||||
currentUserId={currentUserId ?? null}
|
canComment={canComment ?? false}
|
||||||
canAdmin={canAdmin ?? false}
|
currentUserId={currentUserId ?? null}
|
||||||
onClose={() => (activeAnnotationId = null)}
|
canAdmin={canAdmin ?? false}
|
||||||
onCountChange={(count) => {
|
onClose={() => (activeAnnotationId = null)}
|
||||||
if (activeAnnotationId) commentCounts.set(activeAnnotationId, count);
|
onCountChange={(count) => {
|
||||||
}}
|
if (activeAnnotationId) commentCounts.set(activeAnnotationId, count);
|
||||||
/>
|
}}
|
||||||
{/if}
|
/>
|
||||||
|
{/if}
|
||||||
|
{/key}
|
||||||
</div>
|
</div>
|
||||||
{/if}
|
{/if}
|
||||||
|
|||||||
Reference in New Issue
Block a user