Skip to content

Commit 7342957

Browse files
quark-zjufacebook-github-bot
authored andcommitted
RenderDag: enable animation
Summary: Get animation with just 4-line change! There are feedback about animation (ex. fading in or out the menu) could hurt productivity. In this case, it's a sliding, not fading animation, making it a bit easier to follow what are changed / moved / not changed. So it seems to provide some value. With this, for example, it seems to make sense to avoid double "You were here", "You are moving here" labels, since the moving source is animated to destination. Reviewed By: muirdm, evangrayk Differential Revision: D52667620 fbshipit-source-id: e241454ca0d04d4d51ec307b293881ac1e97bba4
1 parent 5912e2f commit 7342957

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

addons/isl/src/RenderDag.tsx

+4-3
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
import type {Dag, DagCommitInfo} from './dag/dag';
99
import type {HashSet} from './dag/set';
1010

11+
import {AnimatedReorderGroup} from './AnimatedReorderGroup';
1112
import {AvatarPattern} from './Avatar';
1213
import {InlineBadge} from './InlineBadge';
1314
import {LinkLine, NodeLine, PadLine, Renderer} from './dag/render';
@@ -236,15 +237,15 @@ export function RenderDag(props: RenderDagProps) {
236237
// +------+---------+
237238
if (isIrregular) {
238239
renderedRows.push(
239-
<div className="render-dag-row" key={'top:' + info.hash}>
240+
<div className="render-dag-row" data-reorder-id={'.'} key={'top:' + info.hash}>
240241
<div className="render-dag-row-left-side">{nodeLinePart}</div>
241242
</div>,
242243
);
243244
}
244245

245246
const rightSide = <div className="render-dag-row-right-side">{renderCommit?.(info)}</div>;
246247
renderedRows.push(
247-
<div className="render-dag-row" key={info.hash}>
248+
<div className="render-dag-row" data-reorder-id={info.hash} key={info.hash}>
248249
{leftSide}
249250
{rightSide}
250251
</div>,
@@ -255,7 +256,7 @@ export function RenderDag(props: RenderDagProps) {
255256
const fullClassName = ((className ?? '') + ' render-dag').trimStart();
256257
return (
257258
<div className={fullClassName} {...restProps}>
258-
{renderedRows}
259+
<AnimatedReorderGroup animationDuration={100}>{renderedRows}</AnimatedReorderGroup>
259260
</div>
260261
);
261262
}

0 commit comments

Comments
 (0)