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
Rūdolfs Ošiņš committed 7 days ago
commit 4ef24c2ba6aeabb3e0359d67c7e2a428bfa03e85
parent 15955af7fd0baef9c6f9ea7570151cae5d2701f1
2 files changed +23 -0
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 }}>