Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

fix infinite loading issue in Search Dialog#632

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Open
LooseLi wants to merge1 commit intoNotionX:master
base:master
Choose a base branch
Loading
fromLooseLi:fix-search-dialog

Conversation

@LooseLi
Copy link
Contributor

@LooseLiLooseLi commentedMay 7, 2025
edited
Loading

Description

Fixes#593

When using the search functionality in react-notion-x, we identified a user experience issue: sometimes the loading icon continues to spin indefinitely when users enter content in the search dialog, even after the search request has successfully returned.

Solution

We resolved the infinite loading issue in the search dialog with the following improvements:

  1. replacethrottle withdebounce:
  • switched from throttle to debounce, which is more suitable for search scenarios
  • added the{trailing: true} option to ensure that a search is always executed after the user stops typing
  • this prevents multiple searches from being triggered when users type quickly, improving performance
  1. optimize query state management:
  • store the current query for later comparison
  • only update the UI state when the current query matches the query in the component state
  • prevent old search results from overwriting newer ones, solving state synchronization issues
  1. improve error handling:
  • addtry-catch blocks to capture errors that may occur during the search process

Notion Test Page ID

I directly provided thesearchNotion function in/NotionPage.tsx toNotionRenderer, enabling the search component to display and fixing related issues.

transitive-bullshit reacted with heart emoji
@vercel
Copy link

vercelbot commentedMay 7, 2025
edited
Loading

The latest updates on your projects. Learn more aboutVercel for Git ↗︎

NameStatusPreviewUpdated (UTC)
react-notion-x❌ Failed (Inspect)May 7, 2025 9:44am
react-notion-x-minimal-demo❌ Failed (Inspect)May 7, 2025 9:44am

Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

No reviews

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Search dialog could spin infinitely

1 participant

@LooseLi

[8]ページ先頭

©2009-2025 Movatter.jp