fix: keep table search mounted during view-data refetch by tiensonqin · Pull Request #13132 · logseq/logseq · GitHub
Skip to content

fix: keep table search mounted during view-data refetch - #13132

Open
tiensonqin wants to merge 1 commit into
masterfrom
logseq/fix-table-search-remount-e43b
Open

fix: keep table search mounted during view-data refetch#13132
tiensonqin wants to merge 1 commit into
masterfrom
logseq/fix-table-search-remount-e43b

Conversation

@tiensonqin

Copy link
Copy Markdown
Contributor

Fixes db-test#1118.

Problem

In a DB-graph Table view, opening search and typing caused the input to unmount after the 300ms debounce. The filter still applied, but the field collapsed back to the magnifying-glass button.

loaded-view-aux puts debounced-input into view-resource-context. When that value changes, use-resource refetches and view-data becomes nil. The component then swapped the entire view-container (including the search toolbar) for skeletons. search keeps show-input? in local React state, so remounting reset it to false.

Change

  • Keep the last successful view-data while a refetch is in flight (stale-while-revalidate). Skeletons are used only on the initial load, when there is no previous payload.
  • Keep the search input visible whenever the query is non-empty, so a remount cannot collapse a typed filter. Escape and the X button still clear the query and collapse the field.

Test plan

  • bb dev:test -v frontend.components.views-test
    • Initial view-data nil still shows skeletons and does not mount view-container.
    • After a successful load, a nil refetch keeps the toolbar mounted and preserves the last payload plus the typed query.
    • Search with a non-empty query stays open after remount; empty query still collapses.
  • Manual: open a DB-graph Table view, click search, type several characters across the debounce. The input should stay focused/open. Escape / X should still close and clear it.
Open in Web Open in Cursor 

Table search remounted when use-resource cleared view-data, which reset
the local show-input? state. Keep the last successful payload while a
refetch is in flight and leave the input open whenever a query is set.

Co-authored-by: Tienson Qin <tiensonqin@gmail.com>
Copilot AI lite review requested due to automatic review settings August 27, 2026 16:49

Copilot AI left a comment

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.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@tiensonqin tiensonqin self-assigned this Aug 31, 2026
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.

Search field in **Table** views disappears when start typing.

3 participants