Skip to content

feat(History): add lazy mode to load more chats#118

Merged
ananas7 merged 1 commit intomainfrom
add-history-lazy-load
Mar 13, 2026
Merged

feat(History): add lazy mode to load more chats#118
ananas7 merged 1 commit intomainfrom
add-history-lazy-load

Conversation

@ananas7
Copy link
Copy Markdown
Collaborator

@ananas7 ananas7 commented Mar 6, 2026

No description provided.

@gravity-ui
Copy link
Copy Markdown
Contributor

gravity-ui Bot commented Mar 6, 2026

🚀 Prerelease version published!

Install this PR version:

npm i --save-dev @gravity-ui/aikit@1.11.1-beta.1d2e5c8e60e456f30f447051a22c00c8fdebc84c.0

} = props;
const [filteredItemCount, setFilteredItemCount] = useState<number | null>(null);
const [loadedChats, setLoadedChats] = useState<ChatType[]>([]);
const [lazyLoading, setLazyLoading] = useState(false);
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why you have two state of loading? lazyLoading and isLoadingRef ?
Is it for optimization?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks, fixed

}, [filterFunction]);

const handleLoadMoreClick = useCallback(() => {
(onLoadMore as () => void)?.();
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think you need to call handleLazyLoadMore here

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks, fixed

@ananas7 ananas7 force-pushed the add-history-lazy-load branch from b30c1e5 to c5a7f01 Compare March 13, 2026 09:54
@gravity-ui-bot
Copy link
Copy Markdown

Preview is ready.

@ananas7 ananas7 force-pushed the add-history-lazy-load branch from c5a7f01 to dfbe2b2 Compare March 13, 2026 11:52
@ananas7 ananas7 force-pushed the add-history-lazy-load branch from dfbe2b2 to 1d2e5c8 Compare March 13, 2026 11:54
@ananas7 ananas7 added this pull request to the merge queue Mar 13, 2026
Merged via the queue into main with commit 65606c9 Mar 13, 2026
4 checks passed
@ananas7 ananas7 deleted the add-history-lazy-load branch March 13, 2026 12:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants