ui:update findpreview and commentlist

This commit is contained in:
2025-11-22 11:39:18 +01:00
parent 63b3e5112b
commit 42d7246cff
4 changed files with 21 additions and 11 deletions

View File

@@ -75,7 +75,6 @@
<style> <style>
.comment-form { .comment-form {
padding: 0.75rem 1rem; padding: 0.75rem 1rem;
border-top: 1px solid hsl(var(--border));
background: hsl(var(--background)); background: hsl(var(--background));
flex-shrink: 0; flex-shrink: 0;
} }

View File

@@ -92,6 +92,12 @@
{#if isExpanded} {#if isExpanded}
<div class="comments-container"> <div class="comments-container">
{#if showCommentForm}
<div class="comment-form-container">
<CommentForm onSubmit={handleAddComment} />
</div>
{/if}
{#if $commentsState.isLoading && !hasLoadedComments} {#if $commentsState.isLoading && !hasLoadedComments}
{@render loadingSkeleton()} {@render loadingSkeleton()}
{:else if $commentsState.error} {:else if $commentsState.error}
@@ -119,10 +125,6 @@
{/if} {/if}
</div> </div>
{/if} {/if}
{#if showCommentForm}
<CommentForm onSubmit={handleAddComment} />
{/if}
</div> </div>
{/if} {/if}
</div> </div>
@@ -148,14 +150,21 @@
} }
.comments-container { .comments-container {
border-top: 1px solid hsl(var(--border));
margin-top: 0.5rem;
display: flex; display: flex;
flex-direction: column; flex-direction: column;
height: 100%; height: 100%;
min-height: 0; min-height: 0;
} }
.comment-form-container {
flex-shrink: 0;
border-bottom: 1px solid hsl(var(--border));
position: sticky;
top: 0;
background: hsl(var(--background));
z-index: 1;
}
.comments { .comments {
padding: 0.75rem 0; padding: 0.75rem 0;
} }
@@ -165,6 +174,7 @@
overflow-y: auto; overflow-y: auto;
padding: 0.75rem 1rem; padding: 0.75rem 1rem;
min-height: 0; min-height: 0;
max-height: 300px;
} }
.see-more { .see-more {

View File

@@ -151,7 +151,7 @@
<CommentsList <CommentsList
findId={id} findId={id}
{currentUserId} {currentUserId}
collapsed={false} collapsed={true}
maxComments={5} maxComments={5}
showCommentForm={true} showCommentForm={true}
/> />

View File

@@ -260,6 +260,7 @@
<CommentsList <CommentsList
findId={find.id} findId={find.id}
{currentUserId} {currentUserId}
collapsed={false}
isScrollable={true} isScrollable={true}
showCommentForm={true} showCommentForm={true}
/> />
@@ -307,7 +308,8 @@
width: 100%; width: 100%;
min-width: 0; min-width: 0;
max-width: none; max-width: none;
height: 90vh; height: auto;
max-height: calc(90vh - 20px);
border-radius: 16px 16px 0 0; border-radius: 16px 16px 0 0;
animation: slideUp 0.3s ease-out; animation: slideUp 0.3s ease-out;
} }
@@ -534,7 +536,6 @@
gap: 0.5rem; gap: 0.5rem;
color: hsl(var(--muted-foreground)); color: hsl(var(--muted-foreground));
font-size: 0.875rem; font-size: 0.875rem;
margin-bottom: 1.5rem;
} }
.actions { .actions {
@@ -588,7 +589,7 @@
flex-direction: column; flex-direction: column;
background: rgba(255, 255, 255, 0.5); background: rgba(255, 255, 255, 0.5);
max-height: 400px; max-height: 400px;
overflow-y: auto; overflow: hidden;
} }
/* Mobile specific adjustments */ /* Mobile specific adjustments */