fix(transcription): always show comment list, compose box on demand
Some checks failed
CI / Unit & Component Tests (push) Has been cancelled
CI / Backend Unit Tests (push) Has been cancelled
CI / E2E Tests (push) Has been cancelled
CI / Unit & Component Tests (pull_request) Has been cancelled
CI / Backend Unit Tests (pull_request) Has been cancelled
CI / E2E Tests (pull_request) Has been cancelled
Some checks failed
CI / Unit & Component Tests (push) Has been cancelled
CI / Backend Unit Tests (push) Has been cancelled
CI / E2E Tests (push) Has been cancelled
CI / Unit & Component Tests (pull_request) Has been cancelled
CI / Backend Unit Tests (pull_request) Has been cancelled
CI / E2E Tests (pull_request) Has been cancelled
Comments were only visible after clicking "Kommentieren". Now: - Comment list always renders (CommentThread with loadOnMount=true) - Compose box hidden by default (showCompose prop on CommentThread) - Clicking "Kommentieren" sets commentOpen=true → shows compose box - Closing hides compose box but comments remain visible This separates "viewing comments" (always) from "writing a comment" (on demand via Kommentieren button). Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -14,7 +14,6 @@ type Props = {
|
||||
saveState: SaveState;
|
||||
canComment: boolean;
|
||||
currentUserId: string | null;
|
||||
commentCount: number;
|
||||
onTextChange: (text: string) => void;
|
||||
onFocus: () => void;
|
||||
onDeleteClick: () => void;
|
||||
@@ -31,7 +30,6 @@ let {
|
||||
saveState,
|
||||
canComment,
|
||||
currentUserId,
|
||||
commentCount,
|
||||
onTextChange,
|
||||
onFocus,
|
||||
onDeleteClick,
|
||||
@@ -39,7 +37,7 @@ let {
|
||||
}: Props = $props();
|
||||
|
||||
let localText = $state(text);
|
||||
let commentOpen = $state(commentCount > 0);
|
||||
let commentOpen = $state(false);
|
||||
let selectedQuote = $state<string | null>(null);
|
||||
let textareaEl = $state<HTMLTextAreaElement | null>(null);
|
||||
|
||||
@@ -199,34 +197,18 @@ function captureSelectionAndOpenComments() {
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Comment thread (expandable) -->
|
||||
{#if commentOpen}
|
||||
<div class="mt-3 border-t border-line pt-3">
|
||||
<div class="mb-2 flex items-center justify-between">
|
||||
<span class="font-sans text-xs font-semibold text-ink-2">
|
||||
{m.comment_section_title()}
|
||||
</span>
|
||||
<button
|
||||
type="button"
|
||||
class="font-sans text-xs text-ink-3 transition-colors hover:text-ink"
|
||||
onclick={() => {
|
||||
commentOpen = false;
|
||||
selectedQuote = null;
|
||||
}}
|
||||
>
|
||||
{m.comment_panel_close()}
|
||||
</button>
|
||||
</div>
|
||||
<CommentThread
|
||||
documentId={documentId}
|
||||
blockId={blockId}
|
||||
loadOnMount={true}
|
||||
canComment={canComment}
|
||||
currentUserId={currentUserId}
|
||||
canAdmin={false}
|
||||
quotedText={selectedQuote}
|
||||
/>
|
||||
</div>
|
||||
{/if}
|
||||
<!-- Comment thread — list always visible, compose toggled by Kommentieren -->
|
||||
<div class="mt-3 border-t border-line pt-3">
|
||||
<CommentThread
|
||||
documentId={documentId}
|
||||
blockId={blockId}
|
||||
loadOnMount={true}
|
||||
canComment={canComment}
|
||||
currentUserId={currentUserId}
|
||||
canAdmin={false}
|
||||
quotedText={selectedQuote}
|
||||
showCompose={commentOpen}
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user