Add Changes section to Review

This commit is contained in:
Rūdolfs Ošiņš
2025-03-14 16:45:05 -06:00
parent 65a5049a35
commit a28aa0d6ab
2 changed files with 38 additions and 32 deletions
+31 -28
View File
@@ -13,13 +13,14 @@
import NakedButton from "@app/components/NakedButton.svelte";
interface Props {
rid: string;
patchId: string;
revision: Revision;
rid: string;
showCommits?: boolean;
}
/* eslint-disable prefer-const */
let { rid, patchId, revision }: Props = $props();
let { patchId, revision, rid, showCommits = true }: Props = $props();
/* eslint-enable prefer-const */
let hideChanges = $state(false);
@@ -110,33 +111,35 @@
</div>
<div class:hide={hideChanges}>
{#await loadCommits(rid, revision.base, revision.head) then commits}
<div style:margin-bottom="1rem">
<CommitsContainer expanded={filesExpanded}>
{#snippet leftHeader()}
<div class="txt-semibold">Commits</div>
{/snippet}
{#snippet children()}
<div style:padding="0 1rem">
<div
class="global-flex txt-small"
style:color="var(--color-foreground-dim)">
<Icon name="branch" /><Id id={revision.base} variant="commit" />
<div class="global-counter">base</div>
{#if showCommits}
{#await loadCommits(rid, revision.base, revision.head) then commits}
<div style:margin-bottom="1rem">
<CommitsContainer expanded={filesExpanded}>
{#snippet leftHeader()}
<div class="txt-semibold">Commits</div>
{/snippet}
{#snippet children()}
<div style:padding="0 1rem">
<div
class="global-flex txt-small"
style:color="var(--color-foreground-dim)">
<Icon name="branch" /><Id id={revision.base} variant="commit" />
<div class="global-counter">base</div>
</div>
<div class="commits">
{#each commits.reverse() as commit}
<div class="commit" style:position="relative">
<div class="commit-dot"></div>
<CobCommitTeaser {commit} />
</div>
{/each}
</div>
</div>
<div class="commits">
{#each commits.reverse() as commit}
<div class="commit" style:position="relative">
<div class="commit-dot"></div>
<CobCommitTeaser {commit} />
</div>
{/each}
</div>
</div>
{/snippet}
</CommitsContainer>
</div>
{/await}
{/snippet}
</CommitsContainer>
</div>
{/await}
{/if}
{#await loadHighlightedDiff(rid, revision.base, revision.head)}
<span class="txt-small">Loading…</span>
+7 -4
View File
@@ -18,24 +18,25 @@
import { nodeRunning } from "@app/lib/events";
import Border from "@app/components/Border.svelte";
import Changes from "@app/components/Changes.svelte";
import CommentComponent from "@app/components/Comment.svelte";
import Discussion from "@app/components/Discussion.svelte";
import Icon from "@app/components/Icon.svelte";
import Id from "@app/components/Id.svelte";
import LabelInput from "@app/components/LabelInput.svelte";
import NakedButton from "@app/components/NakedButton.svelte";
import NodeId from "@app/components/NodeId.svelte";
import VerdictBadge from "@app/components/VerdictBadge.svelte";
import VerdictButton from "@app/components/VerdictButton.svelte";
import VerdictBadge from "./VerdictBadge.svelte";
import Discussion from "./Discussion.svelte";
interface Props {
config: Config;
onNavigateBack: () => void;
patchId: string;
reload: (reviewId?: string) => Promise<void>;
repo: RepoInfo;
review: Review;
revision: Revision;
repo: RepoInfo;
}
const {
@@ -43,9 +44,9 @@
onNavigateBack,
patchId,
reload,
repo,
review,
revision,
repo,
}: Props = $props();
const contributors = $derived(
@@ -348,4 +349,6 @@
{createComment}
{editComment}
{reactOnComment} />
<Changes rid={repo.rid} showCommits={false} {patchId} {revision} />
</div>