Skip to content

There can be more than Notion and Miro. AFFiNE(pronounced [ə‘fain]) is a next-gen knowledge base that brings planning, sorting and creating all together. Privacy first, open-source, customizable and ready to use.

fix(core): unexpected routing jump behavior (#6524)

JimmFly7a1eb63d4258
diff --git a/packages/frontend/core/src/components/page-list/collections/collection-list-item.tsx b/packages/frontend/core/src/components/page-list/collections/collection-list-item.tsx
index 1dba9eaa6b..81d2766ba8 100644
--- a/packages/frontend/core/src/components/page-list/collections/collection-list-item.tsx
+++ b/packages/frontend/core/src/components/page-list/collections/collection-list-item.tsx
@@ -1,10 +1,10 @@
import { Checkbox } from '@affine/component';
import { getDNDId } from '@affine/core/hooks/affine/use-global-dnd-helper';
+import { WorkbenchLink } from '@affine/core/modules/workbench';
import { useAFFiNEI18N } from '@affine/i18n/hooks';
import { useDraggable } from '@dnd-kit/core';
import type { PropsWithChildren } from 'react';
import { useCallback, useMemo } from 'react';
-import { Link } from 'react-router-dom';
import { selectionStateAtom, useAtom } from '../scoped-atoms';
import type {
@@ -219,9 +219,9 @@ function CollectionListItemWrapper({
if (to) {
return (
- <Link {...commonProps} to={to}>
+ <WorkbenchLink {...commonProps} to={to}>
{children}
- </Link>
+ </WorkbenchLink>
);
} else {
return <div {...commonProps}>{children}</div>;
diff --git a/packages/frontend/core/src/components/page-list/tags/tag-list-item.tsx b/packages/frontend/core/src/components/page-list/tags/tag-list-item.tsx
index 64e0c4e802..46763d9f7a 100644
--- a/packages/frontend/core/src/components/page-list/tags/tag-list-item.tsx
+++ b/packages/frontend/core/src/components/page-list/tags/tag-list-item.tsx
@@ -1,10 +1,10 @@
import { Checkbox } from '@affine/component';
import { getDNDId } from '@affine/core/hooks/affine/use-global-dnd-helper';
+import { WorkbenchLink } from '@affine/core/modules/workbench';
import { useAFFiNEI18N } from '@affine/i18n/hooks';
import { useDraggable } from '@dnd-kit/core';
import type { PropsWithChildren } from 'react';
import { useCallback, useMemo } from 'react';
-import { Link } from 'react-router-dom';
import { selectionStateAtom, useAtom } from '../scoped-atoms';
import type { DraggableTitleCellData, TagListItemProps } from '../types';
@@ -205,9 +205,9 @@ function TagListItemWrapper({
if (to) {
return (
- <Link {...commonProps} to={to}>
+ <WorkbenchLink {...commonProps} to={to}>
{children}
- </Link>
+ </WorkbenchLink>
);
} else {
return <div {...commonProps}>{children}</div>;