fix: Scope loading spinner to diff pane only, keep sidebar always mounted
This commit is contained in:
@@ -234,49 +234,47 @@ export function ReviewTab({ initiativeId }: ReviewTabProps) {
|
||||
preview={previewState}
|
||||
/>
|
||||
|
||||
{/* Main content area */}
|
||||
{isDiffLoading ? (
|
||||
<div className="flex h-64 items-center justify-center text-muted-foreground gap-2">
|
||||
<Loader2 className="h-4 w-4 animate-spin" />
|
||||
Loading diff...
|
||||
</div>
|
||||
) : (
|
||||
<div className="grid grid-cols-1 lg:grid-cols-[1fr_260px]">
|
||||
{/* Left: Diff */}
|
||||
<div className="min-w-0 p-4">
|
||||
{files.length === 0 ? (
|
||||
<div className="flex h-32 items-center justify-center text-muted-foreground text-sm">
|
||||
{selectedCommit
|
||||
? "No changes in this commit"
|
||||
: "No changes in this phase"}
|
||||
</div>
|
||||
) : (
|
||||
<DiffViewer
|
||||
files={files}
|
||||
comments={comments}
|
||||
onAddComment={handleAddComment}
|
||||
onResolveComment={handleResolveComment}
|
||||
onUnresolveComment={handleUnresolveComment}
|
||||
/>
|
||||
)}
|
||||
</div>
|
||||
|
||||
{/* Right: Sidebar — sticky so icon strip stays visible */}
|
||||
<div className="border-l border-border">
|
||||
<div className="sticky top-0 h-[calc(100vh-12rem)]">
|
||||
<ReviewSidebar
|
||||
files={allFiles}
|
||||
comments={comments}
|
||||
onFileClick={handleFileClick}
|
||||
selectedCommit={selectedCommit}
|
||||
activeFiles={files}
|
||||
commits={commits}
|
||||
onSelectCommit={setSelectedCommit}
|
||||
/>
|
||||
{/* Main content area — sidebar always rendered to preserve state */}
|
||||
<div className="grid grid-cols-1 lg:grid-cols-[1fr_260px]">
|
||||
{/* Left: Diff */}
|
||||
<div className="min-w-0 p-4">
|
||||
{isDiffLoading ? (
|
||||
<div className="flex h-64 items-center justify-center text-muted-foreground gap-2">
|
||||
<Loader2 className="h-4 w-4 animate-spin" />
|
||||
Loading diff...
|
||||
</div>
|
||||
) : files.length === 0 ? (
|
||||
<div className="flex h-32 items-center justify-center text-muted-foreground text-sm">
|
||||
{selectedCommit
|
||||
? "No changes in this commit"
|
||||
: "No changes in this phase"}
|
||||
</div>
|
||||
) : (
|
||||
<DiffViewer
|
||||
files={files}
|
||||
comments={comments}
|
||||
onAddComment={handleAddComment}
|
||||
onResolveComment={handleResolveComment}
|
||||
onUnresolveComment={handleUnresolveComment}
|
||||
/>
|
||||
)}
|
||||
</div>
|
||||
|
||||
{/* Right: Sidebar — sticky so icon strip stays visible */}
|
||||
<div className="border-l border-border">
|
||||
<div className="sticky top-0 h-[calc(100vh-12rem)]">
|
||||
<ReviewSidebar
|
||||
files={allFiles}
|
||||
comments={comments}
|
||||
onFileClick={handleFileClick}
|
||||
selectedCommit={selectedCommit}
|
||||
activeFiles={files}
|
||||
commits={commits}
|
||||
onSelectCommit={setSelectedCommit}
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user