Skip to content

Commit

Permalink
🐛 fix: fix topic scroll issue (lobehub#3505)
Browse files Browse the repository at this point in the history
* 🔧 chore: only include db file with server test

* 🐛 fix: fix topic scroll
  • Loading branch information
arvinxx authored Aug 18, 2024
1 parent c68cffd commit c719c7a
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import { useSessionStore } from '@/store/session';
import { useUserStore } from '@/store/user';
import { ChatTopic } from '@/types/topic';

import { Placeholder, SkeletonList } from '../SkeletonList';
import { SkeletonList } from '../SkeletonList';
import TopicItem from './TopicItem';

const TopicListContent = memo(() => {
Expand Down Expand Up @@ -85,18 +85,18 @@ const TopicListContent = memo(() => {
</Flexbox>
)}
<Virtuoso
components={{ ScrollSeekPlaceholder: Placeholder }}
// components={{ ScrollSeekPlaceholder: Placeholder }}
computeItemKey={(_, item) => item.id}
data={topics}
fixedItemHeight={44}
initialTopMostItemIndex={Math.max(activeIndex, 0)}
itemContent={itemContent}
overscan={44 * 10}
ref={virtuosoRef}
scrollSeekConfiguration={{
enter: (velocity) => Math.abs(velocity) > 350,
exit: (velocity) => Math.abs(velocity) < 10,
}}
// scrollSeekConfiguration={{
// enter: (velocity) => Math.abs(velocity) > 350,
// exit: (velocity) => Math.abs(velocity) < 10,
// }}
/>
</>
);
Expand Down
1 change: 1 addition & 0 deletions vitest.server.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ export default defineConfig({
coverage: {
all: false,
exclude: ['src/database/server/core/dbForTest.ts'],
include: ['src/database/server/**/*.ts'],
provider: 'v8',
reporter: ['text', 'json', 'lcov', 'text-summary'],
reportsDirectory: './coverage/server',
Expand Down

0 comments on commit c719c7a

Please sign in to comment.