Radish alpha
r
Radicle web interface
Radicle
Git (anonymous pull)
Log in to clone via SSH
Distinguish git commits from radicle ids
Sebastian Martinez committed 2 years ago
commit 7b25d5ba568a1b758ed527920036e9157de184dd
parent f3966b00b8d3d4c1496b648297751a1d0f13ce12
17 files changed +41 -31
modified public/index.css
@@ -68,13 +68,20 @@ pre {
  margin: 0;
}

-
.global-hash {
+
.global-oid {
  color: var(--color-foreground-emphasized);
  font-size: var(--font-size-small);
  font-family: var(--font-family-monospace);
  font-weight: var(--font-weight-regular);
}

+
.global-commit {
+
  color: var(--color-foreground);
+
  font-size: var(--font-size-small);
+
  font-family: var(--font-family-monospace);
+
  font-weight: var(--font-weight-semibold);
+
}
+

.global-counter {
  border-radius: var(--border-radius-tiny);
  background-color: var(--color-fill-ghost);
modified src/App/Header/Breadcrumbs/ProjectSegment.svelte
@@ -93,17 +93,17 @@

{#if activeRoute.resource === "project.commit"}
  <Separator />
-
  <CopyableId id={activeRoute.params.commit.commit.id}>
+
  <CopyableId id={activeRoute.params.commit.commit.id} style="commit">
    {utils.formatCommit(activeRoute.params.commit.commit.id)}
  </CopyableId>
{:else if activeRoute.resource === "project.issue"}
  <Separator />
-
  <CopyableId id={activeRoute.params.issue.id}>
+
  <CopyableId id={activeRoute.params.issue.id} style="oid">
    {utils.formatObjectId(activeRoute.params.issue.id)}
  </CopyableId>
{:else if activeRoute.resource === "project.patch"}
  <Separator />
-
  <CopyableId id={activeRoute.params.patch.id}>
+
  <CopyableId id={activeRoute.params.patch.id} style="oid">
    {utils.formatObjectId(activeRoute.params.patch.id)}
  </CopyableId>
{/if}
modified src/components/CopyableId.svelte
@@ -3,6 +3,8 @@
  import Clipboard from "@app/components/Clipboard.svelte";

  export let id: string;
+
  export let style: "commit" | "oid";
+

  let clipboard: SvelteComponent;
</script>

@@ -26,7 +28,10 @@
    clipboard.copy();
  }}
  class="id">
-
  <span class="txt-overflow global-hash">
+
  <span
+
    class="txt-overflow"
+
    class:global-commit={style === "commit"}
+
    class:global-oid={style === "oid"}>
    <slot>{id}</slot>
  </span>
  <Clipboard bind:this={clipboard} text={id} />
modified src/components/NodeId.svelte
@@ -63,7 +63,7 @@
        {/if}
      </div>

-
      <CopyableId id={nodeId}>
+
      <CopyableId id={nodeId} style="oid">
        {formatNodeId(nodeId)}
      </CopyableId>
    </div>
modified src/components/ProjectCard.svelte
@@ -123,7 +123,7 @@
        {/if}
      </div>
      <div class="description" use:twemoji>{description}</div>
-
      <div class="global-hash">
+
      <div class="global-commit">
        {#if compact}
          {formatCommit(head)}
        {:else}
modified src/views/nodes/View.svelte
@@ -124,13 +124,13 @@
            {#each externalAddresses as address}
              <!-- If there are externalAddresses this is probably a remote node -->
              <!-- in that case, we show all the defined externalAddresses as a listing -->
-
              <CopyableId id={`${nid}@${address}`}>
+
              <CopyableId id={`${nid}@${address}`} style="oid">
                {truncateId(nid)}@{address}
              </CopyableId>
            {:else}
              <!-- else this is probably a local node -->
              <!-- So we show only the nid -->
-
              <CopyableId id={nid} />
+
              <CopyableId id={nid} style="oid" />
            {/each}
          </div>
          <div class="version">
modified src/views/projects/Cob/CobCommitTeaser.svelte
@@ -40,6 +40,10 @@
    gap: 1rem;
    margin-left: auto;
  }
+
  .commit {
+
    color: var(--color-foreground);
+
    font-weight: var(--font-weight-semibold);
+
  }
  .summary:hover {
    text-decoration: underline;
  }
@@ -81,9 +85,7 @@
    <div style:display="flex" style:gap="1rem" style:height="1.5rem">
      <div style:margin-bottom="1rem">
        <CommitAuthorship header={commit}>
-
          <span
-
            class="global-hash"
-
            style:color="var(--color-foreground-yellow)">
+
          <span class="commit txt-monospace">
            {formatCommit(commit.id)}
          </span>
        </CommitAuthorship>
modified src/views/projects/Cob/Revision.svelte
@@ -254,7 +254,7 @@
        <ExpandButton {expanded} on:toggle={() => (expanded = !expanded)} />
        <span>
          Revision
-
          <span class="global-hash">{utils.formatObjectId(revisionId)}</span>
+
          <span class="global-oid">{utils.formatObjectId(revisionId)}</span>
        </span>
      </div>
      <div class="revision-data">
@@ -385,7 +385,7 @@
              opened this patch
            {:else}
              updated to
-
              <span class="global-hash">
+
              <span class="global-oid">
                {utils.formatObjectId(revisionId)}
              </span>
            {/if}
@@ -483,11 +483,11 @@
              </NodeId>

              merged revision
-
              <span class="global-hash">
+
              <span class="global-oid">
                {utils.formatObjectId(element.inner.revision)}
              </span>
              at commit
-
              <span class="global-hash">
+
              <span class="global-commit">
                {utils.formatCommit(element.inner.commit)}
              </span>
              <span
@@ -513,7 +513,7 @@
              body={review.summary ?? ""}>
              <div slot="caption">
                {formatVerdict(review.verdict)}
-
                <span class="global-hash">
+
                <span class="global-oid">
                  {utils.formatObjectId(revisionId)}
                </span>
              </div>
modified src/views/projects/Commit.svelte
@@ -36,7 +36,7 @@
      <InlineMarkdown fontSize="large" content={header.summary} />
      <pre class="description txt-small">{header.description}</pre>
      <CommitAuthorship {header}>
-
        <span class="global-hash">{formatCommit(header.id)}</span>
+
        <span class="global-commit">{formatCommit(header.id)}</span>
      </CommitAuthorship>
    </div>
    <Changeset
modified src/views/projects/Commit/CommitTeaser.svelte
@@ -86,7 +86,7 @@
      </div>
    {/if}
    <CommitAuthorship header={commit}>
-
      <span class="global-hash">{formatCommit(commit.id)}</span>
+
      <span class="global-commit">{formatCommit(commit.id)}</span>
    </CommitAuthorship>
  </div>
  <div class="right">
modified src/views/projects/Issue.svelte
@@ -564,7 +564,7 @@
        <div class="author" slot="author">
          <NodeId nodeId={issue.author.id} alias={issue.author.alias} />
          opened
-
          <span class="global-hash">{utils.formatObjectId(issue.id)}</span>
+
          <span class="global-oid">{utils.formatObjectId(issue.id)}</span>
          <span style:color="var(--color-foreground-dim)">
            {utils.formatTimestamp(issue.discussion[0].timestamp)}
          </span>
modified src/views/projects/Issue/IssueTeaser.svelte
@@ -127,7 +127,7 @@
    <div class="summary subtitle">
      <NodeId nodeId={issue.author.id} alias={issue.author.alias} />
      opened
-
      <span class="global-hash">{formatObjectId(issue.id)}</span>
+
      <span class="global-oid">{formatObjectId(issue.id)}</span>
      <span style:color="var(--color-foreground-dim)">
        {formatTimestamp(issue.discussion[0].timestamp)}
      </span>
modified src/views/projects/Patch.svelte
@@ -735,7 +735,7 @@
        <div class="author" slot="author">
          <NodeId nodeId={patch.author.id} alias={patch.author.alias} />
          opened
-
          <span class="global-hash">{utils.formatObjectId(patch.id)}</span>
+
          <span class="global-oid">{utils.formatObjectId(patch.id)}</span>
          <span style:color="var(--color-foreground-dim)">
            {utils.formatTimestamp(patch.revisions[0].timestamp)}
          </span>
modified src/views/projects/Patch/PatchTeaser.svelte
@@ -155,9 +155,9 @@
      <span class="subtitle">
        <NodeId nodeId={patch.author.id} alias={patch.author.alias} />
        {patch.revisions.length > 1 ? "updated" : "opened"}
-
        <span class="global-hash">{formatObjectId(patch.id)}</span>
+
        <span class="global-oid">{formatObjectId(patch.id)}</span>
        {#if patch.revisions.length > 1}
-
          to <span class="global-hash">
+
          to <span class="global-oid">
            {formatObjectId(patch.revisions[patch.revisions.length - 1].id)}
          </span>
        {/if}
modified src/views/projects/Source/Blob.svelte
@@ -187,9 +187,7 @@
            commit: lastCommit.id,
          }}>
          <Button variant="gray" styleBorderRadius="0">
-
            <span
-
              class="global-hash"
-
              style:font-weight="var(--font-weight-bold)">
+
            <span class="global-commit">
              {lastCommit.id.slice(0, 7)}
            </span>
          </Button>
modified src/views/projects/Source/BranchSelector.svelte
@@ -109,9 +109,7 @@
        node,
        commit: selectedCommitId,
      }}>
-
      <div
-
        class="identifier global-hash"
-
        style:font-weight="var(--font-weight-bold)">
+
      <div class="identifier global-commit">
        {#if !selectedBranch}
          <IconSmall name="branch" />
        {/if}
modified src/views/projects/Source/ProjectNameHeader.svelte
@@ -125,7 +125,7 @@
    </div>
  </div>
  <div class="id">
-
    <CopyableId id={project.id} />
+
    <CopyableId id={project.id} style="oid" />
  </div>
</div>
<div class="description" use:twemoji>