Metadata
diff --git a/desktop/src/components/Comment.svelte b/desktop/src/components/Comment.svelte
index 950e3b3ac..6d3e5ae06 100644
--- a/desktop/src/components/Comment.svelte
+++ b/desktop/src/components/Comment.svelte
@@ -17,6 +17,7 @@
import type { CommentOrigin } from "@app/lib/codeComments";
import { writeToClipboard } from "@app/lib/invoke";
+ import { scrollBehavior } from "@app/lib/motion";
import * as utils from "@app/lib/utils";
import DropdownList from "@app/components/DropdownList.svelte";
@@ -145,7 +146,7 @@
mode = "edit";
await tick();
utils.scrollIntoView(`edit-${id}`, {
- behavior: "smooth",
+ behavior: scrollBehavior(),
block: "center",
});
} else if (mode === "edit") {
diff --git a/desktop/src/components/CommitAuthors.svelte b/desktop/src/components/CommitAuthors.svelte
index ce36ea404..7a5b915c7 100644
--- a/desktop/src/components/CommitAuthors.svelte
+++ b/desktop/src/components/CommitAuthors.svelte
@@ -94,11 +94,6 @@
.avatars .avatar + .more {
margin-left: 0.25rem;
}
- @media (prefers-reduced-motion: reduce) {
- .avatars .avatar + .avatar {
- transition: none;
- }
- }
.card {
display: flex;
flex-direction: column;
diff --git a/desktop/src/components/DraftReviewBar.svelte b/desktop/src/components/DraftReviewBar.svelte
index 6dd31e7d9..2ccdc4e02 100644
--- a/desktop/src/components/DraftReviewBar.svelte
+++ b/desktop/src/components/DraftReviewBar.svelte
@@ -8,6 +8,7 @@
import type { DraftReview } from "@app/lib/draftReviewStorage";
import { draftReviewStorage } from "@app/lib/draftReviewStorage";
+ import { motion } from "@app/lib/motion";
import { formatAnchor } from "@app/lib/pierreComments";
import { isPublishableReview, verdictBadge } from "@app/lib/utils";
@@ -573,8 +574,8 @@
+ in:fly={{ y: 120, duration: motion(260), easing: backOut }}
+ out:fly={{ y: 120, duration: motion(180), easing: cubicIn }}>
diff --git a/desktop/src/components/Mention.svelte b/desktop/src/components/Mention.svelte
index 240cf42e1..1013502e6 100644
--- a/desktop/src/components/Mention.svelte
+++ b/desktop/src/components/Mention.svelte
@@ -22,6 +22,7 @@
referenceRoute,
toRadReference,
} from "@app/lib/mentions";
+ import { scrollBehavior } from "@app/lib/motion";
import type { Route } from "@app/lib/router";
import { push, routeToPath } from "@app/lib/router";
import { fetchingRepos } from "@app/lib/seedRepo";
@@ -226,12 +227,12 @@
/auto|scroll/.test(overflow) &&
node.scrollHeight > node.clientHeight
) {
- node.scrollTo({ top: 0, behavior: "smooth" });
+ node.scrollTo({ top: 0, behavior: scrollBehavior() });
return;
}
node = node.parentElement;
}
- window.scrollTo({ top: 0, behavior: "smooth" });
+ window.scrollTo({ top: 0, behavior: scrollBehavior() });
}
function isCurrentPage(candidate: Route): boolean {
diff --git a/desktop/src/components/PatchActivityItem.svelte b/desktop/src/components/PatchActivityItem.svelte
index 002dd16db..4d56067b7 100644
--- a/desktop/src/components/PatchActivityItem.svelte
+++ b/desktop/src/components/PatchActivityItem.svelte
@@ -14,6 +14,7 @@
import { itemDiff } from "@app/lib/cobActivity";
import { cachedConfig, writeToClipboard } from "@app/lib/invoke";
import { entityUrl } from "@app/lib/mentions";
+ import { motion } from "@app/lib/motion";
import { splitDescription } from "@app/lib/revisionDescription";
import {
absoluteTimestamp,
@@ -434,7 +435,7 @@
{/if}
+
{/if}
diff --git a/desktop/src/components/PierreDiff.svelte b/desktop/src/components/PierreDiff.svelte
index 18013d72e..c2f73e3f6 100644
--- a/desktop/src/components/PierreDiff.svelte
+++ b/desktop/src/components/PierreDiff.svelte
@@ -24,6 +24,7 @@
import { fontSettings } from "@app/lib/appearance.svelte";
import type { CodeComments } from "@app/lib/codeComments";
+ import { scrollBehavior } from "@app/lib/motion";
import { forwardPatchActivityContext } from "@app/lib/patchActivityContext";
import type {
CommentAnchor,
@@ -380,7 +381,7 @@
// is not the container's `scrollTop` and has to go through `scrollTo`.
function scrollToPosition(
position: number,
- behavior: "smooth" | "instant" = "smooth",
+ behavior: "smooth" | "instant" = scrollBehavior(),
): void {
view?.scrollTo({ type: "position", position, behavior });
}
diff --git a/desktop/src/components/Revision.svelte b/desktop/src/components/Revision.svelte
index a01212b47..b41b9cbf6 100644
--- a/desktop/src/components/Revision.svelte
+++ b/desktop/src/components/Revision.svelte
@@ -34,6 +34,7 @@
cachedListCommits,
invoke,
} from "@app/lib/invoke";
+ import { motion } from "@app/lib/motion";
import type { PatchActivityData } from "@app/lib/patchTimeline";
import { patchTimeline } from "@app/lib/patchTimeline";
import { revisionRange } from "@app/lib/revisionCompare";
@@ -1173,7 +1174,9 @@
? ""
: (revBody ?? "")}
{#if expanded}
-
+
expandCommitGroup(groupKey)}>
@@ -1427,7 +1430,7 @@
{:else if isOlder}
+ transition:slide={{ duration: motion(180) }}>
toggleRevisionRun(data.groupKey, data.revisionIds)}>
diff --git a/desktop/src/components/SidebarRepoList.svelte b/desktop/src/components/SidebarRepoList.svelte
index 4c15c3c7f..e46a28def 100644
--- a/desktop/src/components/SidebarRepoList.svelte
+++ b/desktop/src/components/SidebarRepoList.svelte
@@ -77,6 +77,7 @@
import { labs } from "@app/lib/labs";
import { entityUrl } from "@app/lib/mentions";
import { show } from "@app/lib/modal";
+ import { motion } from "@app/lib/motion";
import { repoListScope } from "@app/lib/repoListScope";
import * as router from "@app/lib/router";
import { seededRepos, seedRepo, setFetchingRepos } from "@app/lib/seedRepo";
@@ -310,7 +311,7 @@
// filter/refresh that should not animate at all.
fallback: (node: Element, params: CrossfadeParams & { key?: string }) =>
params.key !== undefined && params.key === unseedingRid
- ? fadeCollapse(node, ANIMATION_DURATION_MS)
+ ? fadeCollapse(node, motion(ANIMATION_DURATION_MS))
: { duration: 0 },
});
@@ -364,7 +365,7 @@
if (animationTimeout !== undefined) clearTimeout(animationTimeout);
animationTimeout = setTimeout(() => {
animatingPinnedList = false;
- }, ANIMATION_DURATION_MS);
+ }, motion(ANIMATION_DURATION_MS));
fn();
}
@@ -1021,9 +1022,9 @@
drag.dropPosition === "after" &&
drag.draggingRid !== repo.rid}
{...{ [DRAG_RID_ATTRIBUTE]: repo.rid }}
- animate:flip={{ duration: animationDuration }}
- in:receive={{ key: repo.rid, duration: animationDuration }}
- out:send={{ key: repo.rid, duration: animationDuration }}
+ animate:flip={{ duration: motion(animationDuration) }}
+ in:receive={{ key: repo.rid, duration: motion(animationDuration) }}
+ out:send={{ key: repo.rid, duration: motion(animationDuration) }}
onoutroend={() => clearUnseeding(repo.rid)}>
{@render repoRowInner(repo, true)}
@@ -1092,8 +1093,8 @@
{#if !sidebarCollapsed.value && unpinnedReposCount > 1}
+ in:scale={{ duration: motion(200), easing: backOut, start: 0 }}
+ out:fade={{ duration: motion(200) }}>
{unpinnedReposCount}
{/if}
@@ -1187,7 +1188,7 @@
{@const activeProject = activeRepo?.payloads["xyz.radicle.project"]}
+ transition:slide={{ duration: motion(ANIMATION_DURATION_MS) }}>
{#if labs.boards}
{@render subItem(
repo.name,
@@ -1259,8 +1260,8 @@
{#if !sidebarCollapsed.value && count !== undefined}
+ in:scale={{ duration: motion(200), easing: backOut, start: 0 }}
+ out:fade={{ duration: motion(200) }}>
{count}
{/if}
@@ -1271,7 +1272,7 @@
{#if reposExpanded.value}