Radish alpha
r
Radicle desktop app
Radicle
Git (anonymous pull)
Log in to clone via SSH
Add Changes section to Review
Rūdolfs Ošiņš committed 1 year ago
commit a28aa0d6abfa3bda148ff3188893ed0153c4e2b0
parent 65a5049a357b08949214f4140c849fa6f1f79f91
2 files changed +38 -32
modified src/components/Changes.svelte
@@ -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>
-
            </div>
-
            <div class="commits">
-
              {#each commits.reverse() as commit}
-
                <div class="commit" style:position="relative">
-
                  <div class="commit-dot"></div>
-
                  <CobCommitTeaser {commit} />
-
                </div>
-
              {/each}
+
  {#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>
-
        {/snippet}
-
      </CommitsContainer>
-
    </div>
-
  {/await}
+
          {/snippet}
+
        </CommitsContainer>
+
      </div>
+
    {/await}
+
  {/if}

  {#await loadHighlightedDiff(rid, revision.base, revision.head)}
    <span class="txt-small">Loading…</span>
modified src/components/Review.svelte
@@ -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>