Skip to content

Show Loading text when palette has nothing to display#45

Draft
aswasif007 wants to merge 1 commit into
trunkfrom
update/loading-text-when-empty
Draft

Show Loading text when palette has nothing to display#45
aswasif007 wants to merge 1 commit into
trunkfrom
update/loading-text-when-empty

Conversation

@aswasif007
Copy link
Copy Markdown
Contributor

Summary

Restores the "Loading..." copy in the palette's empty slot while a resolver is in flight, addressing review feedback on #39 (discussion r3217198070).

After the in-input spinner change in #39, the empty state still rendered the regular "No results found." / "No matching options." / "No options available for X." text even when the resolver was still pending. When nothing else is on screen, that copy is misleading — it implies the resolver finished with zero results when in fact it hasn't returned yet.

What changed

  • Threads a resolving: boolean prop through CommandListContent.
  • Swaps the empty-state copy for "Loading..." in all three empty slots (top-level command list, param selection with no options, param selection with options) while a resolve is pending.
  • Items remain visible whenever they exist — this only takes effect when the list is otherwise empty.

Testing

  • pnpm lint
  • pnpm format:check
  • pnpm test (135 tests pass; new test asserts the empty slot shows "Loading..." when the user filters all commands out while a resolve is pending)
  • pnpm build

The recent shift to an in-input spinner left the empty-state slot
showing the regular "No results found." / "No matching options." /
"No options available for X." copy even while the resolver was still
in flight. When there's nothing else on screen, that copy is wrong —
it tells the user the resolver returned no results when in fact it
hasn't returned yet.

Thread a `resolving` flag into `CommandListContent` and use it to
swap the empty-state copy for "Loading..." while a resolve is
pending. Items remain visible whenever they exist, so this only
takes effect when the list is otherwise empty.

Co-Authored-By: Agent Rico
@aswasif007 aswasif007 marked this pull request as draft May 11, 2026 08:14
Copy link
Copy Markdown
Contributor

@shekharnwagh shekharnwagh left a comment

Choose a reason for hiding this comment

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

I know this isn't marked ready for review, but tested it and it looks good to me.

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.

2 participants