Radish alpha
r
Radicle desktop app
Radicle
Git (anonymous pull)
Log in to clone via SSH
Expand All Repos section when navigating to a repo
rudolfs wants to merge 1 commit into main · opened 7 days ago

When we land on a repo via notification inbox the repository wouldn't be visible if the section was collapsed. Now we expand it and scroll into view so we see which repository we're browsing.

lint unit-test e2e 👉 Workflow runs 👉 Branch on GitHub

2 files changed +23 -0 15955af7 4ef24c2b
modified src/components/NotificationTeaser.svelte
@@ -24,6 +24,7 @@
  import InlineTitle from "@app/components/InlineTitle.svelte";
  import NodeId from "@app/components/NodeId.svelte";
  import { closeFocused } from "@app/components/Popover.svelte";
+
  import { revealRepoInSidebar } from "@app/components/SidebarRepoList.svelte";

  interface Props {
    rid: string;
@@ -181,6 +182,7 @@
  class="notification-teaser"
  onclick={() => {
    if (route) {
+
      revealRepoInSidebar(rid);
      void push(route);
      closeFocused();
    }
modified src/components/SidebarRepoList.svelte
@@ -1,3 +1,7 @@
+
<script lang="ts" module>
+
  export let revealRepoInSidebar: (rid: string) => void = () => undefined;
+
</script>
+

<script lang="ts">
  import type { RepoInfo } from "@bindings/repo/RepoInfo";
  import type { RepoSummary } from "@bindings/repo/RepoSummary";
@@ -124,6 +128,22 @@
    repos.filter(r => !pinnedRepoIds.value.includes(r.rid)).length,
  );

+
  revealRepoInSidebar = (rid: string) => {
+
    if (pinnedRepoIds.value.includes(rid)) return;
+
    if (!repos.some(r => r.rid === rid)) return;
+

+
    filterQuery = "";
+
    filterOpen = false;
+
    reposExpanded.value = true;
+

+
    requestAnimationFrame(() => {
+
      const row = document.querySelector(
+
        `[data-unpinned-rid="${CSS.escape(rid)}"]`,
+
      );
+
      row?.scrollIntoView({ block: "nearest" });
+
    });
+
  };
+

  const ANIMATION_DURATION_MS = 220;
  let animatingPinnedList = $state(false);
  let animationTimeout: ReturnType<typeof setTimeout> | undefined;
@@ -656,6 +676,7 @@
      {#each unpinnedFilteredRepos as repo (repo.rid)}
        <div
          class="repo-row-group"
+
          data-unpinned-rid={repo.rid}
          animate:flip={{ duration: animationDuration }}
          in:receive={{ key: repo.rid, duration: animationDuration }}
          out:send={{ key: repo.rid, duration: animationDuration }}>