Radish alpha
r
rad:z4V1sjrXqjvFdnCUbxPFqd5p4DtH5
Radicle web interface
Radicle
Git
Add submodules improvements
Merged did:key:z6MkkfM3...sVz5 opened 2 years ago

Also display submodules in nested folders, and show them as foreground-dim. Adds also a title to explain what the entry is and to look at the nearest .gitmodules file

Fix assignee and peer switching e2e tests

check check-visual check-unit-test check-httpd-api-unit-test check-e2e check-build

👉 Preview
👉 Workflow runs
👉 Branch on GitHub

8 files changed +58 -43 5b30269c ab86033c
modified flake.lock
@@ -37,30 +37,6 @@
        "type": "github"
      }
    },
-
    "fenix": {
-
      "inputs": {
-
        "nixpkgs": [
-
          "heartwood",
-
          "nixpkgs"
-
        ],
-
        "rust-analyzer-src": [
-
          "heartwood"
-
        ]
-
      },
-
      "locked": {
-
        "lastModified": 1701930186,
-
        "narHash": "sha256-t9uIiU1fE7VXi3t460iOuAUW8Ece9mowRKva1aw48zI=",
-
        "owner": "nix-community",
-
        "repo": "fenix",
-
        "rev": "aeb764a8e4c16da3f36b200a302552d8e457b9f4",
-
        "type": "github"
-
      },
-
      "original": {
-
        "owner": "nix-community",
-
        "repo": "fenix",
-
        "type": "github"
-
      }
-
    },
    "flake-utils": {
      "inputs": {
        "systems": "systems"
@@ -83,22 +59,22 @@
      "inputs": {
        "advisory-db": "advisory-db",
        "crane": "crane",
-
        "fenix": "fenix",
        "flake-utils": "flake-utils",
-
        "nixpkgs": "nixpkgs"
+
        "nixpkgs": "nixpkgs",
+
        "rust-overlay": "rust-overlay"
      },
      "locked": {
-
        "lastModified": 1708953793,
-
        "narHash": "sha256-DGgH8+ibr1WspyUeKeHaW87VzYHf9jzzjyFlOeT6ZoA=",
+
        "lastModified": 1710160177,
+
        "narHash": "sha256-lR9AF8m60UzPWittctKgeFaTekY/ZSAr6NdsMbRMleI=",
        "ref": "master",
-
        "rev": "a48081f2717f069d456ec09f31d9e639b232dbed",
-
        "revCount": 1712,
+
        "rev": "570a7eb141b6ba001713c46345d79b6fead1ca15",
+
        "revCount": 1758,
        "type": "git",
        "url": "https://seed.radicle.xyz/z3gqcJUoA1n9HaHKufZs5FCSGazv5.git"
      },
      "original": {
        "ref": "master",
-
        "rev": "a48081f2717f069d456ec09f31d9e639b232dbed",
+
        "rev": "570a7eb141b6ba001713c46345d79b6fead1ca15",
        "type": "git",
        "url": "https://seed.radicle.xyz/z3gqcJUoA1n9HaHKufZs5FCSGazv5.git"
      }
@@ -132,6 +108,31 @@
        ]
      }
    },
+
    "rust-overlay": {
+
      "inputs": {
+
        "flake-utils": [
+
          "heartwood",
+
          "flake-utils"
+
        ],
+
        "nixpkgs": [
+
          "heartwood",
+
          "nixpkgs"
+
        ]
+
      },
+
      "locked": {
+
        "lastModified": 1710123130,
+
        "narHash": "sha256-EoGL/WSM1M2L099Q91mPKO/FRV2iu2ZLOEp3y5sLfiE=",
+
        "owner": "oxalica",
+
        "repo": "rust-overlay",
+
        "rev": "73aca260afe5d41d3ebce932c8d896399c9d5174",
+
        "type": "github"
+
      },
+
      "original": {
+
        "owner": "oxalica",
+
        "repo": "rust-overlay",
+
        "type": "github"
+
      }
+
    },
    "systems": {
      "locked": {
        "lastModified": 1681028828,
modified flake.nix
@@ -4,7 +4,7 @@
    nixpkgs.follows = "heartwood/nixpkgs";
    flake-utils.follows = "heartwood/flake-utils";
    heartwood = {
-
      url = "git+https://seed.radicle.xyz/z3gqcJUoA1n9HaHKufZs5FCSGazv5.git?ref=master&rev=a48081f2717f069d456ec09f31d9e639b232dbed";
+
      url = "git+https://seed.radicle.xyz/z3gqcJUoA1n9HaHKufZs5FCSGazv5.git?ref=master&rev=570a7eb141b6ba001713c46345d79b6fead1ca15";
    };
  };

@@ -73,7 +73,7 @@
          pname = "radicle-interface";
          version = "1.0.0";
          src = ./.;
-
          npmDepsHash = "sha256-fh49kEDPLGu9weFpU+sOwvpayNpp7VCF6zzkty381A=";
+
          npmDepsHash = "sha256-wg5TOPbBP5FN/ERHc3WniztA86ca5tHYLcPJtGDR1A0=";
          postPatch = ''
            patchShebangs --build ./scripts
            mkdir -p "public/twemoji"
modified src/components/IconSmall.svelte
@@ -53,6 +53,7 @@
    | "online"
    | "patch"
    | "plus"
+
    | "repo"
    | "settings"
    | "share"
    | "user";
@@ -497,6 +498,11 @@
      fill-rule="evenodd"
      clip-rule="evenodd"
      d="M13.1667 8C13.1667 8.27614 12.9428 8.5 12.6667 8.5L3.33334 8.5C3.0572 8.5 2.83334 8.27614 2.83334 8C2.83334 7.72386 3.0572 7.5 3.33334 7.5L12.6667 7.5C12.9428 7.5 13.1667 7.72386 13.1667 8Z" />
+
  {:else if name === "repo"}
+
    <path
+
      fill-rule="evenodd"
+
      clip-rule="evenodd"
+
      d="M8.3143 2.03576C8.43351 1.98808 8.56649 1.98808 8.6857 2.03576L14.6857 4.43576C14.8755 4.51169 15 4.69555 15 4.9V12.1C15 12.3045 14.8755 12.4883 14.6857 12.5642L8.6857 14.9642C8.56649 15.0119 8.43351 15.0119 8.3143 14.9642L2.3143 12.5642C2.12448 12.4883 2 12.3045 2 12.1V4.9C2 4.69555 2.12448 4.51169 2.3143 4.43576L8.3143 2.03576ZM3 5.63852L8 7.63852V13.7615L3 11.7615V5.63852ZM9 13.7615L14 11.7615V5.63852L9 7.63852V13.7615ZM8.5 6.76148L13.1537 4.9L8.5 3.03852L3.84629 4.9L8.5 6.76148Z" />
  {:else if name === "settings"}
    <path
      d="M12.5 4C12.5 3.44772 12.0523 3 11.5 3C10.9477 3 10.5 3.44772 10.5 4C10.5 4.55228 10.9477 5 11.5 5H14C14.2761 5 14.5 4.77614 14.5 4.5C14.5 4.22386 14.2761 4 14 4H12.5Z" />
modified src/views/projects/Cob/AssigneeInput.svelte
@@ -33,7 +33,7 @@
      const parsedNodeId = parseNodeId(inputValue);
      if (parsedNodeId) {
        assignee = `${parsedNodeId.prefix}${parsedNodeId.pubkey}`;
-
        if (!updatedAssignees.find(({ id }) => id === assignee)) {
+
        if (updatedAssignees.find(({ id }) => id === assignee)) {
          valid = false;
          validationMessage = "This assignee is already added";
        } else {
modified src/views/projects/Patch.svelte
@@ -220,7 +220,9 @@
          revision: revisionId,
          comment: commentId,
          reaction,
-
          active: Boolean(authors.find(({ id }) => id === session.publicKey)),
+
          active: !authors.find(
+
            ({ id }) => utils.parseNodeId(id)?.pubkey === session.publicKey,
+
          ),
        },
        session.id,
      );
@@ -378,7 +380,9 @@
          type: "revision.react",
          revision: revisionId,
          reaction,
-
          active: Boolean(authors.find(({ id }) => id === session.publicKey)),
+
          active: !authors.find(
+
            ({ id }) => utils.parseNodeId(id)?.pubkey === session.publicKey,
+
          ),
        },
        session.id,
      );
modified src/views/projects/Source/Tree/Folder.svelte
@@ -8,6 +8,7 @@

  import File from "./File.svelte";
  import IconSmall from "@app/components/IconSmall.svelte";
+
  import Submodule from "./Submodule.svelte";

  export let baseUrl: BaseUrl;
  export let currentPath: string;
@@ -107,6 +108,8 @@
              {peer}
              {projectId}
              {revision} />
+
          {:else if entry.kind === "submodule"}
+
            <Submodule name={entry.name} oid={entry.oid} />
          {:else}
            <Link
              route={{
modified src/views/projects/Source/Tree/Submodule.svelte
@@ -7,7 +7,8 @@
</script>

<style>
-
  .file {
+
  .submodule {
+
    color: var(--color-foreground-dim);
    border-radius: var(--border-radius-tiny);
    display: flex;
    line-height: 1.5em;
@@ -21,13 +22,11 @@
    user-select: none;
    white-space: nowrap;
    text-overflow: ellipsis !important;
-
    color: var(--color-foreground-dim);
    overflow: hidden;
    font-size: var(--font-size-small);
    font-weight: var(--font-weight-medium);
  }
  .icon-container {
-
    color: var(--color-fill-secondary);
    display: flex;
    justify-content: center;
    align-items: center;
@@ -35,9 +34,11 @@
  }
</style>

-
<div class="file">
+
<div
+
  class="submodule"
+
  title="This is a git submodule, for more information look at the nearest .gitmodules file">
  <div class="icon-container">
-
    <IconSmall name="link" />
+
    <IconSmall name="repo" />
  </div>
  <span class="name">{name} @ {formatCommit(oid)}</span>
</div>
modified tests/e2e/project.spec.ts
@@ -294,7 +294,7 @@ test("peer and branch switching", async ({ page }) => {
      );
      await expect(
        page.getByRole("link", {
-
          name: "Commits 6",
+
          name: "Commits 7",
        }),
      ).toBeVisible();
    }
@@ -363,7 +363,7 @@ test("peer and branch switching", async ({ page }) => {
      );
      await expect(
        page.getByRole("link", {
-
          name: "Commits 7",
+
          name: "Commits 8",
        }),
      ).toBeVisible();
      await expect(